Question

I have an issue when I launch the " mvn install " commande, my level with Maven is "curious begginer"

I'm on :

  • OS : windows XP,
  • Maven : 2.0.7,
  • java : 1.6.0_29

and I launch maven with a cmd consol

in my pom.xml, I have :

<dependency>
 <groupId>commons-io</groupId>
 <artifactId>commons-io</artifactId>
 <version>1.4</version>
 </dependency>

but when I launch " mvn install " on this pom.xml

   [INFO] Error building POM (may not be this project's POM).
    Project ID: commons-io:commons-io:jar:2.2

    Reason: Cannot find parent: org.apache.commons:commons-parent for project: commo
    ns-io:commons-io:jar:2.2 for project commons-io:commons-io:jar:2.2

I used maven to see the dependency tree, and I see nowhere an "commons-io" version 2.2...

In my local repo I have a commons-io 1.4 and it worked very well until now, I re-download all my local repo several times but I didn't see any change.

I tried to change the remote repo too but still, no changes.

So my problem is this error, which forbid me to generate my jar and I don't understand where this 2.2 come from ...

By advance thank you :)

EDIT

finally I download jars then I used the command :

mvn install:install-file -DgroupId=<your_group_name>  \
-DartifactId=<your_artifact_name>  \
-Dversion=<snapshot>  \
-Dfile=<path_to_your_jar_file>  \
-Dpackaging=jar \
-DgeneratePom=true

in order to install manually all the missing dependency.

thanks for your help :) and if anyone have a explanation about this isssue, please post it !

Was it helpful?

Solution

Try cleaning the whole repository cache. Delete the folder

userhome/.m2/repository

Maven will recreate it.

Just running 'mvn clean' alone will not delete the repository, it just cleans the target folder

(On Windows the repo will be at C:\Users\yourusername\.m2\repository)

OTHER TIPS

You can try cleanning the repo:

mvn clean

If that don't works, try changing the location of repo:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository> c:\maven\newRepository </localRepository>
 ....
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top