Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven not using the local repo

I'm using maven without m2e, my mvn install is failing because a plugin is not available anymore on maven central. I'm working with an old pom.xml dating from 2008 and must uses maven-cdk-plugin version 3.3.3.Final.

Since it was not available anymore I took it on someone else computer and putted it in my .m2 local repo. .m2\org\richfaces\cdk\maven-cdk-plugin\3.3.3.Final

however I'm still getting this error.

[ERROR] Plugin org.richfaces.cdk:maven-cdk-plugin:3.3.3.Final or one of its depe
ndencies could not be resolved: Failed to read artifact descriptor for org.richf
aces.cdk:maven-cdk-plugin:jar:3.3.3.Final: Failure to find org.richfaces.cdk:mav
en-cdk-plugin:pom:3.3.3.Final in http://uk.maven.org/maven2 was cached in the lo
cal repository, resolution will not be reattempted until the update interval of
UK has elapsed or updates are forced -> [Help 1]

Why would he want to check maven2, it's inside my local repo? D:

thanks

like image 989
Heetola Avatar asked May 25 '12 14:05

Heetola


2 Answers

You must install that jar with install plugin`.

mvn install:install-file -Dfile=[jar] -DgroupId=org.richfaces.cdk \
-DartifactId=maven-cdk-plugin -Dversion=3.3.3.Final -Dpackaging=jar

Maven will keep the structure and generate the things it needs.

Try mvn clean install -o to not look in internet for dependencies.

Also echo $M2_REPO. it should point to the .m2.

like image 87
ssedano Avatar answered Nov 20 '22 00:11

ssedano


The first thing is that what you mentioned the maven-cdk-plugin has never been on Maven Central cause it's available via richfaces repository so you have to configure to use the richfaces repository as well. This results in using a repository manager like Archiva, Artifactory or Nexus (alphabetical order). So you need to configure to use the richfaces repository.

See here: https://community.jboss.org/wiki/MavenRepository how to do so.

Here you can see that the plugin exists in this repository https://repository.jboss.org/nexus/

One very important thing. Any artifact which is in Maven Central will never be deleted afterwards cause otherwise this would break builds all over the world.

like image 32
khmarbaise Avatar answered Nov 20 '22 01:11

khmarbaise