views:

123

answers:

1

Since this morning Maven can not build any project that requires tomcat-maven-plugin. I tried with the minimalistic pom.xml, with just that one dependency, but in all cases I get the following:

[INFO] Error building POM (may not be this project's POM).

Project ID: org.codehaus.mojo:tomcat-maven-plugin

Reason: Error getting POM for 'org.codehaus.mojo:tomcat-maven-plugin' from the repository: Unable to read local copy of metadata: Cannot read metadata from 'C:\Users\*\.m2\repository\org\codehaus\mojo\tomcat-maven-plugin\maven-metadata-codehaus releases.xml': end tag name must match start tag name


from line 7 (position: TEXT seen ...\n... @9:8)
org.codehaus.mojo:tomcat-maven-plugin:pom:LATEST

for project org.codehaus.mojo:tomcat-maven-plugin

First, I tried deleting the local data and redownloading, but I just got checksum failures. I opened maven-metadata-codehaus releases.xml just to see this inside:

301 Moved Permanently

Moved Permanently

The document has moved https://nexus.codehaus.org/content/repositories/releases/org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml here.


Apache/2.0.52 (Red Hat) Server at repository.codehaus.org Port 80

I tired changing versions and repositories, but nothing helped. Any ideas anyone?

P.S. Here's the minimal pom I tried with:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
<modelVersion>4.0.0</modelVersion>

<groupId>org.codehaus.mojo</groupId>
<artifactId>my-project</artifactId>
<version>1.0</version>

<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/&lt;/url&gt;
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>

<build>
<finalName>my-webapp</finalName>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</plugin>

</plugins>

</build>
</project>
+2  A: 

It looks like the redirection is incorrect, Codehaus Snapshots are proxied by: https://nexus.codehaus.org/content/repositories/codehaus-snapshots/.

So declare the following pluginRepository to use SNAPSHOT versions of the tomcat-maven-plugin:

<pluginRepositories>
  <pluginRepository>
    <id>Codehaus Snapshots</id>
    <url>https://nexus.codehaus.org/content/repositories/codehaus-snapshots&lt;/url&gt;
  </pluginRepository>
</pluginRepositories>
Pascal Thivent
Great tip. It solved my build problems. Thank you!I just fail to understand how they could screw it up so bad that you get junk in your local repo and leave it unfixed for days?!
veggen
@veggen I saw [MOJO-1556](http://jira.codehaus.org/browse/MOJO-1556) which mentions the problem and it looks like they reverted the change for now.
Pascal Thivent