Reputation: 154
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:
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 clean
or maven install
and restarting Eclipse.
Upvotes: 1
Views: 956
Reputation: 3052
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
jar
. If it is not, provide the correct type in the dependencyUpvotes: 1