102

I am seeing an error in my STS and am not sure how to debug it. Searching around I only see vague references to the error and no solutions.

The error is:

org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) pom.xml /<maven projectName> line 1 Maven Configuration Problem

Question: Can anyone give any suggestions on how to get more information on the issue in order to debug it further or any possible solutions?

Maybe some more context on what the functionality of method is. The javadoc associated with the MavenArchiver.getManifest() method is not very detailed and there is no stack trace that I see. I've tried several refreshes and updates of the project and associated projects including clearing my local m2 repo.

STS info:

  • Version: 3.7.3.RELEASE
  • Build Id: 201602250940
  • Platform: Eclipse Mars.2 (4.5.2)

m2e info:

  • Version: 1.6.2.20150902-0002
A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
scottmf
  • 1,506
  • 2
  • 14
  • 16
  • It would probably be necessary to see the pom.xml to diagnose the problem. The code is complaining about the layout of the pom.xml file, and this is not an error within the Maven software. You therefore wouldn't expect to see an error log file. The most common reason that I have experienced is a typographical error in the contents of the tags or a mismatch between the starting and ending tag. – Bradley Ross May 31 '16 at 21:14
  • 1
    The code compiles just fine when run from the command line. I'd think it would error out if there was a typo or tag mismatch, right? – scottmf May 31 '16 at 21:22
  • Even though the first answer on this SO question worked for me, I'd like to know why all I see is that error and it has no context. It doesn't say what is happening. it just says a method name "MavenARchiver.getManifest" - no error text, nothing... not even where any exception is thrown. Where do we find the full error for anything going wrong in eclipse? Such red-X's are useless to us. Whose dumb idea was it to just print a method name as an error message and that's it? – Calicoder Feb 04 '19 at 19:38

11 Answers11

199

I encountered the same issue after updating the maven-jar-plugin to its latest version (at the time of writing), 3.0.2.
Eclipse 4.5.2 started flagging the pom.xml file with the org.apache.maven.archiver.MavenArchiver.getManifest error and a Maven > Update Project.. would not fix it.

Easy solution: downgrade to 2.6 version
Indeed a possible solution is to get back to version 2.6, a further update of the project would then remove any error. However, that's not the ideal scenario and a better solution is possible: update the m2e extensions (Eclipse Maven integration).

Better solution: update Eclipse m2e extensions
From Help > Install New Software.., add a new repository (via the Add.. option), pointing to the following URL:

  • https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/

Then follow the update wizard as usual. Eclipse would then require a restart. Afterwards, a further Update Project.. on the concerned Maven project would remove any error and your Maven build could then enjoy the benefit of the latest maven-jar-plugin version.


Additonal notes
The reason for this issue is that from version 3.0.0 on, the concerned component, the maven-archiver and the related plexus-archiver has been upgraded to newer versions, breaking internal usages (via reflections) of the m2e integration in Eclipse. The only solution is then to properly update Eclipse, as described above.
Also note: while Eclipse would initially report errors, the Maven build (e.g. from command line) would keep on working perfectly, this issue is only related to the Eclipse-Maven integration, that is, to the IDE.

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
  • 3
    I was able to work around a similar issue by downgrading `maven-war-plugin` from `3.0.0` to `2.6`. – Ben Hutchison Sep 30 '16 at 05:45
  • 1
    I wasn't able to access the otto.takari.io site, but I was able to get the extension from `http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/` – azurefrog Nov 18 '16 at 17:09
  • 3
    For Eclipse Mars work properly: http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/. Put it into Install -> Work with field, 'Enter'. Check m2e Extensions in list (only one choice). – hariprasad May 05 '17 at 12:45
  • 1
    Works also with "Mars.2". – Pino Apr 04 '19 at 14:46
16

I found my answer! I looked into the pom for any plugins that have a dependency on the maven-archiver and found the maven-jar-plugin does. It was using the latest 3.0.0 version. When I downgraded to 2.6 it seems to fix the issue :-)

scottmf
  • 1,506
  • 2
  • 14
  • 16
14

I had the same problem with a spring boot project. the solution was to downgrade the jar maven-jar-plugin from 3.2 to 2.6 . i had just to add this to the project pom:

<properties>        
    <maven-jar-plugin.version>2.6</maven-jar-plugin.version>
</properties>
Ala Messaoudi
  • 366
  • 4
  • 12
11

I had exactly the same problem. My environment was:

  • Spring STS 3.7.3.RELEASE
  • Build Id: 201602250940
  • Platform: Eclipse Mars.2 (4.5.2)

The symptoms of the problems were:

  1. There was a red error flag on my PM file. and the description of the error was as described in the original question asked here.
  2. There were known compilation problems in the several Java files in the project, but eclipse still was not showing them flagged as error in the editor pane as well as the project explorer tree on the left side.

The solution (described above) about updating the m2e extensions worked for me.

Better solution (my recommondation):

slartidan
  • 20,403
  • 15
  • 83
  • 131
Ravi Rajamiyer
  • 121
  • 1
  • 4
7

I had the same problem with a spring boot project. The solution was to downgrade the spring-boot-starter-parent dependency version from 2.0.0.RELEASE to 1.5.10.RELEASE(you can move to any stable version)

from:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

to

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.10.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
Saurav
  • 392
  • 4
  • 4
7

I had also faced the same issue and it got resolved by changing the version from 3.2.0 to 2.6 as shown in below pom.xml snippet

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <warSourceDirectory>src/main/webapp</warSourceDirectory>
        <warName>Spring4MVC</warName>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>
Vaibhav Sharma
  • 1,573
  • 2
  • 19
  • 35
4

Upgrade your m2e extensions instead downgrade.

From Help > Install New Software.., add a new repository (via the Add.. option)

Specify name for your plugin and add path http://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-mavenarchiver/0.17.2/N/LATEST/

once you are done with installation, please restart eclipse and update your project.

VENKAT S
  • 59
  • 2
0

I also faced the similar issues, changing the version from 2.0.0.RELEASE to 1.5.10.RELEASE worked for me, please try it before downgrading the maven version

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<dependencies>
 <dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-web</artifactId>
 </dependency>  
</dependencies>
wandermonk
  • 6,856
  • 6
  • 43
  • 93
0

I solved this error in pom.xml by adding the below code

spring-rest-demo org.apache.maven.plugins maven-war-plugin 2.6
Yoshita Mahajan
  • 443
  • 4
  • 6
0

I had also faced the same issue and it got resolved by commenting the version element in POM.xml as show.

org.apache.maven.archiver.[MavenArchiver](https://maven.apache.org/shared/maven-archiver/apidocs/org/apache/maven/archiver/MavenArchiver.html).getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)

<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <!-- <version>3.5.1</version> -->
    <configuration>
      <source>1.7</source>
      <target>1.7</target>
    </configuration>
  </plugin>
  <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <!-- <version>3.1.0</version> -->
    <configuration>
      <warSourceDirectory>WebContent</warSourceDirectory>
      <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
  </plugin>
</plugins>
Yash
  • 9,250
  • 2
  • 69
  • 74
-1

Use the steps given in this link. It worked for me.

Step - 1 Right click on your project in Eclipse

Step - 2 Click Properties

Step - 3 Select Maven in the left hand side list.

Step - 4 You will notice "pom.xml" in the Active Maven Profiles text box on the right hand side. Clear it and click Apply.

Step - 5 Run As -> Maven clean -> Maven Install

Hope it helps!

Mahan
  • 371
  • 1
  • 4
  • 11