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

Import Maven dependencies in IntelliJ IDEA

IntelliJ should download and add all your dependencies to the project’s classpath automatically as long as your POM is compliant and all the dependencies are available. When importing Maven projects into IntelliJ an information box usually comes up asking you if you want to configure Auto-Import for Maven projects. That means that if you make … Read more

Specifying Java version in maven – differences between properties and compiler plugin

How to specify the JDK version? Use any of three ways: (1) Spring Boot feature, or use Maven compiler plugin with either (2) source & target or (3) with release. Spring Boot <java.version> is not referenced in the Maven documentation. It is a Spring Boot specificity. It allows to set the source and the target … Read more

Make Maven to copy dependencies into target/lib

This works for me: <project> … <profiles> <profile> <id>qa</id> <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project>

Maven 3 warnings about build.plugins.plugin.version

Add a <version> element after the <plugin> <artifactId> in your pom.xml file. Find the following text: <plugin> <artifactId>maven-compiler-plugin</artifactId> Add the version tag to it: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> The warning should be resolved. Regarding this: ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-compiler-plugin is missing Many people have mentioned why the issue is happening, but fail to suggest a fix. All … Read more

How to configure encoding in Maven?

OK, I have found the problem. I use some reporting plugins. In the documentation of the failsafe-maven-plugin I found, that the <encoding> configuration – of course – uses ${project.reporting.outputEncoding} by default. So I added the property as a child element of the project element and everything is fine now: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> See also … Read more