Share

November 9, 2009

Sun Moved Maven Repository breaking everyone jusing maven-jaxb-plugin

 Starting today, and I guess over the last few days Sun changed the plugin repositories so if you tried to use your maven install command you would get the following error
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-resources-plugin
POM Location: C:\Documents and Settings\User\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom

Reason: Not a v4.0.0 POM. for project org.apache.maven.plugins:maven-resources-plugin at C:\Documents and Settings\User\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.3\maven-resources-plugin-2.3.pom


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------

This is due to you having the following in your pom.xml
    <pluginRepositories>
        <pluginRepository>
            <id>java.net-plugin-2</id>
            <name>java.net Maven Repository</name>
            <url>https://maven-repository.dev.java.net/nonav/repository</url>
            <layout>legacy</layout>
        </pluginRepository>
    </pluginRepositories>
Change it with the following
    <pluginRepositories>
        <pluginRepository>
            <id>java.net-plugin-1</id>
            <name>java.net Maven Repository</name>
            <url>http://download.java.net/maven/1</url>
            <layout>legacy</layout>            
        </pluginRepository> 
        <pluginRepository>
            <id>java.net-plugin-2</id>
            <name>java.net Maven Repository</name>
            <url>http://download.java.net/maven/2</url>
        </pluginRepository>
    </pluginRepositories>