1
votes

My project using Java and Maven. My .m2 is in directory C:\Users\my_user_name. I use this .m2 directory as unique repository of my project .Everything worked Ok before. I have also built my project success on yesterday. Today, my window 7 update and when i build my project, I get the error

Failed to collect dependencies for [org.jboss.solder:solder-impl:jar:3.1.0.Final (compile), or g.jboss.solder:solder-api:jar:3.1.0.Final (compile), org.jboss.solder:solder-logging:jar:3.1.0.Final (compile), log4j:lo g4j:jar:1.2.6 (provided), javax.enterprise:cdi-api:jar:1.0-SP4 (provided)]: Failed to read artifact descriptor for org.jboss.solder:solder-impl:jar:3.1.0.Final: Failure to find org.jboss.seam:seam-bom:pom:3.1.0.Final in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

I have debug the problem with command mvn -X and I get the result

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 20:51:28+0700) Maven home: D:\soft\maven\apache-maven-3.0.5 Java version: 1.7.0_45, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_45\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from D:\soft\maven\apache-maven-3.0.5\conf\settings.xml [DEBUG] Reading user settings from C:\Windows\system32\config\systemprofile\.m2\settings.xml [DEBUG] Using local repository at C:\Windows\system32\config\systemprofile\.m2\repository [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Windows\system32\config\systemprofile\.m2\r epository

As you see, the maven use a repository C:\Windows\system32\config\systemprofile . I have checked and see an another .m2 directoty in there, and this .m2 directory have not enough .jar file.

I also put <repositories> config tag with content

<repositories>
        <repository>
          <id>repo.maven.apache.org</id>          
          <url>http://repo.maven.apache.org/maven2</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>repository.jboss.org</id>          
          <url>https://repository.jboss.org/nexus/content/groups/public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>maven.nuxeo.org</id>          
          <url>https://maven.nuxeo.org/nexus/content/repositories/public</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>   
      </repositories>

in file settings.xml in C:\Users\my_user_name\.m2\repository.So my question is :How to change local repository to .m2 in C:\Users\my_user_name ? (because this .m2 is right repository and i have put all my .jar to this repository ).

1

1 Answers

0
votes

Pay close attention to the error message you are getting:

Failure to find org.jboss.seam:seam-bom:pom:3.1.0.Final in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

So Maven is telling you that it won't attempt to fix the dependency problem until you tell it to force updates. Here is how you do that:

mvn clean install -U

or

mvn clean install --update-snapshots

The -U flag does the following (from typing mvn -help):

Forces a check for missing releases and updated snapshots on remote repositories