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

What is the difference between artifactId and groupId in pom.xml?

From maven.apache.org, Naming Conventions: artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it’s a third party jar you have to take the name of the jar as it’s distributed. eg. maven, commons-math groupId will … 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

When to use MojoExecutionException vs MojoFailureException in Maven

It seems you should throw a MojoExecutionException if the problem makes it impossible to continue with the build, and use the MojoFailureException otherwise. You can control the behavior for handing MojoFailureExpections when maven is run. The following link details the difference: https://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html#writing-plugins-sect-failure Broken link? Google search sonatype writing-plugins-sect-custom-plugin writing-plugins-sect-failure

how to integrate Angular 2 + Java Maven Web Application

Here is what I did:- Install Nodejs v6.9+ Run npm install @angular/cli –g for Angular CLI Install Apache Maven or use any Maven friendly IDE Use your required Maven configuration, I used simple webapp (WAR). Directory Stucture (Except for ngapp folder rest is standard Maven structure.) ngfirst ├── pom.xml ├── src │   └── main │   … Read more

webxml attribute is required with Servlet 3.0

By default maven-war-plugin will fail if it can’t find web.xml, see here. If you are creating Maven project using latest archetype, you will get this parameter set to false: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> If you want to use web.xml instead of annotations, just create WEB-INF/web.xml and define servlet … Read more

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