Created
June 18, 2012 21:26
-
-
Save mkscrg/2950830 to your computer and use it in GitHub Desktop.
A simple multi-module Maven project with which exec-maven-plugin is unusable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.idea/ | |
*.iml | |
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class HelloPrinter { | |
void printHello() { | |
System.out.println("Hello world!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class MyMain { | |
public static void main(String[] args) { | |
new HelloPrinter().printHello(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<artifactId>exec-multi-module-test</artifactId> | |
<groupId>com.mkscrg.sandbox</groupId> | |
<version>1.0</version> | |
</parent> | |
<artifactId>module1</artifactId> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<artifactId>exec-multi-module-test</artifactId> | |
<groupId>com.mkscrg.sandbox</groupId> | |
<version>1.0</version> | |
</parent> | |
<artifactId>module2</artifactId> | |
<dependencies> | |
<dependency> | |
<groupId>com.mkscrg.sandbox</groupId> | |
<artifactId>module1</artifactId> | |
<version>${project.version}</version> | |
</dependency> | |
</dependencies> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mkscrg.sandbox</groupId> | |
<artifactId>exec-multi-module-test</artifactId> | |
<version>1.0</version> | |
<packaging>pom</packaging> | |
<modules> | |
<module>module1</module> | |
<module>module2</module> | |
</modules> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<version>1.2.1</version> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# StackOverflow question: http://stackoverflow.com/questions/11091311/maven-execjava-goal-on-a-multi-module-project | |
mvn exec:java -Dexec.mainClass=myMain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment