Cannot use jacoco JVM args and surefire JVM args together in maven

Try using @{argLine} instead of ${argLine} (or surefire.argLine in your case) It allows surefire to read a property as modified by other plugins instead of reading the one substituted by Maven itself. Then you can set the argLine param to empty in Maven properties: <properties> <argLine></argLine> </properties> Which now will not cause any problems. More … Read more

maven can’t find my local artifacts

Prior to Maven 3.0.x, Maven did not track the origin of files in the local repository. This could result in build issues, especially if you were building something that listed the (now dead) very borked java.net2 repository… Not only did that repository change released artifacts (extremely bad and evil practice) but it also published artifacts … Read more

Maven versioning best practices [closed]

You should use the maven-release-plugin to release your artifacts. Than automatically all your versions will be incremented by the release-plugin. The exception might be if you are going from 1.0.3-SNAPSHOT to 1.1.0-SNAPSHOT . The timeline for developing with Maven is: 1.0.0-SNAPSHOT 1.0.0 1.0.1-SNAPSHOT 1.0.1 1.0.2-SNAPSHOT 1.0.2 .. To go for the step from a SNAPSHOT … Read more

Maven: The packaging for this project did not assign a file to the build artifact

I don’t know if this is the answer or not but it might lead you in the right direction… (I believe these steps are for people working with Intellij IDE. The install:install is available in the Maven panel on the right by default. The below steps are alternative to it.) The command install:install is actually … Read more

How can I skip tests in maven install goal, while running them in maven test goal?

It sounds like you didn’t understand the concept of the build life-cycle in Maven. If you run mvn install all life-cycle phases (including the install phase itself) run before the install phase. This means running the following phases: validate initialize generate-sources process-sources generate-resources process-resources compile process-classes generate-test-sources process-test-sources generate-test-resources process-test-resources test-compile process-test-classes test prepare-package package … Read more

Maven check for updated dependencies in repository

The Maven Versions plugin and it’s display-dependency-updates mojo are what you’re looking for: mvn versions:display-dependency-updates Here is what the output looks like: [INFO] ———————————————————————— [INFO] Building Build Helper Maven Plugin [INFO] task-segment: [versions:display-dependency-updates] [INFO] ———————————————————————— [INFO] [versions:display-dependency-updates] [INFO] [INFO] The following dependency updates are available: [INFO] org.apache.maven:maven-artifact …………………… 2.0 -> 2.0.9 [INFO] org.apache.maven:maven-plugin-api …………………. 2.0 … Read more

Maven command to determine which settings.xml file Maven is using

Start maven with -X option (debug) and examine the beginning of the output. There should be something like this: … [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from c:\….\apache-maven-3.0.3\conf\settings.xml [DEBUG] Reading user settings from c:\….\.m2\settings.xml [DEBUG] Using local repository at C:\….\repository … (Original directory names are removed by me)

Prevent unit tests but allow integration tests in Maven

I found the simplest way to skip only surefire tests is to configure surefire (but not failsafe) as follows: <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.14</version> <configuration> <!– skips surefire tests without skipping failsafe tests. Property value seems to magically default to false –> <skipTests>${skip.surefire.tests}</skipTests> </configuration> </plugin> This allows you to run mvn verify -Dskip.surefire.tests and only surefire, not … Read more

Unpack inner zips in zip with Maven

You can unzip any files using ant task runner plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>prepare</id> <phase>validate</phase> <configuration> <tasks> <echo message=”prepare phase” /> <unzip src=”https://stackoverflow.com/questions/3264064/zips/archive.zip” dest=”output/” /> <unzip src=”output/inner.zip” dest=”output/” /> <unzip dest=”output”> <fileset dir=”archives”> <include name=”prefix*.zip” /> </fileset> </unzip> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>