jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Integration for Eclipse
  • MNGECLIPSE-425

Rar dependencies cause failure to build project

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.0.12, 0.9.0
  • Fix Version/s: 0.9.3
  • Component/s: None
  • Labels:
    None

Description

As in MNGECLIPSE-4, rar dependencies cause 'Illegal type of archive for required library' error and failure to build project.

Opening a new issue as the previous issue was closed against an old version.

Attaching project to reproduce problem - check README.txt for instructions.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    RarDependency.zip
    24/Oct/07 5:08 AM
    2 kB
    Mauro Talevi
    1. File
      RarDependency/.classpath 0.3 kB
    2. File
      RarDependency/.project 0.6 kB
    3. XML File
      RarDependency/pom.xml 1 kB
    4. XML File
      RarDependency/rar/pom.xml 0.7 kB
    5. Text File
      RarDependency/README.txt 0.2 kB
    Download Zip
    Show
    Zip Archive
    RarDependency.zip
    24/Oct/07 5:08 AM
    2 kB
    Mauro Talevi

Issue Links

depends upon

Bug - A problem which impairs or prevents the functions of the product. MNG-3497 rar, par and ejb3 archives should not be added to classpath

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. MNG-3147 No component for RAR packaging projects in components.xml

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

New Feature - A new feature of the product, which has yet to be developed. MRAR-23 CLONE -No MAR packaging (Causes Maven-cobertura-plugin to fail)

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

New Feature - A new feature of the product, which has yet to be developed. MRAR-17 No RAR packaging (Causes Maven-cobertura-plugin to fail)

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Herve Boutemy added a comment - 17/Mar/08 4:20 PM

I was able to reproduce the problem with m2eclipse 0.9.0

I tracked down the issue and found 2 possible solutions. But since I don't use rar files, I need help to choose the best one.

1. change plexus component configuration for rar files to disable their addition to classpath
see http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml

<component>
  <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
  <role-hint>rar</role-hint>
  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
  <configuration>
    <type>rar</type>
    <language>java</language>
    <addedToClasspath>true</addedToClasspath> <--- change to false
  </configuration>
</component>

2. or add a test to m2eclipse code to avoid addition to dependencies when the file's extension is not .zip nor .jar

The first solution is the most clean, since it would be only a configuration improvement.
But I'm not able to decide if the changed configuration is right: should a .rar file be included in classpath or not?

Show
Herve Boutemy added a comment - 17/Mar/08 4:20 PM I was able to reproduce the problem with m2eclipse 0.9.0 I tracked down the issue and found 2 possible solutions. But since I don't use rar files, I need help to choose the best one. 1. change plexus component configuration for rar files to disable their addition to classpath see http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml
<component>
  <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
  <role-hint>rar</role-hint>
  <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
  <configuration>
    <type>rar</type>
    <language>java</language>
    <addedToClasspath>true</addedToClasspath> <--- change to false
  </configuration>
</component>
2. or add a test to m2eclipse code to avoid addition to dependencies when the file's extension is not .zip nor .jar The first solution is the most clean, since it would be only a configuration improvement. But I'm not able to decide if the changed configuration is right: should a .rar file be included in classpath or not?
Hide
Permalink
Mauro Talevi added a comment - 19/Mar/08 7:43 AM

I too would favour solution 1. And would treat .rar file in the same way .zip files are.

http://www.rarlab.com/rar_file.htm

Show
Mauro Talevi added a comment - 19/Mar/08 7:43 AM I too would favour solution 1. And would treat .rar file in the same way .zip files are. http://www.rarlab.com/rar_file.htm
Hide
Permalink
Eugene Kuleshov added a comment - 19/Mar/08 11:16 AM

Mauro, Herve, are you interested to contribute the patch and the test case for that?

I think that option 1 is problematic from the regular maven cli point of view. Because maven working in the ide and in command line will see different classpath. The issue is actually with JDT, which is using hardcoded list of extensions allowed in the buildpath for compilation. All in all, I think solution 2 makes bit more sense and we had it implemented, but probably lost it during refactoring (hence need to add a test this time).

Show
Eugene Kuleshov added a comment - 19/Mar/08 11:16 AM Mauro, Herve, are you interested to contribute the patch and the test case for that? I think that option 1 is problematic from the regular maven cli point of view. Because maven working in the ide and in command line will see different classpath. The issue is actually with JDT, which is using hardcoded list of extensions allowed in the buildpath for compilation. All in all, I think solution 2 makes bit more sense and we had it implemented, but probably lost it during refactoring (hence need to add a test this time).
Hide
Permalink
Herve Boutemy added a comment - 19/Mar/08 6:05 PM

Yes, I'm interested in contributing.

I just tried option 1, and didn't find any difference with cli: if addedToClasspath=false, the dependency is not added to classpath with Surefire. Then AFAIK, this option is totally consistent between m2Eclipse and mvn cli, which is not the case with option 2.
Did I miss something?

Mauro: the rar file in the test you provided is not a file compressed with rar tool, but it is Resource Adapter Archive, a J2EE notion http://maven.apache.org/plugins/maven-rar-plugin/ (and technically, it is a jar file with a different extension)
Wasn't it intentional?

The more I work on this issue, the more I'm convinced .rar files should be excluded from classpath by configuration in components.xml like .war files are
=> I should create a MNG issue then patch Maven core instead of m2eclipse

For other file extensions that are not explicitely configured in components.xml, I just made the test: they are not added to classpath with cli and don't create any problem in m2eclipse

solution 1 seems really the good one

WDYT?

Show
Herve Boutemy added a comment - 19/Mar/08 6:05 PM Yes, I'm interested in contributing. I just tried option 1, and didn't find any difference with cli: if addedToClasspath=false, the dependency is not added to classpath with Surefire. Then AFAIK, this option is totally consistent between m2Eclipse and mvn cli, which is not the case with option 2. Did I miss something? Mauro: the rar file in the test you provided is not a file compressed with rar tool, but it is Resource Adapter Archive, a J2EE notion http://maven.apache.org/plugins/maven-rar-plugin/ (and technically, it is a jar file with a different extension) Wasn't it intentional? The more I work on this issue, the more I'm convinced .rar files should be excluded from classpath by configuration in components.xml like .war files are => I should create a MNG issue then patch Maven core instead of m2eclipse For other file extensions that are not explicitely configured in components.xml, I just made the test: they are not added to classpath with cli and don't create any problem in m2eclipse solution 1 seems really the good one WDYT?
Hide
Permalink
Herve Boutemy added a comment - 20/Mar/08 6:19 AM

in issue MRAR-17, proposed solution is to add the rar configuration in components.xml (which has been done since then (http://svn.apache.org/viewvc?view=rev&revision=593857)
but the configuration proposed at this time contained <addedToClasspath>false</addedToClasspath>

I think I'll work with this MRAR-17 issue to check if this configuration is really the good one

Show
Herve Boutemy added a comment - 20/Mar/08 6:19 AM in issue MRAR-17, proposed solution is to add the rar configuration in components.xml (which has been done since then (http://svn.apache.org/viewvc?view=rev&revision=593857) but the configuration proposed at this time contained <addedToClasspath>false</addedToClasspath> I think I'll work with this MRAR-17 issue to check if this configuration is really the good one
Hide
Permalink
Eugene Kuleshov added a comment - 20/Mar/08 3:13 PM

Herve, it seems like you are mixing rarlabs archive and rar bundle representing a resource adapter. For the latter it is actually legal to have classes in them and I'd say that Maven plugin currently does the right thing. So, we have to work around the JDT limitation and has hardcoded list of allowed archive extensions.

Show
Eugene Kuleshov added a comment - 20/Mar/08 3:13 PM Herve, it seems like you are mixing rarlabs archive and rar bundle representing a resource adapter. For the latter it is actually legal to have classes in them and I'd say that Maven plugin currently does the right thing. So, we have to work around the JDT limitation and has hardcoded list of allowed archive extensions.
Hide
Permalink
Herve Boutemy added a comment - 02/Apr/08 4:11 PM

I read j2EE Connector Spec, and I'm now convinced that .rar files are exactly like war files: they should not be added to classpath (and they include their dependencies)
BTW, same issue with .ejb3 and .par files...

as soon as Maven 2.0.9 is released, I'll apply MNG-3497 change
Then there won't be any problem in m2eclipse with .rar files when embedder is updated

Show
Herve Boutemy added a comment - 02/Apr/08 4:11 PM I read j2EE Connector Spec, and I'm now convinced that .rar files are exactly like war files: they should not be added to classpath (and they include their dependencies) BTW, same issue with .ejb3 and .par files... as soon as Maven 2.0.9 is released, I'll apply MNG-3497 change Then there won't be any problem in m2eclipse with .rar files when embedder is updated
Hide
Permalink
Eugene Kuleshov added a comment - 02/Apr/08 5:36 PM

Herve, can you please do that in trunk, because that is the version used for dependency resolution.

Show
Eugene Kuleshov added a comment - 02/Apr/08 5:36 PM Herve, can you please do that in trunk, because that is the version used for dependency resolution.
Hide
Permalink
Herve Boutemy added a comment - 03/Apr/08 1:31 PM

I suppose you don't want to wait...
ok, done in trunk (and waiting 2.0.9 release to merge in 2.0.x branch)

Show
Herve Boutemy added a comment - 03/Apr/08 1:31 PM I suppose you don't want to wait... ok, done in trunk (and waiting 2.0.9 release to merge in 2.0.x branch)
Hide
Permalink
Herve Boutemy added a comment - 01/May/08 12:33 PM

I just checked and the problem is not here any more: embedder has been updated to version 2.1.0.20080413-2200, which contains MNG-3497 fix

Show
Herve Boutemy added a comment - 01/May/08 12:33 PM I just checked and the problem is not here any more: embedder has been updated to version 2.1.0.20080413-2200, which contains MNG-3497 fix

People

  • Assignee:
    Herve Boutemy
    Reporter:
    Mauro Talevi
Vote (1)
Watch (2)

Dates

  • Created:
    24/Oct/07 5:08 AM
    Updated:
    16/Jan/09 10:34 AM
    Resolved:
    01/May/08 12:33 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.