Should the IClasspathEntry.isTest() be returning true for runtime scoped dependencies? #1669
Unanswered
stephendnicholas
asked this question in
Q&A
Replies: 1 comment 3 replies
-
this really seems not to be correct, do you like to propose a PR to change that and we will see if something fails? I would even argue that the check should be the other way round, only mark it as test if scope == test and in all other cases add it to the default classpath. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi There,
I'm currently writing an Eclipse plugin that wants to determine the runtime classpath of some projects in the workspace, excluding any test related entries.
However I've noticed that the
ClasspathEntry
objects coming back from theMavenClasspathContainer
all seem to return true fromisTest()
where the scope of the dependency is runtime or test, but not compileE.g. Based on the toString of the 'ClasspathEntry' objects when debugging (Slightly obfuscated for work reasons):
C:\Users\stephenn\.m2\repository\AJAR.jar[CPE_LIBRARY][K_BINARY][sourcePath:C:/Users/stephenn/.m2/repository/AJAR-sources.jar][isExported:false][attributes:maven.pomderived=true,maven.groupId=com.maven.artifactId=ajar-api,maven.version=5.0.9-alfa1001,maven.scope=compile]
C:\Users\stephenn\.m2\repository\BJAR.jar[CPE_LIBRARY][K_BINARY][sourcePath:C:/Users/stephenn/.m2/repository/BJAR-sources.jar][isExported:false][attributes:maven.pomderived=true,test=true,maven.groupId=com.maven.artifactId=bjar-runtime,maven.version=1445,maven.scope=runtime]
C:\Users\stephenn\.m2\repository\com\CJAR.jar[CPE_LIBRARY][K_BINARY][sourcePath:C:/Users/stephenn/.m2/repository/CJAR-sources.jar][isExported:false][attributes:maven.pomderived=true,test=true,maven.groupId=com.maven.artifactId=cjar-testsupport,maven.version=1021,maven.scope=test]
I guess I can look to filter on both the
maven.scope
and thetest
attributes (if test=true, then also check maven.scope is not runtime), but I was wondering if it might be a bug thatmaven.scope=runtime
seems to always havetest=true
? Or perhaps I'm just misunderstanding how these two are supposed to interact?Hope that makes sense
Thanks,
Steve
Beta Was this translation helpful? Give feedback.
All reactions