You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jean-Paul GUIGUI (JIRA)" <ji...@codehaus.org> on 2009/03/30 03:38:12 UTC

[jira] Created: (MECLIPSE-539) runtime scope dependencies should not be included into .classpath

runtime scope dependencies should not be included into .classpath
-----------------------------------------------------------------

                 Key: MECLIPSE-539
                 URL: http://jira.codehaus.org/browse/MECLIPSE-539
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Improvement
          Components: Core : Dependencies resolution and build path (.classpath)
    Affects Versions: 2.6
         Environment: maven 2.0.9
Java 6
Eclipse 3.4.2
WinXP
            Reporter: Jean-Paul GUIGUI


"runtime" scope dependencies are today included by "mvn eclipse:eclipse" into the .classpath as the other compile dependencies. It should not since it make possible to use these runtime dependencies by mistake into Eclipse and then write code which is broken the "mvn compile" goal.
Ideally the "runtime" dependencies should not be included into the .classpath, but add only as "User entries" into the "Run configuration -> Classpath" of Eclipse


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-539) runtime scope dependencies should not be included into .classpath

Posted by "Owen Jacobson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183146#action_183146 ] 

Owen Jacobson commented on MECLIPSE-539:
----------------------------------------

This doesn't just affect the runtime scope, though: test scope dependencies are usable anywhere in the resulting Eclipse project, even though using them in the wrong part of the project prevents mvn compile from building your project. I don't think there's a good way around this in the general case: Eclipse, ultimately, only has one classpath scope, which is tied to the whole project.

Get in the habit of checking your commits by doing a clean build in maven before committing, and set up CI (hudson, bamboo, cruisecontrol, whatever) to catch the ones you and your team miss. It's not optimal, but without more support for dependency scoping in eclipse, it's probably as good as it gets.

Before someone suggests it, no, dependency filtering (through Eclipse's include/exclude feature) isn't good enough - it goes the wrong direction, so you can't say that src/main/java excludes org.junit and unit.

> runtime scope dependencies should not be included into .classpath
> -----------------------------------------------------------------
>
>                 Key: MECLIPSE-539
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-539
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.6
>         Environment: maven 2.0.9
> Java 6
> Eclipse 3.4.2
> WinXP
>            Reporter: Jean-Paul GUIGUI
>
> "runtime" scope dependencies are today included by "mvn eclipse:eclipse" into the .classpath as the other compile dependencies. It should not since it make possible to use these runtime dependencies by mistake into Eclipse and then write code which is broken the "mvn compile" goal.
> Ideally the "runtime" dependencies should not be included into the .classpath, but add only as "User entries" into the "Run configuration -> Classpath" of Eclipse

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-539) runtime scope dependencies should not be included into .classpath

Posted by "Hans-Peter Störr (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276917#comment-276917 ] 

Hans-Peter Störr commented on MECLIPSE-539:
-------------------------------------------

This is indeed quite annoying, since the eclipse classpath gets polluted, you can accidentially use classes from the runtime deps in the code, and you are in for surprises if you compile with maven only.

> runtime scope dependencies should not be included into .classpath
> -----------------------------------------------------------------
>
>                 Key: MECLIPSE-539
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-539
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Improvement
>          Components: Core : Dependencies resolution and build path (.classpath)
>    Affects Versions: 2.6
>         Environment: maven 2.0.9
> Java 6
> Eclipse 3.4.2
> WinXP
>            Reporter: Jean-Paul GUIGUI
>
> "runtime" scope dependencies are today included by "mvn eclipse:eclipse" into the .classpath as the other compile dependencies. It should not since it make possible to use these runtime dependencies by mistake into Eclipse and then write code which is broken the "mvn compile" goal.
> Ideally the "runtime" dependencies should not be included into the .classpath, but add only as "User entries" into the "Run configuration -> Classpath" of Eclipse

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira