maven-exec-plugin

Maven Exec Plugin with Preview Features

蓝咒 提交于 2020-06-13 07:57:18
问题 It's easy to compile your Java sources with --enable-preview : <!-- Enable preview features --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <release>15</release> <compilerArgs>--enable-preview</compilerArgs> </configuration> </plugin> But how can you then run exec:java ? Using <!-- Exec plugin.. run with `mvn exec:java` --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven

Maven Exec Plugin with Preview Features

故事扮演 提交于 2020-06-13 07:57:14
问题 It's easy to compile your Java sources with --enable-preview : <!-- Enable preview features --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <release>15</release> <compilerArgs>--enable-preview</compilerArgs> </configuration> </plugin> But how can you then run exec:java ? Using <!-- Exec plugin.. run with `mvn exec:java` --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven

couldn't execute maven multi module project using exec-maven-plugin

六眼飞鱼酱① 提交于 2019-12-11 20:39:45
问题 I've a multi module maven project here . The parent project has 3 modules common, with-paranamer, without-paranamer. The with-paranamer and without-paranamer modules are independent of each other and both are depend on common module. In without-paranamer module I have added dependency to common module like this. Below is the structure of the project. . ├── pom.xml ├── common │ ├── pom.xml │ ├─ src │ ├── main │ ├─ java │ ├── ParanamerUtil.java │ ├── PersonV03.java │ └── TestCaseClasses.java │

mvn exec:java to run a java file in an external JAR file

℡╲_俬逩灬. 提交于 2019-12-07 12:11:08
问题 In the pom.xml there is a usage of maven-dependency-plugin to download a specific external JAR file to a separate location (in /tmp/externalTestJars/testjar.jar). And I want to use exec-maven-plugin to run a java class in the testjar.jar file (Main.java). I found this SO question asking kinda same question but the answer for that question did not help me. If I directly run the Main.java file (in the original project where the .jar got created, using mvn exec:java ) I can use the below pom

mvn exec:java to run a java file in an external JAR file

守給你的承諾、 提交于 2019-12-06 04:05:39
In the pom.xml there is a usage of maven-dependency-plugin to download a specific external JAR file to a separate location (in /tmp/externalTestJars/testjar.jar). And I want to use exec-maven-plugin to run a java class in the testjar.jar file (Main.java). I found this SO question asking kinda same question but the answer for that question did not help me. If I directly run the Main.java file (in the original project where the .jar got created, using mvn exec:java ) I can use the below pom configuration. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId>

run main class of Maven project [duplicate]

非 Y 不嫁゛ 提交于 2019-11-26 18:03:41
This question already has an answer here: Maven Run Project 6 answers I've created a simple console Java application that is built with Maven. Is there a way that the main class (which doesn't require any arguments) can be run from the command-line using a maven command like: mvn run-app com.example.MainClass Matthew Farwell Try the maven-exec-plugin . From there: mvn exec:java -Dexec.mainClass="com.example.Main" This will run your class in the JVM. You can use -Dexec.args="arg0 arg1" to pass arguments. If you're on Windows, apply quotes for exec.mainClass and exec.args : mvn exec:java -D"exec

run main class of Maven project [duplicate]

穿精又带淫゛_ 提交于 2019-11-26 08:54:02
问题 This question already has an answer here: Maven Run Project 6 answers I\'ve created a simple console Java application that is built with Maven. Is there a way that the main class (which doesn\'t require any arguments) can be run from the command-line using a maven command like: mvn run-app com.example.MainClass 回答1: Try the maven-exec-plugin. From there: mvn exec:java -Dexec.mainClass="com.example.Main" This will run your class in the JVM. You can use -Dexec.args="arg0 arg1" to pass arguments