Alain
Alain

Reputation: 722

Maven Archive cannot be read or is not a valid Zip file?

When running the Maven Install in Eclipse for my XXXXClient (web service) project, I repeatedly got this message: " Archive for required library: 'X:/XXXX/XXXX/.m2/repository/javax/enterprise/cdi-api/1.0-SP4-redhat-4/cdi-api-1.0-SP4-redhat-4.jar' in project 'XXXXClient' cannot be read or is not a valid ZIP file XXXXClient Build path Build Path Problem " for the following jars (dependencies in my project):

Most of these jars can be found on the Maven Redhat repository: https://maven.repository.redhat.com/nexus/content/groups/product-techpreview/

In my Maven settings.xml, I have redhat-techpreview-all-repository and redhat-techpreview-eap-repository has active profiles. Both profiles are configured:
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>

I noticed:

The only way I found to resolve my problem was to manually download each jar and replace them one by one.

Why did I have corrupted jar files in the first place and Was there a better way to resolve this?

Thanks in advance,

Upvotes: 2

Views: 6630

Answers (1)

hugh
hugh

Reputation: 2280

I believe the "-U" flag will force a download of missing JARs, but it's possible for a corrupted version to be added to the repository (such as network glitches during download), which the -U flag will not fix. When I've had this problem before I've been able to fix it by deleting the local .m2 repository and allowing Maven to redownload them.

Upvotes: 3

Related Questions