Maven build [WARNING] we have a duplicate class

Take a look at the “Dependency Exclusions” section in the Maven doc. In your provided example, I’ll exclude the commons-logging:commons-logging-api:jar:1.0.4:compile dependency from org.apache.hadoop.hive:hive-common:jar:0.7.1-cdh3u3:compile. In your pom.xml : <dependency> <groupId>org.apache.hadoop.hive</groupId> <artifactId>hive-common:jar</artifactId> <version>0.7.1-cdh3u3</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging-api</artifactId> </exclusion> </exclusions> </dependency>

How to set up an environment variable in mvn pom?

Some plugins, like surefire, let you set them. There’s no way, in general, in the pom. The doc for surefire is is here. Surefire will set environment variables for the duration of the run of the tests, not for anything else. And you have to make surefire fork. In the configuration … <configuration> <forkMode>always</forkMode> <environmentVariables> … Read more

What is the difference between “Maven Install” and “Maven Build” with M2Eclipse?

First of all, build is not a phase in the standard Maven lifecycles, whereas install is one. mvn install will invoke all the phases up to the phase install, which generally consists of compiling the source code, packaging the project and installing it in the local repository. To be clear, we’re talking about what M2Eclipse … Read more

How do I download a Maven artifact at the command line without using dependency:get or maven-download-plugin?

The copy goal is more appropriate here and it lets you specify an output directory as well (which is deprecated in the get goal): mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -Dartifact=groupId:artifactId:version[:packaging][:classifier] -DoutputDirectory=[target] -Dmdep.useBaseVersion=true mdep.useBaseVersion=true will remove timestamps from snapshot builds.

How to disable Maven auto import automatically in IntelliJ IDEA?

Uncheck Project Settings | Maven | Importing | Import Maven projects automatically. For IDEA 14+ it’s under Settings | Build, Execution, Deployment | Build Tools | Maven | Importing | Import Maven projects automatically. For IDEA 2020+, open Settings | Build, Execution, Deployment | Build Tools and check “Reload projects after changes in the build … Read more

Values for os.family in Maven profile activation condition

A very useful Maven command for checking these OS properties on your machine: mvn enforcer:display-info Example output on a SunOS / Sparc host: [INFO] Maven Version: 3.0.4 [INFO] JDK Version: 1.6.0_34 normalized as: 1.6.0-34 [INFO] OS Info: Arch: sparc Family: unix Name: sunos Version: 5.8 Example output on a Linux host: [INFO] Maven Version: 3.0.4 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)