0

I changed a simple maven project to a maven dynamic web project adding this line to my pom.xml:

...
<packaging>war</packaging>
....

I updated my project using maven -> update project The m2e plugin now rewrote the project meta-files (.project and .classpath, as well as files in the .settings folder).

After it was done i got an error in my build path:

Archive for required library: 
'~/m2/repository/com/orientechnologies/orient-commons/1.6.5/orient-
commons-1.6.5.pom' in project 'RelationExtraction' 
cannot be read or is not a valid ZIP

The maven dependency:

<dependency>
    <groupId>com.orientechnologies</groupId>
    <artifactId>orientdb-graphdb</artifactId>
    <version>1.6.5</version>
</dependency>

Also i cant run my main anymore:

Error: main class myPackage.main.Main could not be found or loaded

I tried the following:

  1. I deleted all folders in my ~/m2/ folder and updated my project again
  2. I restarted eclipse
  3. I closed and reopened my project
  4. I restarted my computer

Inside the folder ~/m2/repository/com/orientechnologies/orient-commons/1.6.5/ are the following files:

  • _maven.repositories
  • orient-commons-1.6.5.jar
  • orient-commons-1.6.5.jar.sha1
  • orient-commons-1.6.5.pom
  • orient-commons-1.6.5.pom.sha1

I can see in my Maven Dependencies in my project that maven is trying to load the pom and not the jar:

enter image description here

When i delete

...
<packaging>war</packaging>
....

Maven loads the correct jar and not the pom.

enter image description here

Mulgard
  • 9,877
  • 34
  • 129
  • 232
  • 1
    possible duplicate of [eclipse maven error: Archive for required library in project cannot be read or is not a valid ZIP file](http://stackoverflow.com/questions/20091177/eclipse-maven-error-archive-for-required-library-in-project-cannot-be-read-or-i) –  Apr 13 '14 at 09:20
  • No because the provided solutions didnt help me. – Mulgard Apr 13 '14 at 09:26
  • Try again to update your project (Maven -> Update project), but this time checking the box "force updates of snapshots/releases". This is the same as using the -U flag on the command line. Maybe this helps. – Seelenvirtuose Apr 13 '14 at 09:38
  • Yes i know that and i always do it like that. it does not work. i just dont get why maven wants to load the pom file of orient-commons-1.6.5 and not the jar file. – Mulgard Apr 13 '14 at 09:43
  • Show the dependency for that artifact. – Seelenvirtuose Apr 13 '14 at 09:44
  • updated: i added the maven dependency and a picture which shows the including of orient-commons-1.6.5.pom to my post. – Mulgard Apr 13 '14 at 09:47
  • How about trying to delete the project inside eclipse. Remove all eclipse files (.settings/.project/.classpath) and retry an import->existing maven project..? It is a rough eclipse reset, but it sometimes work – Niels Bech Nielsen Apr 14 '14 at 13:35

0 Answers0