-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doing several invocations through exec:java? #388
Comments
.... Oh. Default configuration outside the executions, then a configuration inside each execution to set local parameters? With explicit IDs so they don't collide on the default for that? Maven accepts that without complaining... but I'm still getting output only from the first Copying or moving What's my obvious beginner error?
|
@jkesselm: For me, this works locally. Can you please share a link to a full reproducer, so other people or I can take a closer look? |
You'll see that the xsltc subdirectory has been created, but not target/tmp/site/xalan or target/tmp/site/design. Apparently only the first is running. Platform is Fedora running under WSL. Maven home: /mnt/c/users/keshlam/apache-maven-3.6.3
Java version: 1.8.0_382, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.382.b05-2.fc37.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.90.1-microsoft-standard-wsl2", arch: "amd64", family: "unix" (Yes, I'm deliberately using a downlevel JDK, to ensure backward compatibility. That shouldn't affect this, right?) Let me know if you need other details or experiments performed. Context: What I'm trying to do is move the logic now in stylebook_docgen.sh into the Maven build, so it doesn't have to be done as postprocessing. As written there it does what's expected (though that's outputting directly to target/site rather than to target/site/tmp). But maven is currently giving me only that one execution of stylebook. I must be missing something obvious. Maven reminds me of an analog synth. Lots of patch points and knobs; takes quite a while to learn how the designer intended them to be used, how they can actually be (ab)used, and how they all interact. And sometimes the results are not what I expected. And something else weird is going on. Since adding this, my main compilation has stopped working; I'm no longer getting anything but the target/tmp/site/xsltc output. Lemme try reverting (to the xalan-java-mvn-refactored branch) and adding this again from scratch... |
Checked out the Added the multi-execution I originally quoted to the POM, directly above Ran the maven build, both just as Output of |
I've updated the |
I tried ... with xalan on branch exec-maven-plugin-problem
and I have
|
Sorry, forgot to check that in. (Ant build expanded it from a jarfile at build time; simpler, I think, to just check it in flat.) |
(FWIW, I decompiled stylebook to take a quick look at it. About 2500 lines of code, mostly straightforward. Almost tempted to comment it and re-contribute it to Apache, if real source can't be found. "In my copious spare time.") |
In public static void main(String[] var0) throws IOException {
.....
exit((String)"All done successfully", 0);
}
private static void exit(String var0, int var1) {
log(var0);
System.exit(var1);
} as exec-maven-plugin simply execute code in the same JVM .... in this case build are finished by I have:
|
Ah. So If so, the quick fix would be as discussed in https://www.mojohaus.org/exec-maven-plugin/examples/example-exec-for-java-programs.html to launch each StyleBook in a separate JVM. I'll try that. (The better fix would be to have a version of StyleBook that doesn't gratuitously call Thanks. I generally start by assuming I did something stupid... and arguably I did, just not what I thought I had. |
exactly |
Seems to have done it. Thanks! |
@slawekjaranowski, would you be interested in a PR to address this? I thought about an option for the Right after finishing Before you refuse, because I suggest a deprecated API, please consider that JEP 411 links to JDK-8199704, which is blocking removal of the SM API until a suitable replacement has been introduced to the JVM, i.e. even in the future there will be a means to block WDYT? Feel free to also mention other MojoHaus developers to discuss this. |
@kriegaex sounds reasonable - we can try with such feature, I have no objections for such PR. |
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
@jkesselm, feel free to test your project against my PR. That would spare you the effort to use |
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
Sounds good, will do so. Thanks!
…--
/_ Joe Kesselman (he/him/his)
-/ _) My Alexa skill for New Music/New Sounds fans:
/ https://www.amazon.com/dp/B09WJ3H657/
() Plaintext Ribbon Campaign
/\ Stamp out HTML mail!
________________________________
From: Alexander Kriegisch ***@***.***>
Sent: Thursday, November 9, 2023 1:31:29 AM
To: mojohaus/exec-maven-plugin ***@***.***>
Cc: Joe Kesselman ***@***.***>; Mention ***@***.***>
Subject: Re: [mojohaus/exec-maven-plugin] Doing several invocations through exec:java? (Issue #388)
@jkesselm<https://github.com/jkesselm>, feel free to test your project against my PR. That would spare you the effort to use exec:exec in the future, i.e. as soon as a plugin release containing this change would be available.
—
Reply to this email directly, view it on GitHub<#388 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A7OJ6W5CS627ZBQMZVVCG7TYDR2EDAVCNFSM6AAAAAA7ALR5HCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTGIZTOOJQGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
@slawekjaranowski, do you have any indicator for @jkesselm when a plugin release containing the now merged feature might become available? I actually do not need it myself, but Joseph's use case was so interesting that I decided to implement it for his future use in Xalan-Java, which currently he is so heroically porting from Ant to Maven. |
No rush; the workaround is fine for now. It's more a matter of making things less surprising for the next person with similar needs than anything else, I think.
…--
/_ Joe Kesselman (he/him/his)
-/ _) My Alexa skill for New Music/New Sounds fans:
/ https://www.amazon.com/dp/B09WJ3H657/
() Plaintext Ribbon Campaign
/\ Stamp out HTML mail!
________________________________
From: Slawomir Jaranowski ***@***.***>
Sent: Saturday, November 11, 2023 7:34:03 AM
To: mojohaus/exec-maven-plugin ***@***.***>
Cc: Joe Kesselman ***@***.***>; Mention ***@***.***>
Subject: Re: [mojohaus/exec-maven-plugin] Doing several invocations through exec:java? (Issue #388)
@kriegaex<https://github.com/kriegaex> , @jkesselm<https://github.com/jkesselm> - I will release next version in a few days ... maybe in this weekend.
I always like to check topic like site generation, broken links and other simple issue before release
—
Reply to this email directly, view it on GitHub<#388 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A7OJ6WZMSEC3ZCW6H333DM3YD5WDXAVCNFSM6AAAAAA7ALR5HCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWHAYDKMJZGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I need to call the same Java program with several different sets of parameters.
I can't replicate the whole
<plugin>
block because that's a declaration and must be unique.Maven tells me I can't have multiple
<configuration/>s
. I can have multiple<executions/>
, but your example puts all the<arguments/>
in the<configuration/>
so that doesn't seem to help me.Can't imagine that there isn't a standard way to do this, but I'm not sure what it is. Possible it's a standard Maven idiom that I just haven't learned yet... but even so it might be a good thing to explicitly document.
The text was updated successfully, but these errors were encountered: