Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365158

Summary: Build path should only consider ZIP type resources
Product: z_Archived Reporter: Christopher Hunt <huntc>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Christopher Hunt CLA 2011-11-30 00:49:54 EST
It is possible that a pom file can declare dependencies on artefacts that are not jar files. For example, with the Javascript extension I've written, I declare js dependencies with a type of js e.g.:

<dependency>
  <groupId>com.jquery</groupId>
  <artifactId>jquery</artifactId>
  <version>1.7b2</version>
  <type>js</type>
</dependency>

m2e configures a project's Properties/Java Build Path/Maven Dependencies and declares the js files in that dependency list. I consequently observe the following line in my Problems tab:

Archive for required library: '/Users/huntc/.m2/repository/com/jquery/jquery/1.7b2/jquery-1.7b2.js' in project 'JS RIA Flight Subscribers' cannot be read or is not a valid ZIP file	JS RIA Flight Subscribers		Build path	Build Path Problem

My recommendation is to avoid adding non ZIP type resources to the build path rather than indicate that they are an error (and no, it shouldn't be a warning either).

Thanks.
Comment 1 Igor Fedorenko CLA 2011-11-30 12:59:43 EST
m2e uses org.apache.maven.artifact.handler.ArtifactHandler.isAddedToClasspath to determine if the dependency should be added to classpath or not. Check if ArtifactHandler corresponding to type=js has isAddedToClasspath=false.
Comment 2 Denis Roy CLA 2021-04-19 13:23:24 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/