The mrJar Plugin v0.0.13 has been released — Modular MRJAR Files Made Easy

Or, how about: Minimally Viable Product?

Hi folks,

Sorry for not commenting earlier, the dependency management team I work in is very busy with the upcoming 6.0 release, which is of great interest to what you’re doing. First, I’d recommend reading my point of view regarding mrjars, which hasn’t changed much. In a lot of cases, mrjars are just a poor man’s technical response to bad dependency management tools.

However, there are valid use cases for mrjars, in particular when you don’t know what the target runtime is. To me, however, mrjar or not is a packaging problem. Whatever solution is designed (and I think eventually this should be part of Gradle itself), it’s the library designer decision to publish a mrjar or not.
However, it is technically possible to delay that decision to the end of the process. In other words, there’s nothing which prevents from having a project directory structure which allows both individual jars for each target platform (foo-jdk9, foo-jdk10, foo-jdk11, …) and a mrjar (foo-multiarch). In the end, those are all variants of the same thing that Gradle can handle nicely.

So, it’s all about finding the right structure. The blog post I hinted at demonstrates such a structure, but it doesn’t mean it’s final. I also think this is orthogonal to using modules and I don’t think a mrjar plugin should be tied to modular Java. I’d also be careful with the directory layout shown in various Java documentations, because they are not particularly keen on following conventions.

Said differently, I think having a mrjar plugin, or, mrjar support in Gradle itself, is a natural candidate for the advanced variant-aware dependency management Gradle 6.0 is providing. There are some docs available here if you’re interested: https://docs.gradle.org/nightly/userguide/modeling_features.html

3 Likes

Hey thanks for replying @CedricChampeau!

Yeah, that very blog post is why I said you are my favorite Gradle Core Dev :wink: It’s like I was telling @tlinkowski the other day, it was your blog post that got me hooked on MRJARs several months ago.

To handle those very specific valid uses cases is the primary reason mrJar was created. The secondary reason, was because I wanted to learn whether it was even technically possible to do at all. The reason I wanted to learn if an MRJAR plugin was technically possible, was because I recall reading somewhere in the forums where some Gradle core dev or another said something to the effect that adding an MRJARing capability to Gradle was not technically possible. And I thought to myself: That doesn’t sound right. Surely, it must be possible! So…

Right now you mean? Or in the upcoming version 6? Either way, I think that’s awesome! I will definitely be reading that nightly documentation link you shared. Thanks, CedricChampeau :+1: What is the ETA for 6, by the way?

I hear ya CedricChampeau. But to be fair, although mrJar does provide those two capabilities in the one plugin, those two capabilities are not „tied“ to one another in the strict sense of the word. In fact, the JPMS-modularizing capability was tacked on as more or less an afterthought — after I’d already completely implemented the MRJARing capability.

The relationship between the two capabilities in mrJar is exactly the same relationship of the compilation and archiving capabilities provided by Gradle’s built-in Java Plugin.

In both plugins, compiling the source code of a project and jarring the artifact of the project, are two distinct capabilities. They just so happen to be provided by the one plugin. I mean there is not a distinct core Gradle Jar Plugin and a separate distinct Compile Java Plugin. Right?

So just like with Gradle’s own Java Plugin, with mrJar you can use one capability without ever going anywhere near the other. The thing that makes that decoupling of the two capabilities possible in mrJar, is exactly the thing you mentioned earlier: it’s all about the directory structure.

Thanks for creating the opportunity for me to clarify that, CedricChampeau :+1:

That sounds like such a cool feature! Again, like I said to somebody the other day: if I could do what I did in mrJar, Gradle’s devs could put my efforts to shame in a matter of hours :laughing: I can’t wait for version 6 to hit! :+1:

I haven’t read the entire Modeling features and their dependencies page from your nightly link yet, @CedricChampeau. So please forgive me if my understanding is incomplete at the moment.

But regarding just this particular caveat…

Capabilities are published to Gradle Module Metadata. However, they have no equivalent in POM or Ivy metadata files. As a consequence, when publishing such a component, Gradle will warn you that this feature is only for Gradle consumers

For the scenario you talk about here…

…the „they have no equivalent in POM…this feature is only for Gradle consumers“ consequence is not relevant to the above foo-jdkNfoo-multiarch packaging situation right? Because those are just JARs. And my expectation is that there shouldn’t be any reason why Maven/Ivy consumers would not be able to use standard JARs as normal — regardless of how they were built. Am I understanding that part correctly?

I’ve polished up a couple implementation details in v0.0.12. One significant obvious change in this version is the releases property is now optional.

I’ve tested v0.0.12’s functionality with a new demo project. So far this is the most full-featured module-based project I’ve applied mrJar to.

It’s a RESTful service/client system implemented using the Dropwizard framework. The application is structured as three independent modules. Technologies include Jersey, MySQL and Hibernate, among others.

The original project on which the mrJar demo is based, used the com.zyxist.chainsaw plugin. Replacing that plugin with mrJar made my demo project’s build script in particular — and the entire project in general — much simpler, more streamlined, than the original.

All the other demo projects I tested earlier versions with, have now been updated to v0.0.12:

Make the gradle-modules-plugin a module
Multi-module Group-compilation with --module-source-path & JavaFX
The Gradle Guide’s modular Java 9 Storyteller Application
Paul Bakker’s gradle-modules-plugin-example
Detailed mrJar usage instructions

So if you tried an earlier version that might have been broken, I’m pretty sure I’ve fixed whatever problem you might have encountered in earlier versions. If not, please let me know? TIA :+1:

Hey @xbradleyhunterx. I raised this Gradle enhancement request the other day. It is related to that one „extraneaous command-line arguments“ problem you reported a while back for your use case.

Maybe if enough people vote for it, Gradle devs might do something about it at some point.

Did you ever figure out how to make Gradle not add those stupid system properties, by the way?

Bug Fixes in v0.0.13

  • RegressionSomething I changed somewhere in v0.0.12, caused the project’s default runtime to be used to compile every release-specific source set of an MRJARFIXED
  • RegressionThe :jar task began reporting „Skipping task ‘:jar’ as task onlyIf is false“ for some reason. Code changes in the applying project weren’t being bundled as expectedFIXED

Heads up

    plugins{
        id 'com.lingocoder.mrjar' version '0.0.13' apply false
    }
    ...
    subprojects{
        ...
    }

…breaks mrJar. The root project needs to do this instead…

    plugins{
        id 'com.lingocoder.mrjar' version '0.0.13'
    }
    ...
    subprojects{
        ...
    }

Surprisingly, projects with the precise same hierarchical structurebut use allprojects instead of subprojects — work perfectly fine with apply false.

If anybody can please share their knowledge of the general conditions under which apply false might cause problems in multi-projects, I’d be sincerely grateful. TIA.

I can’t thank the gradle-module-plugin project often enough. So thanks again @tlinkowski, @siordache, et al. You guys’ ModulePluginSmokeTest passing with flying colors with mrJar applied to your project, gives me boatloads of confidence that mrJar is in at least reasonable shape for a minimum viable product :+1:

Another concern that @chrisdennis expressed in Gradle issue #10046 was: „I’m not sure I can trust [mrJar] when I need to run it on privileged machines“.

I wasn’t sure myself. So I did a scientific, totally objective experiment in which I ran the mrJar JAR through 57 different virus scanners. I also ran mrJar through an OWASP security analyzer as part of the build for v0.0.13’s demo project .

I’m sharing the results of my experiment for open peer review.

For what it’s worth: I’m sharing this because (a) I think it’s interesting data in its own right (b) Sharing any security analysis data is always the responsible thing to do, in my opinion.

The good news is that mrJar got a clean bill of health!1 The not-so-good news is that tons of people are using dozens of third party open source dependencies that have known security vulnerabilities. And „on privileged machines“ no less.

Who knew that Gradle had so many security issues? That was a huge surprise to me! :astonished:

Ironically, the dependency-check plugin flagged itself as having security vulnerabilities! How’s about that for objectivity and full disclosure?

But as the saying goes: „Nullius in verba“. Anybody could repeat for themselves the same experiment I did. They’d get the same results. Just download that above-linked v0.0.13 demo project and run the :repeatExperiment task from that project’s authn folder. If your Gradle’s cache has any of the same files in it that mine did at the time, then you should see that the hashes are the same for the same artifact.

Oh! And please share your results of your own dependency check experiments? TIA :+1:


1 Of course, mrJar wouldn’t be in NIST’s NVD because (a) NIST don’t have the source code. And (b) nobody but me’s using mrJar anyway :blush:

v0.0.14 of mrJar introduces an Eclipse Modulfier feature

No biggie @Graou74. That Eclipse script I shared with you, I’ve been using in Visual Studio Code a lot for the past several months. So out of habit I add it to every new project I create. I’d actually forgotten that I’d bundled it into that one project I’d uploaded for you until the next day.

It is a hassle to copy a script into every new project. Isn’t it? So I went ahead and incorporated Eclipse/VS Code plug-and-playability into mrJar v0.0.14. So using VS Code/Eclipse should be a little less of a pain in the butt for me with this.

There are three ways to modulfy Eclipse with this new mrJar feature. Here’s a video showing the main way that I prefer to use it myself:

The Solution

  1. First — before I import my project into VS Code (which is really just Eclipse-lite) — I apply the mrJar plugin to my build.gradle

     plugins{ 
         ...
         id 'java-library'
         id 'eclipse'
         id 'com.lingocoder.mrjar' version '0.0.14'
         ...
     }
    
  2. Then I import the existing Gradle project like normal

That’s all there is to it! Eclipse has now been modulefied!

Or it’s also possible to modulefy an existing VS Code/Eclipse project. Doing it that way, there are two options:

  1. Do nothing and let mrJar automatically apply the modulefication, lazily, to the project
  2. Explicitly call the :eclipse task like normal (after applying mrJar inbuild.gradle, of course)

Feel free to try mrJar out for yourself, @Graou74. In addition to this new Eclipse module enabling feature, release v0.0.14 also fixes a bug I discovered the other day.

Hello Lingocoder,

I just tried the mrjar plugin on a new project but I have the following trace to the “Refresh Gradle Project” (I filled in the builkd.gradle the task “plugins” with “id ‘com.lingocoder.mrjar’ version ‘0.0.14’”):

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘ZZTest’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not find mr.jar:common:0.0.14.
Searched in the following locations:
- https://plugins.gradle.org/m2/mr/jar/common/0.0.14/common-0.0.14.pom
Required by:
project : > com.lingocoder.mrjar:com.lingocoder.mrjar.gradle.plugin:0.0.14 > com.lingocoder:mrjar:0.0.14
Could not find mr.jar:test.task:0.0.14.
Searched in the following locations:
- https://plugins.gradle.org/m2/mr/jar/test.task/0.0.14/test.task-0.0.14.pom
Required by:
project : > com.lingocoder.mrjar:com.lingocoder.mrjar.gradle.plugin:0.0.14 > com.lingocoder:mrjar:0.0.14
Could not find mr.jar:multi.project:0.0.14.
Searched in the following locations:
- https://plugins.gradle.org/m2/mr/jar/multi.project/0.0.14/multi.project-0.0.14.pom
Required by:
project : > com.lingocoder.mrjar:com.lingocoder.mrjar.gradle.plugin:0.0.14 > com.lingocoder:mrjar:0.0.14

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project ‘ZZTest’.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:80)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:73)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$600(LifecycleProjectEvaluator.java:53)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:109)
    at org.gradle.internal.Factories$1.create(Factories.java:26)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:227)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:221)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:187)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:96)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:68)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:693)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:141)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:55)
    at org.gradle.configuration.BuildOperatingFiringProjectsPreparer$ConfigureBuild.run(BuildOperatingFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.configuration.BuildOperatingFiringProjectsPreparer.prepareProjects(BuildOperatingFiringProjectsPreparer.java:40)
    at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:198)
    at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:138)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:126)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:106)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:60)
    at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:57)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:85)
    at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:78)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:78)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:57)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:60)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:27)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ‘:classpath’.
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:1258)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$2200(DefaultConfiguration.java:139)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationArtifactCollection.ensureResolved(DefaultConfiguration.java:1712)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationArtifactCollection.getArtifacts(DefaultConfiguration.java:1684)
    at org.gradle.composite.internal.CompositeBuildClassPathInitializer.execute(CompositeBuildClassPathInitializer.java:45)
    at org.gradle.composite.internal.CompositeBuildClassPathInitializer.execute(CompositeBuildClassPathInitializer.java:32)
    at org.gradle.api.internal.initialization.DefaultScriptClassPathResolver.resolveClassPath(DefaultScriptClassPathResolver.java:37)
    at org.gradle.api.internal.initialization.DefaultScriptHandler.getScriptClassPath(DefaultScriptHandler.java:83)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineScriptHandlerClassScope(DefaultPluginRequestApplicator.java:210)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:143)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:206)
    at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)
    at org.gradle.configuration.project.BuildScriptProcessor$1.run(BuildScriptProcessor.java:45)
    at org.gradle.internal.Factories$1.create(Factories.java:26)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:201)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:187)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:107)
    … 107 more
    Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find mr.jar:common:0.0.14.
    Searched in the following locations:

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s

Do you have any idea what it is?

Best regards

----- Mail original -----

Hey thanks for the feedback @Graou74! Apologies for the delayed reply. I was pretty engrossed in something else and couldn’t break away to check in on the forum until now.

So sorry. That was a failed experiment with a private remote repository to host some support libraries. Turns out it was too private. To where mrJar worked only on my machine. I hate when that happens! :disappointed:

But I’ve deleted the private v0.0.14 from Gradle’s plugin repository, and just now replaced it with the fully-working public v0.0.15. Would love to get more feedback from ya, Graou74! TIA :+1:

No problem :slightly_smiling_face:, you have already given me a satisfactory solution and even if it would be very rude on my part to demand anything.

We do the same job (so we are never safe from surprises) and if Gradle contributes to the robustness of a product, we see that little misery of development can still infiltrate.

I commented out all the code for the eclipse task and inserted the “id” com.lingocoder.mrjar “version” 0.0.15 “” line into the plugins task :

plugins {
    // Apply the java-library plugin to add support for Java Library
    id 'java-library'
    id "com.lingocoder.mrjar" version "0.0.15"
}

repositories {
    // Use jcenter for resolving dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

dependencies {
	// https://mvnrepository.com/artifact/org.yaml/snakeyaml
	compile group: 'org.yaml', name: 'snakeyaml', version: '1.25'
	
	testImplementation('org.junit.jupiter:junit-jupiter-api:5.4.2')
    testRuntime('org.junit.jupiter:junit-jupiter-engine:5.4.2')
}

compileJava {
    doFirst {
        options.compilerArgs = [
            '--module-path', classpath.asPath,
        ]
        classpath = files()
    }
}


//apply plugin: 'java'
//apply plugin: 'eclipse'
//
//eclipse {
//    classpath {
//        containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
//        file {
//            whenMerged {
//                entries.findAll { ( it.properties.kind.equals('src') || it.properties.kind.equals('lib') ) && !it.properties.path.contains("junit") }.each {
//                    it.entryAttributes['module'] = 'true'
//                }
//                entries.findAll { it.properties.path.startsWith('org.eclipse.jdt.launching.JRE_CONTAINER') }.each {
//                    it.entryAttributes['module'] = 'true'
//                }
//                entries.find { it.path == 'src/main/java' }.output = 'build/classes/java/main'
//
//                def testSrc = entries.find { it.path == 'src/test/java' }
//                testSrc.output = 'build/classes/java/test'
//                testSrc.entryAttributes['test'] = 'true'
//                testSrc.entryAttributes['optional'] = 'true'
//                testSrc.entryAttributes['ignore_optional_problems'] = 'true'
//
//                entries.forEach { entry ->
//				    def entryIn = { it.find { file(entry.path).equals(it) } }
//				    if (entry.kind == 'lib') {
//					    entry.entryAttributes['test'] =
//						    entryIn(configurations.testRuntimeClasspath) &&
//						    !entryIn(configurations.runtimeClasspath)
//				    }
//                }
//            }
//        }
//    }
//}

In Eclipse, everything works perfectly, unfortunately when I run the command line test I have this error (error that does not exist with the code of the eclipse task):

 ./gradlew test --stacktrace

> Task :compileTestJava FAILED

The org.junit.jupiter.api module will be read

Optional[ExternalParam=org.junit.jupiter.api]
error: module not found: ExternalParam
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileTestJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileTestJava'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:56)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:39)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
        at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
        at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:101)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:97)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:60)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:44)
        at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
        at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler.execute(CompileJavaBuildOperationReportingCompiler.java:51)
        at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:158)
        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:126)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:47)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:476)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:461)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:444)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:93)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:237)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:208)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:69)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:140)
        ... 34 more


* Get more help at https://help.gradle.org

BUILD FAILED in 712ms
3 actionable tasks: 2 executed, 1 up-to-date

I do not understand why it talks about the module “ExternalParam” which has been renamed to “com.ondine.ExternalParam”.

> Task :compileTestJava FAILED

The org.junit.jupiter.api module will be read

Optional[ExternalParam=org.junit.jupiter.api]
error: module not found: ExternalParam
1 error

Here are the occurrences of the word “External Param” in the project:

1 Like

Thanks again @Graou74.

Just a heads up, @Graou74. You don’t need to do that. mrJar is doing that for you already under the hood. That’s sort of the main thing it does as a plugin. Though I don’t think it hurts anything to override what the plugin does. It’s just not strictly necessary.

Ah! You discovered the other thing I was engrossed in working on before I logged into the forum yesterday.

I was in the middle of implementing some new core functionality, then commented out most of it so that I could push the changes for the other fix quicker. In my haste I left that half-way finished code in there.

I will look into what might be causing the renaming you’re describing. If you could share a lightweight facsimile of your project, that would be a great help for troubleshooting.

Funny you should say that. The reason I was so engrossed in the other thing I mentioned, is because Gradle’s „robustness“ was causing me misery :laughing: As marvelous as Gradle’s contributions are to Java development in general, they do throw up some frustrating hurdles for JPMS development — in particular.

A super skim version that reproduces the problem :
ExternalParamLite.zip (90.2 KB)
I deleted the build directory which takes up space and will be rebuilt anyway.

Cool! Thanks @Graou74 :+1:

Sorry I didn’t spot this earlier…

You need to add this…

mrjar{ 
	moduleName = 'com.ondine.ExternalParamLite'
}

That worked when I tried it…


There’s a mrJar usage page that might be useful (I should have read it myself earlier, actually, with my memory :wink:). Some of the more recent changes and added capabilities haven’t been documented there yet. But the most important core parts are still relevant.

Please, don’t hesitate to reach out if anything else breaks for you using mrJar? TIA :+1:

Now everything works perfectly. :ok_hand:
Again thank you Lingocoder for your help.

That’s great, man! As a token of appreciation, I’ll share a little tip with you. Notice in your original error message, that your search found the different occurrences of the word „ExternalParam“? Well if mrJar isn’t given a value for its moduleName property, then it will use this value as a default whenever it needs a moduleName but can’t find an explicitly-defined one…

That means that instead of setting the moduleName property in the mrjar{ } extension block, you could also have changed the name of your project to be the same name as that in your module-info.java descriptor.

In addition to also fixing the error the same as setting an explicit property, that option also makes for three or four fewer lines in your build.gradle.

Exercising mrJar with your project these last couple days, Graou74, has introduced me to some new usage scenarios that had not occurred to me with my automated functional testing. So I am sincerely grateful for your helping me work out some previously-undiscovered kinks in the code. Many thanks to you, man! :+1:

Immediately revealed, immediately adopted.

I did not see it like that. From my point of view, only you helped me.:slight_smile:

Now I can devote myself to a new problem which is how to access with Gradle packages of modules not exported.
I would like to violate JavaFx which lacks openness in places.:smiling_imp:

Hi @Graou74

That sounds like an interesting problem. Please can you share what your solution for that was in the end? TIA :+1:

Hi Lingocoder,

I did not find a solution in JPMS. So I abandoned the idea of ​​developing an application in modules. I do not develop a utility or a library so putting the programming module aside is less serious.
At each step of setting up the architecture are hours of research to make the various development tools work together (Eclipse, Gradle, JavaFx, AspectJ etc) while without JPMS just load an Eclipse plugin and it is set.

I understand the usefulness of a modular development but the extra layer on access to the packages, justified as a reinforcement of object concept, had no other effect than to rot my life.
I have tried, but the time I have devoted to this research is a luxury that I can not afford.

Since I have set aside the JPMS development I can devote my time to development and advance my application.

So to conclude the solution was for me to forget the modular development and load a Gradle plugin for JavaFX.