1

I got the "Archive for required library cannot be read or is not a valid ZIP file" error for my maven project I imported in Eclipse. I read some posts about this and suggested is to delete the faulty directory like in my case:
~.m2\repository\com\cogentex\rpw\2.2 and
~.m2\repository\com\cogentex\rpw-lkb\2.2
Then you should update the project via Eclipse: Maven>Update project and click force update of snapshots/releases. I followed these steps and the directory looks like this now:
screenshot

So the correct .jar files are still missing and it also results in more erorrs now:
1: Missing artifact com.cogentex:rpw-lkb:jar:2.2
2: Missing artifact com.cogentex:rpw:jar:2.2
3: The container 'Maven Dependencies' references non existing library '~.m2\repository\com\cogentex\rpw\2.2\rpw-2.2.jar'

Here is the snippet from the pom.xml which throws the first two errors:

    <dependency>
        <groupId>com.cogentex</groupId>
        <artifactId>rpw</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
        <groupId>com.cogentex</groupId>
        <artifactId>rpw-lkb</artifactId>
        <version>2.2</version>
    </dependency>

What do I have to do to make maven download the correct .jar files? I already tried running maven cleanor maven install and restarting Eclipse.

Colle
  • 154
  • 1
  • 11
  • See https://stackoverflow.com/a/13149707/6505250 – howlger Aug 21 '19 at 11:48
  • I tried the answers there. I ran "mvn install -U", "mvn compile" in the directory of the project but I get the error "[...] Could not resolve dependencies for project edu.upc:bpmn2text_anselmo:jar:0.1.0: The following artifacts could not be resolved: com.cogentex:rpw:jar:2.2, com.cogentex:rpw-lkb:jar:2.2, edu.upc:nlp4bpm_commons:jar:0.1.0, edu.upc:jfreeling:jar:4.1.0: Failure to find com.cogentex:rpw:jar:2.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced" – Colle Aug 21 '19 at 12:12

1 Answers1

1

What you see in the folder is some files that indicate the artifact was not found and when was the last time Maven checked.

Whatever com.cogentex:rpw is, it's not in Maven Central so Maven will not find it there. You need to tell Maven where to get it from by providing the URL to a repository that contains it. If/when your POM has the repository, make sure

  • you do have access to the reposiory from the environment you run your build in (check proxies, firewalls, ...)
  • the GAV coordinates (groupId, artifactId, version) are correct and match the one in the repository.
  • the artifact type in the repository is jar. If it is not, provide the correct type in the dependency
  • the artifact is not deployed to the repository with classifier. If it is, provide the classifier in the dependency
Milen Dyankov
  • 2,972
  • 14
  • 25