Ok I'm moving my development environment from my laptop to my desktop.
I've got the exact same projects on both machines but when I try to run maven's update dependencies through eclipse on the desktop is just complains about "missing artefact" for every single dependency!?
I've checked the local repo on the desktop and sure enough, there are NO jars!? All the pom's are there but no jars!
I went back to the laptop, deleted from jars from the local repo on that machine and called the update dependencies again and bang, the jars download just fine, but the desktop can't seem to download any of the jars?
Both machines are on the same network/router so it can't be hardware firewall/proxy but is there some eclipse setting or windows firewall setting I'm totally forgetting about??
Lastly, I've been deleteing the repo on the desktop and using mvn -up clean install on the project, I notice that it downloads the PLUGIN jars just fine, but then continues to only download poms for any and all dependencies!?
My settings.xml is as follows (kind of a mashup of suggested repos);
<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.0http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups></pluginGroups>
<proxies></proxies>
<servers></servers>
<mirrors></mirrors>
<profiles>
<profile>
<id>standard-extra-repos</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>net.java.download</id>
<url>http://download.java.net/maven/2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>org.apache</id>
<url>http://maven.apache.org/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>org.codehaus.mojo</id>
<url>http://mojo.codehaus.org/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots&g开发者_JAVA百科t;
</repository>
<repository>
<id>com.jboss.repository</id>
<url>http://repository.jboss.com/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>com.springsource.repository.bundles.release
</id>
<name>SpringSource Enterprise Bundle Repository -
SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release
</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
<repository>
<id>com.springsource.repository.bundles.external
</id>
<name>SpringSource Enterprise Bundle Repository -
External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external
</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
<repository>
<id>com.springsource.repository.libraries.release
</id>
<name>SpringSource Enterprise Bundle Repository -
SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release
</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
<repository>
<id>com.springsource.repository.libraries.external
</id>
<name>SpringSource Enterprise Bundle Repository -
External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external
</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
</repositories>
</profile>
Hmm not sure if this is a no brainer but I WAS using maven 3.0.1 on the desktop, I downloaded 2.2.1 again to match the laptop and BANG, dependency jars download just fine now! So much for "backwards compatible" maven 3!!!!
Have a look at the content of the downloaded POMs. Sometimes Maven try download them, even create them on the file system, but if you look at the content you'll find some server error code, maybe that can help..
If it's not the proxy issue, then it might due to your network problem, which means your network can't connect to the repository center specified in your setting.xml.
Try to change the repository center:
In maven_home/conf/setting.xml, find mirrors tag, and replace your old/empty mirror with new mirror, then restart you eclipse.
Following is the mirror that works fine for me:
<mirror>
<id>ibiblio.org</id>
<name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- United States, North Carolina -->
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
Had the same problem. Adding a duplicate server within the mirrors section solved it for me.
If you want your project to be portable across any machine, you cannot rely on the local settings.xml. What I've commonly seen is actually building a local repo in a /target directory somewhere, and using it to run goals in a maven environment you generate at build time. Convention seems to be src/main/it/settings.xml and src/main/it/local-repo.
I'm sure there's a maven plugin somewhere that will do it for you.
精彩评论