Skip to content
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

adds 'anyjava' goal (requiresProject = false) #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tbrugz
Copy link

@tbrugz tbrugz commented Dec 4, 2020

Issue #187

This PR adds a new goal (exec:anyjava - class ExecAnyJavaMojo) that extends ExecJavaMojo. It basically adds the capability of resolving artifacts, as in dependency:get (grabbing much code from there). The basic mechanism would be to call the goal exec:anyjava from any directory, informing required artifacts (artifacts parameter) and mainclass (exec.mainClass parameter) from the command line.

Example (running sqlline with h2 driver on classpath):

mvn org.codehaus.mojo:exec-maven-plugin:3.0.1-SNAPSHOT:anyjava -Dartifacts=sqlline:sqlline:1.9.0,com.h2database:h2:1.4.200 -Dexec.mainClass=sqlline.SqlLine

Another option would be to change the ExecJavaMojo itself. If this seems preferable I can create a new PR.

PS: I created the NopTransformableFilter class because without it there would be an "IllegalArgumentException: The parameter filter is not allowed to be null" at org.apache.maven.shared.transfer.dependencies.resolve.internal.DefaultDependencyResolver.validateParameters, which does not seems to occur on GetMojo (I don't know why).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant