Maven appears to ignore http 301; downloads html as jar -------------------------------------------------------
Key: MNG-4486 URL: http://jira.codehaus.org/browse/MNG-4486 Project: Maven 2 Issue Type: Bug Components: Artifacts and Repositories Affects Versions: 2.2.1 Environment: WinXP and Solaris10 Reporter: David Biesack Our Maven builds are configured with just two repositories, http://repo1.maven.org/maven2 and http://scala-tools.org/repo-releases (We use Artifactory as a central repo cache) But since Friday, I've noticed builds failing because builds are trying to download jms-1.1.jar from maven-repository.dev.java.net even though that is not in our repo path or configuration. when I run with -X I see a failure trying to download jmx-1.1.jar from central, followed by: Downloading: https://maven-repository.dev.java.net/nonav/repository/javax.jms/jars/jms-1.1.jar 347b downloaded [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'd0b7ce08d257e8fefdc6ad0f0f0368635bbeb3d0'; remote = '<!DOCTYPE' - RETRYING Worse, what gets downloaded is not a jar but some html. Maven seems to ignore the 301 status and thinks this is a jar. The contents are: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href=" http://download.java.net/maven/1/javax.jms/jars/jms-1.1.jar">here</a>.</p> <hr> <address>Apache Server at maven-repository.dev.java.net Port 443</address> </body></html> http://repo2.maven.org/maven2/javax/jms/jms/1.1/ contains a pom.xml but no jar. However, http://repository.jboss.com/maven2/javax/jms/jms/1.1/ has the jar. my project does not even depend on jms directly; it appears to be one of the internal Maven compile or site targets that cause it to get loaded, but I'm not sure which. In artifactory's config, we specify: <remoteRepositories> <remoteRepository> <key>repo1</key> <handleReleases>true</handleReleases> <handleSnapshots>false</handleSnapshots> <excludesPattern>org/artifactory/**,org/jfrog/**</excludesPattern> <url>http://repo1.maven.org/maven2</url> <proxyRef>SASproxy</proxyRef> </remoteRepository> <remoteRepository> <key>scala-tools.org</key> <handleReleases>true</handleReleases> <handleSnapshots>false</handleSnapshots> <url>http://scala-tools.org/repo-releases</url> <proxyRef>SASproxy</proxyRef> </remoteRepository> </remoteRepositories> My ~/.m2/settings.xml is empty and /usr/local/maven/conf/settings.xml simply points to my Artifactory server, no other repos in the profile: <profiles> <profile> <id>artifactory</id> <activation><activeByDefault>true</activeByDefault></activation> <repositories> <repository> <id>central</id> <url>http://aclmvn.unx.sas.com:8192/artifactory/repo</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>snapshots</id> <url>http://aclmvn.unx.sas.com:8192/artifactory/repo</url> <releases> <enabled>false</enabled> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://aclmvn.unx.sas.com:8192/artifactory/repo</url> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>snapshots</id> <url>http://aclmvn.unx.sas.com:8192/artifactory/repo</url> <releases> <enabled>false</enabled> </releases> </pluginRepository> </pluginRepositories> </profile> </profiles> I was able to workaround this by downloading jms-1.1.jar and putting it in our Artifactory repo, but I think that is simply masking a problem, so this will probably pop back up. Perhaps the problem is at central; I don't know if it every had a jms-1.1.jar; as I said, we did not depend on it directly, so we suspect some other plugin now uses it that did not, or the jar was incorrectly removed from central. But the fact that Maven downloaded the html as a jar caused problems, because after each build failure, I had to manually clean up my bad ~/.m2/repository -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira