-
Notifications
You must be signed in to change notification settings - Fork 203
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
Missing argument for option -D #662
Comments
Same here, but I'm glad there is already an open issue for that with a "fix" too :) |
True with |
And the |
Yes true it works without space with |
use mvn command, I never used the form with space actually too. but I use org.apache.maven.shared:maven-invoker:3.2.0 invoke maven/mvnd like this: public class InvokerListClass {
public static void main(String[] args) throws MavenInvocationException {
Invoker invoker = new DefaultInvoker();
invoker.setMavenHome(new File("/Users/xxx/maven-mvnd-0.8.0-darwin-amd64"));
invoker.setMavenExecutable(new File("mvnd"));
final InvocationRequest invocationRequest = new DefaultInvocationRequest();
Properties properties = new Properties();
properties.setProperty("artifact", "com.h2database:h2:1.4.200");
invocationRequest.setProperties(properties);
invocationRequest.setGoals(Collections.singletonList("org.apache.maven.plugins:maven-dependency-plugin:3.2.0:list-classes"));
invoker.execute(invocationRequest);
}
} |
$mvn -D aaa=aaa -version
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /usr/local/Cellar/maven/3.8.6/libexec
Java version: 1.8.0_312, vendor: Amazon.com Inc., runtime: /Users/user/Library/Java/JavaVirtualMachines/corretto-1.8.0_312/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "12.4", arch: "x86_64", family: "mac"
$mvnd -D aaa=aaa -version
Exception in thread "main" java.lang.IllegalArgumentException: Missing argument for option -D
at org.mvndaemon.mvnd.client.DefaultClient.setSystemPropertiesFromCommandLine(DefaultClient.java:146)
at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:106)
The text was updated successfully, but these errors were encountered: