how to specify the order of maven dependencies

1,810 views
Skip to first unread message

mars1412

unread,
Jul 2, 2008, 9:14:31 AM7/2/08
to Q for Eclipse users list
is there a way to specify the order of dependencies in the Maven
Classpath Container?

my problem:
I have 2 jars:
* gwt-user.jar (scope provided): includes some GWT API stuff + SOURCE
CODE + servlet API stuff
* gwt-servelt.jar (scope runtime): includes only the GWT API stuff

since gwt-servlet.jar appears first in the 'Maven Classpath
Container', eclipse will not be able to open the source code of any of
these files
I guess, if I could just switch the order, everything was fine...

or is there any other way around this?
maybe I can explicitly specify the source-code location somewher else:
eclipse, pom.xml, ..?

tx in advance

Abel Muiño Vizcaino

unread,
Jul 6, 2008, 4:46:10 PM7/6/08
to q4e-...@googlegroups.com
How Maven (and q4e) work with sources is having different artifacts for it. When an artifact with the same group-id, artifact-id and version is available but with the sources classifier, q4e automatically uses it (unless told otherwise in the settings).

In your case, the workaround would be to install the gwt-servlet-sources.jar, if it is available (or make one and install on the local repo).

Altering the classpath is currently out of scope at this point. We strive to have the same classpath as maven uses on the command line, or as close as possible.

mars1412

unread,
Jul 8, 2008, 6:18:08 AM7/8/08
to Q for Eclipse users list
thanks for the answer - yeah that should work

but I have another question to this subject:
why does the gwt-servlet.jar show up in the eclipse 'Maven Classpath
Container'?
I think it shouldn't, since it's scope is runtime.

Abel Muiño

unread,
Jul 8, 2008, 9:15:57 AM7/8/08
to q4e-...@googlegroups.com
All dependencies are there to allow building the project AND launching tests, running or deploying to WTP (the scope is used to check which dependencies are deployed to the server and which are skipped).

Since you can launch your project from Eclipse, we need Runtime deps also in the classpath, although other options might exist.

If you feel this show work in a different way, please open an enhancement request suggesting this :-) . Patches are always welcome!
--
Abel Muiño - http://ramblingabout.wordpress.com/
Reply all
Reply to author
Forward
0 new messages