You can see in the screencast that I’ve removed the eclipse{} block you originally had. The mrJar plugin has an Eclipse Modulefication feature that does away with the noisiness of that block.
You also don’t need to require the JUnit 5 module in your module-info with mrJar in the mix. So that’s gone too.
You might occassionally need to do a Right-click — Gradle — Refresh Gradle Project after you make certain changes in your project as you’re working in it. Let me know if I can answer any questions for you about the usage of mrJar . Or this usage page might be useful. TIA
Yeah, sorry for the delay, too many things to do.
Your plugin seems to work, I’m only not sure why are you changing default eclipse bin folder with build folder.
I don’t know if it’s a good idea or not mixing them while working with eclipse, isn’t that going into conflict?
Awesome @regrog! Sincere thanks for the feedback I’m relieved it didn’t break on you. Heh-heh.
I did that primarily because ${projectDir}/build/classes... is a Gradle convention for the output folder. And since mrJar is a Gradle plugin, it makes sense to me to follow that convention.
The Gradle convention thing is the primary reason I went for build/.... But secondarily, it’s just a habit I’ve developed over a lot of years of using Eclipse. I just always nuke bin as usually the first thing I do whenever I create a new Eclipse/vscode project. And replace it with either target/classes or build/classes. Depending on which builder I’m using.
I’ve done it forever and it’s never caused my Eclipse/vscode projects any problems.
Here are some other things, @regrog, that convince me there is no risk of conflict:
Eclipse provides the ability to change the „default“ source and output folders — i.e. to make your own custom default; that is: something other than src and bin
permanently — on a workspace-wide basis
and/or temporarily — on a project-specific basis
Eclipse devs probably wouldn’t allow the GUI to change the default source and output folders if changing them could potentially cause conflicts
The values set as „defaults“ in most software are ordinarily never mandatory values
So, all of these laborious steps I’m doing here manually in the Eclipse GUI…
…have the exact same effect that the mrJar plugin has. The only difference is that the plugin changes the defaults programatically versus manually. Notice in the screencast that Eclipse’s Problems view shows 0 items?
And too: You now how when Eclipse sometimes takes forever to do stuff? Sometimes that’s because it has to index the files of the project. If you have a Maven project that has both the conventional target/classesand Eclipse’s default bin then it is very likely that there are duplicate files in both locations at any given time. And the more files there are, the longer Eclipse’s indexing takes. So I see that as another reasonable case for doing away with the default bin folder in certain circumstances.
Apologies if that’s belaboring the point. But I figured it would be helpful to share what I’ve learned with you and other users new to Eclipse who might not be aware that the IDE itself provides the ability in the UI to override those defaults.
I’m trying to use your plugin in a multi project but I can’t run tests in eclipse. Running tests via Gradle works good.
This is the project example: multiProjectA.zip (62.1 KB)
When I try to run tests in api, eclipse asks for junit 5.
Also, I cant understand if I should put apply plugin: 'com.lingocoder.mrjar' in allprojects or in subprojects.
I’ll share the question as soon as I create it, I can’t create a good topic right now.
Thanks @regrog. I’ll take a look in a moment. In the meantime, you could take a look at these examples of mrJar being applied in other multi-module projects:
You should be able to get an idea from those project’s build.gradles how to setup your project. But I will download your project and see what I can see regarding your problem running tests.
I really appreciate your helping me troubleshoot the plugin, regrog. Much appreciated
Notice in the screencast when I switch to the shell? You need to delete the .classpath file that Eclipse generates on first import. It needs to be deleted because the Eclipse Modulefication feature of mrJar won’t modulefy the project if there is already a .classpath file there. For v0.0.15, that step is necessary.
Having deleted it though, running the :eclipse task is, therefore, also necessary. Running the :eclipse task is the key to mrJar’sEclipse Modulefibility. You can see the before and after effects in the screencast.
Before it, the project’s dependencies are in the Classpath. After it, the project’s dependencies are in the Modulepath.
NOTE: If you ever do File — Gradle — Refresh Gradle Project at any point after you run the :eclipse task, and IFF things go out of whack, then you might have to re-Moduleificate the project by rerunning the :eclipse task again.
For v0.0.16, I will probably just overwrite .classpath. In the meantime, however, I hope it’s not too much effort to do those two shell commands manually for the time being.
Please, don’t hesitate to get in touch with any other questions, regrog. Thanks again for your feedback. Muy appreciado