Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved

Your debug output indicates that Clean is the first thing that it’s trying to run, so I’m guessing it’s failing to download any plugins from central. First off, see if you can download the plugin jar directly in a web browser: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar If that works then your web browser has connectivity to central but maven … Read more

How to support multiple Scala versions in a library

Most of this is well supported in sbt within a single source tree Version specific source directories are usually not need. Scala programs tends to be source compatible – so often in fact that crossbuilding (http://www.scala-sbt.org/release/docs/Detailed-Topics/Cross-Build) has first class support in sbt. If you really need version specific code, you can add extra source folders. … Read more

How to understand Maven dependency tree

It’s a dependency tree. The things below a listing are dependencies of their parent. [INFO] +- org.springframework:spring-core:jar:4.0.2.RELEASE:compile [INFO] | \- commons-logging:commons-logging:jar:1.1.3:compile Spring-core depends on commons-logging. [INFO] +- org.glassfish.jersey.core:jersey-server:jar:2.6:compile [INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.6:compile [INFO] | | +- (javax.ws.rs:javax.ws.rs-api:jar:2.0:compile – omitted for duplicate) [INFO] | | +- (javax.annotation:javax.annotation-api:jar:1.2:compile – omitted for duplicate) Jersey-server depends on jersey-common. Jersey-common … Read more

Maven Cobertura plugin not generating coverage.xml

Add below lines to your application Goals:(configure section of the application in jenkins) cobertura:cobertura -Dcobertura.report.format=xml pom.xml changes: <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.6</version> <configuration> <formats> <format>html</format> <format>xml</format> </formats> </configuration> </plugin> </plugins>

How to get access to Maven’s dependency hierarchy within a plugin

The dependency plugin has the tree goal that does most of this work. It processes a MavenProject using the DependencyTreeBuilder, this returns a DependencyNode with hierarchical information about the resolved dependencies (and their transitive dependencies). You can copy much of the code directly from the TreeMojo. It uses the CollectingDependencyNodeVisitor to traverse the tree and … Read more

Maven: Including a META-INF folder in the classes folder

In general, for a Java-based Maven project, non-source files should go in the src/main/resources sub-directory of the project. The contents of that resources directory are copied to the output directory (by default, target/classes) during the process-resources phase of the build. For Maven WAR projects, it is slightly more complicated: there is also the src/main/webapp directory, … Read more

Maven Surefire plugin “Error occured in starting fork, check output in log”

You need to setup surefire plugin to use <forkMode>once</forkMode> like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.5</version> <configuration> <skipTests>false</skipTests> <testFailureIgnore>true</testFailureIgnore> <forkMode>once</forkMode> </configuration> </plugin>

How to create a project using maven-archetype-plugin? What is artefactId etc?

mvn archetype:generate command is used to create a project from an existing template. There are several archetype’s defined by many developers and project groups. When you run the command, maven does following things: Downloads maven-archetype-plugin’s latest version. Lists all archetype’s that can be used to create a project from. If you defined an archetype while … Read more