Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]

Error when package or clean after loading maven.
[WARN]
[WARN] Some problems were encountered while building the effective model
[WARN] ‘build.plugins.plugin.version’ is missing fororg.apache.maven.plugins:maven.compiler.plugin
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.

org.apache.maven.plugins:maven.compiler.

The plugin is a plugin that can be added by “Add Denpendency”.

Add a new dependency in pom.xml:

<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<type>maven-plugin</type>
</dependency>
Add to the build.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven.compiler.plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbal>true</verbal>
</configuration>
</plugin>
</plugins>
</build>
</project>

But there is still an error, error message: build.plugins.plugin.version
As you can see, there is no <version> under <build> in pom.xml. So we need to add an extra version.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven.compiler.plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<verbal>true</verbal>
</configuration>
</plugin>
</plugins>
</build>
</project>

Done!

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.1.2</version>
</dependency>

 

Similar Posts: