Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error resolving version for plugin 'org.apache.maven.plugins:maven-jar-plugin' from the repositories ,Plugin not found in any plugin repository

Tags:

maven-plugin

I am trying to Maven build my Java project but it is getting failed and i am getting below error:

Error resolving version for plugin 'org.apache.maven.plugins:maven-jar-plugin' from the repositories [local (C:\Users\Vinita.Gupta.m2\repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]

I am trying to build the project in Eclipse Neon and have installed and setup Maven path,m2connector for Eclipse.

Note: I am not connected to network using any proxy Most of the solutions which i have found online were having issues due to proxy settings but i am directly connected to network and able to browse below directory via browser but couldn't connect through Maven: https://repo.maven.apache.org/maven2

Please help !!

like image 838
Vinita Gupta Avatar asked Oct 12 '16 15:10

Vinita Gupta


3 Answers

Add this to your pom.xml and it should work

<pluginRepositories>
   <pluginRepository> 
    <id>maven2</id> 
    <url>https://repo.maven.apache.org/maven2/</url> 
  </pluginRepository> 
</pluginRepositories>
like image 183
chris dany Avatar answered Oct 16 '22 14:10

chris dany


I had a weird solution. I got the same error when i was connected in Office LAN. Once I switched to common wifi, the error was not thrown. So i believe this is more to do with the network restriction.

like image 38
Seetharaman Mohan Avatar answered Oct 16 '22 15:10

Seetharaman Mohan


I had the same error, but for the maven-failsafe-plugin.

With the help of a colleague, we got rid of the problem adding the version line to the plugin declaration in the project pom.xml. We added the <version>2.20.1</version> line resulting in the following plugin declaration.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.20.1</version>
                <configuration>
                    <skipTests>false</skipTests>
                    <argLine>-Djava.library.path=${project.parent.basedir}/lib/${arquitecturaMaquina}</argLine>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

It is a long working project (over a year) and never had this error. I do not know what triggered it, but all the other answers about resetting the local repository, checking the proxy, etc did not work.

Then we added that version line to the pom.xml and the project built correctly again. Now I removed the line and it is still working. My guess is that it indeed had something to do with some messed up cache of some kind, and that requiring the specific version got rid of the mess and now it is working as before the problem appeared.

like image 37
manuelvigarcia Avatar answered Oct 16 '22 16:10

manuelvigarcia