Introduction
This is another article focusing on how to solve an error message which appear in the execution of a Java Application. The process exist internally using maven tool which is integrated in the NetBeans IDE. Just by selecting the Java Project represents the Java Application in the NetBeans IDE and then right click at it will give a menu with the label of ‘Run’. By selecting the ‘Run’ menu, it will start the maven tool by building, compiling and finally deploying it to a specific Application Server which in this context it is a Wildfly Application Server. The output for the error message appearing exist in the Output tab as part of the NetBeans IDE below :
Scanning for projects... ------------------------------------------------------------------------ Building apps 0.1-SNAPSHOT ------------------------------------------------------------------------ Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/3.0/maven-war-plugin-3.0.pom The POM for org.apache.maven.plugins:maven-war-plugin:jar:3.0 is missing, no dependency information available ------------------------------------------------------------------------ BUILD FAILURE ------------------------------------------------------------------------ Total time: 12.605s Finished at: Thu Feb 17 21:07:45 ICT 2022 Final Memory: 9M/123M ------------------------------------------------------------------------ Plugin org.apache.maven.plugins:maven-war-plugin:3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-war-plugin:jar:3.0: Could not find artifact org.apache.maven.plugins:maven-war-plugin:pom:3.0 in central-secure (https://repo.maven.apache.org/maven2) -> [Help 1] To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.
This article is actually part of another article for solving another type of error message. The following is part of the content ‘pom.xml’ which is causing the error message :
<plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.0</version> </plugin> </plugins>
Solution
The solution is actually quite specific simple. The reason for the above error appear is because there is no plugin of maven-war-plugin with the version 0f ‘3.0’. In order to do that and check it further to see what version is available of the maven-war-plugin, just visit the maven repository page. Currently, it exist in this link. Searching it in that page, there are lots of version available as in tthis link. The nearest possible version which is available is ‘3.0.0’ not ‘3.0’. So, in order to solve the problem, just change the version of the ‘maven-war-plugin’ in the definition inside the ‘pom.xml’. So, the change will be as follows :
<plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.0.0</version> </plugin> </plugins>
If there are no additional error appears, the process for building and deploying the Java Application will be just properly success.
One thought on “How to Solve Error Message Could not find artifact org.apache.maven.plugins:maven-war-plugin:pom:3.0 in central-secure (https://repo.maven.apache.org/maven2) when building and deploying Java Application to Wildfly using maven in NetBeans”