Issue
I am pretty new for java.I made a project that get class names,field names from desired .java file(HelloOOPP.java).I use maven to include JavaParser on my project.My project is compilable on my computer.I tested my project other computer with NetBeans and got following error:
Error resolving version for plugin 'com.app:app' from the repositories [local (C:\Users\User2\.m2\repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository
My pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<groupId>com.app</groupId>
<artifactId>app</artifactId>
<version>1.0-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<name>app</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>com.app</groupId>
<artifactId>app</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.app.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-symbol-solver-core</artifactId>
<version>3.5.16</version>
</dependency>
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-core</artifactId>
<version>3.5.7</version>
</dependency>
</dependencies>
</project>
My file structure:
my-app
|-- pom.xml
`-- src
|-- main
| `-- java
| `-- com
| -- app
| `-- App.java(contain main method)
-- GetTypes.java(contain source code)
`-- test
`-- java
`-- com
-- app
` -- App.java
-- GetTypes.java
Solution
Is there a reason why you depend on your project in the plugin section. When you depend the same project you are building, since it is not installed before, maven cannot find it anywhere and your project cannot be installed. Remove it from plugin section and your project can be installed.
Answered By - miskender
Answer Checked By - Candace Johnson (JavaFixing Volunteer)