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 1.x Eclipse Plugin
  • MPECLIPSE-103

Allow to skip dependencies from being included in .classpath file

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Labels:
    None

Description

Need a means to specify that some maven dependencies are NOT included in the generated .classpath file.

Reason: Maven builds a project. This may include generating source via castor, InjectJ, etc.
Once the source code is generated, the generated source may not depend on the various jars that helped generate it.
That means, the Eclipse project should not depend on these jars. Currently, it is not possible to exclude these jars.

Can you add an additional property, like <eclipse.classpath.include>no</eclipse.classpath.include>, which will
not add the dependency to the generated classpath file.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Trygve Laugstol added a comment - 16/Sep/05 6:10 AM

I don't see how this can happen as the dependencies used to generate the source code will be dependencies of the plugin, not the project. Are you sure that this is what actually is happening?

Show
Trygve Laugstol added a comment - 16/Sep/05 6:10 AM I don't see how this can happen as the dependencies used to generate the source code will be dependencies of the plugin, not the project. Are you sure that this is what actually is happening?
Hide
Permalink
Werner Schulz added a comment - 16/Sep/05 7:00 AM

Yes, the dependencies listed in the project are all included in the Eclipse classpath file.

From the Maven Eclipse Plugin documentation (see http://maven.apache.org/reference/plugins/eclipse/goals.html):

Goal: eclipse:generate-classpath

Description: Generates a .classpath file for the eclipse project with classpath entries for
1. the build source directory
2. the build unit test source directory
3. the JRE being used
4. the appropriate version of JUnit
5. each Maven project dependency
6. an output directory for compiled code: target\classes
7. any .zip source archives

The problem is item 5.

In my project, we generate some enumerations using Castor (using xerces-2.4). The generated
code is completely independent of XML or Castor.
The generated enumerations are needed in code that also accesses some proprietary stuff
which relies on an older version of xerces. Suddenly, Eclipse gets confused because the required
presence of castor and xerces dependencies in the project file (castor plugin doesn't seem to find
the necessary jars on its own!?) conflict with dependencies from other code bits.

This is an example where build and development dependency requirements are different but this
is not recognised by the eclipse plugin.

Show
Werner Schulz added a comment - 16/Sep/05 7:00 AM Yes, the dependencies listed in the project are all included in the Eclipse classpath file. From the Maven Eclipse Plugin documentation (see http://maven.apache.org/reference/plugins/eclipse/goals.html): Goal: eclipse:generate-classpath Description: Generates a .classpath file for the eclipse project with classpath entries for 1. the build source directory 2. the build unit test source directory 3. the JRE being used 4. the appropriate version of JUnit 5. each Maven project dependency 6. an output directory for compiled code: target\classes 7. any .zip source archives The problem is item 5. In my project, we generate some enumerations using Castor (using xerces-2.4). The generated code is completely independent of XML or Castor. The generated enumerations are needed in code that also accesses some proprietary stuff which relies on an older version of xerces. Suddenly, Eclipse gets confused because the required presence of castor and xerces dependencies in the project file (castor plugin doesn't seem to find the necessary jars on its own!?) conflict with dependencies from other code bits. This is an example where build and development dependency requirements are different but this is not recognised by the eclipse plugin.
Hide
Permalink
fabrizio giustina added a comment - 26/Nov/05 9:24 AM

> In my project, we generate some enumerations using Castor (using xerces-2.4). The generated
> code is completely independent of XML or Castor.

If I understood correclty, you added the castor dependency in order to generate source code: the castor dependency, however, should not be a project dependency but a plugin dependency. For example this should work if you are using the maven castor plugin at http://maven.apache.org/maven-1.x/reference/plugins/castor/index.html (do you?).

If you are using a custom ant task you will need castor and xerces in the classpath, but this is not the recommended way.
First of all, castor will be in the classpath used by maven when executing tests, and this is the same situation you are seeing in eclipse (so, it SHOULD fail in eclipse if it fails with maven).

As a solution you should:

  • use a plugin to generate sources and, if such plugin doesn't exist, extract your code from maven.xml and put it in a plugin (recommended)
  • manually modify the classpath before calling the ant task used to generate sources, removing the castor jar from project.xml
Show
fabrizio giustina added a comment - 26/Nov/05 9:24 AM > In my project, we generate some enumerations using Castor (using xerces-2.4). The generated > code is completely independent of XML or Castor. If I understood correclty, you added the castor dependency in order to generate source code: the castor dependency, however, should not be a project dependency but a plugin dependency. For example this should work if you are using the maven castor plugin at http://maven.apache.org/maven-1.x/reference/plugins/castor/index.html (do you?). If you are using a custom ant task you will need castor and xerces in the classpath, but this is not the recommended way. First of all, castor will be in the classpath used by maven when executing tests, and this is the same situation you are seeing in eclipse (so, it SHOULD fail in eclipse if it fails with maven). As a solution you should:
  • use a plugin to generate sources and, if such plugin doesn't exist, extract your code from maven.xml and put it in a plugin (recommended)
  • manually modify the classpath before calling the ant task used to generate sources, removing the castor jar from project.xml

People

  • Assignee:
    fabrizio giustina
    Reporter:
    Werner Schulz
Vote (0)
Watch (0)

Dates

  • Created:
    15/Sep/05 9:39 AM
    Updated:
    26/Nov/05 9:24 AM
    Resolved:
    26/Nov/05 9:24 AM
  • 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.