Is dependency-reduced-pom.xml automatically used instead of pom.xml?

The dependency-reduced-pom.xml is generated at build time into ${basedir} of the project. This file is a temporary file that is only used for packaging into the shaded jar. Quoting the documentation of the createDependencyReducedPom attribute: Flag whether to generate a simplified POM for the shaded artifact. If set to true, dependencies that have been included … Read more

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

Maven 3 – How to add annotation processor dependency?

The annotationProcessorPaths option can be used in recent versions of the Maven compiler plug-in: <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.1</version> <configuration> <annotationProcessorPaths> <annotationProcessorPath> <groupId>org.hibernate</groupId> <artifactId>hibernate-jpamodelgen</artifactId> <version>5.2.6.Final</version> </annotationProcessorPath> </annotationProcessorPaths> </configuration> </plugin> </plugins> </pluginManagement> That way the processor is separated from the actual project dependencies. This option is also picked up by the Eclipse M2E plug-in if … Read more

maven generating pom file

This is an old question, but was a serious PITA for me for a few minutes, so I thought I’d share: I just ran into this problem, and I believe that the issue is probably platform-dependent. The real tip-off was that the solution from Cyril’s answer wasn’t working as expected: despite my specification of -DgroupId=com.xyz … Read more

Upgrading Maven on Mac

To upgrade to the latest version (if you have one already installed but need to update the version) do the following: 1. brew update 2. brew unlink maven 3. brew install maven if you then execute the mvn –version command you should see that your version of maven has been upgraded. EDIT: If you have … Read more

How can I include test classes into Maven jar and execute them?

You should not access test classes from your application code, but rather create a main (the same main) in the test scope and create an additional artifact for your project. However, in this additional artifact (jar) you would need to have: The test classes The application code classes External dependencies required by application code (in … 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>

Getting maven project version and artifact ID from pom while running in Eclipse

Create a property file src/main/resources/project.properties with the below content version=${project.version} artifactId=${project.artifactId} Now turn on maven resource filtering <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> so that this file is processed into target/classes/project.properties with some content similar to this version=1.5 artifactId=my-artifact Now you can read this property file to get what you want and this should work every time. … Read more

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