Maven Run Project

See the exec maven plugin. You can run Java classes using: mvn exec:java -Dexec.mainClass=”com.example.Main” [-Dexec.args=”argument1″] … The invocation can be as simple as mvn exec:java if the plugin configuration is in your pom.xml. The plugin site on Mojohaus has a more detailed example. <project> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2.1</version> <configuration> <mainClass>com.example.Main</mainClass> <arguments> <argument>argument1</argument> </arguments> … Read more

Maven does not find JUnit tests to run

By default Maven uses the following naming conventions when looking for tests to run: Test* *Test *Tests (has been added in Maven Surefire Plugin 2.20) *TestCase If your test class doesn’t follow these conventions you should rename it or configure Maven Surefire Plugin to use another pattern for test classes.

Unable to compile simple Java 10 / Java 11 project with Maven

As of 30Jul, 2018 to fix the above issue, one can configure the java version used within maven to any up to JDK/11 and make use of the maven-compiler-plugin:3.8.0 to specify a release of either 9,10,11 without any explicit dependencies. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <release>11</release> <!–or <release>10</release>–> </configuration> </plugin> Note:- The default value for … Read more

When maven says “resolution will not be reattempted until the update interval of MyRepo has elapsed”, where is that interval specified?

I used to solve this issue by deleting the corresponding failed to download artifact directory in my local repo. Next time I run the maven command the artifact download is triggered again. Therefore I’d say it’s a client side setting. Nexus side (server repo side), this issue is solved configuring a scheduled task. Client side, … Read more

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

I had the exact same problem. [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.5 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> … Read more