Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Maven Dependencies in Module Path in Runconfiguration
Maven Dependencies in Module Path in Runconfiguration [message #1800143] Thu, 20 December 2018 12:44 Go to next message
André Schweiger is currently offline André SchweigerFriend
Messages: 4
Registered: December 2018
Junior Member
I'm currently in the process of creating my first Java 10 (soon to be 11) Module based project.

The Problem is, I also chose Maven for dependency managment and I need these dependencies to be on the module path.
I managed to to this for the build configuration by simply dragging the "Maven Dependencies" into the module path. But the same does not seem to be possible for any run configurations. These list "Maven managed dependencies" on the classpath resulting in a java.lang.module.FindException when trying to run them.

The Project itself can be successfully build using eclipse and/or maven. Also using the experimental maven-jlink-plugin results in a working runtime image.

It seems to me all that would be needed to fix this, is to have the maven managed dependencies on the module path inside the run configuration. But as I said, I could not find any way to do this.
Re: Maven Dependencies in Module Path in Runconfiguration [message #1800156 is a reply to message #1800143] Thu, 20 December 2018 14:53 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Hello,

I will put some pictures of my setup for java 11 using java FX I hope it will be helpful.

my POM:
index.php/fa/34533/0/

I also created module-info.java:
index.php/fa/34534/0/

the file created looks like this:
index.php/fa/34535/0/

My build path looks like this (done automatically):
index.php/fa/34537/0/

Now you can create a regular run configuration and also export executable jar

Regards.
Re: Maven Dependencies in Module Path in Runconfiguration [message #1800157 is a reply to message #1800156] Thu, 20 December 2018 15:01 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
The "transitive" was added manually because the compiler was not happy.... ;-)

index.php/fa/34538/0/
Re: Maven Dependencies in Module Path in Runconfiguration [message #1800160 is a reply to message #1800143] Thu, 20 December 2018 16:16 Go to previous messageGo to next message
André Schweiger is currently offline André SchweigerFriend
Messages: 4
Registered: December 2018
Junior Member
I've done pretty much the same thing, which works for building:
index.php/fa/34540/0/
But when creating a regular run configuration, the maven dependencies end up in the class path with seemingly no way to change that:
index.php/fa/34541/0/
  • Attachment: 1.png
    (Size: 6.84KB, Downloaded 4928 times)
  • Attachment: 2.png
    (Size: 6.43KB, Downloaded 4930 times)

[Updated on: Thu, 20 December 2018 16:21]

Report message to a moderator

Re: Maven Dependencies in Module Path in Runconfiguration [message #1800165 is a reply to message #1800160] Thu, 20 December 2018 18:09 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Hi,

This what I have in the run configuration (looks like yours)

But if hit the "show command line" we can see that the command line include -p

index.php/fa/34543/0/

which stands for:

--module-path modulepath... or -p modulepath (from https://docs.oracle.com/en/java/javase/11/tools/tools-and-command-reference.html )

Looks like a discrepancy between run configuration dialog and the java build path dialog or am I missing something...

Do you have module-info.java ?
Re: Maven Dependencies in Module Path in Runconfiguration [message #1800166 is a reply to message #1800165] Thu, 20 December 2018 18:20 Go to previous messageGo to next message
André Schweiger is currently offline André SchweigerFriend
Messages: 4
Registered: December 2018
Junior Member
I do have a module-info.
But when I click show command line, the maven dependencies are listed only as -classpath, manually executing the command with them moved to -p works.

edit: But I just noticed another thing. While "Maven Dependencies" itself is listed as "Is modular" in the build path settings, the actual dependencies themselves are listed as "Is not modular - non modifiable". But the dependencies are clearly modular as they contain module-info.class and are usable when building with maven/jlink directly.

[Updated on: Thu, 20 December 2018 18:26]

Report message to a moderator

Re: Maven Dependencies in Module Path in Runconfiguration [message #1800167 is a reply to message #1800166] Thu, 20 December 2018 18:32 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Odd...

I am using:

- eclipse-java-2018-12-R-win32-x86_64.zip (the latest)
- openjdk-11.0.1_windows-x64_bin.zip
- Windows 10 64bit


Re: Maven Dependencies in Module Path in Runconfiguration [message #1800168 is a reply to message #1800167] Thu, 20 December 2018 19:02 Go to previous messageGo to next message
André Schweiger is currently offline André SchweigerFriend
Messages: 4
Registered: December 2018
Junior Member
Really, I spent two days trying to get this running, fixing almost all problems.
And it all is allready fixed, simply by updating from 2018-09 to 2018-12.
I feel really stupid now.
Re: Maven Dependencies in Module Path in Runconfiguration [message #1800253 is a reply to message #1800168] Sat, 22 December 2018 09:07 Go to previous messageGo to next message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
Dear André,

I have been a programmer since 1973...(I am retired now).

Just to let you know that you will fill stupid many more times.

Do not let it make you feel bad about yourself.

Simply look at it as a lesson and in the future try to remember the lesson.

And always be lazy...

Regards.
Re: Maven Dependencies in Module Path in Runconfiguration [message #1800264 is a reply to message #1800253] Sat, 22 December 2018 09:50 Go to previous message
Eitan Rosenberg is currently offline Eitan RosenbergFriend
Messages: 143
Registered: October 2018
Senior Member
feel.....
Previous Topic:Use a windows inside IDE to display Android/iOS view
Next Topic:[JDT API] Searching for particular method calls
Goto Forum:
  


Current Time: Fri Apr 26 20:51:31 GMT 2024

Powered by FUDForum. Page generated in 0.03452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top