-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toolchain java path to environment variables in ExecMojo - added …
…tests and various enhancements
- Loading branch information
1 parent
16cd225
commit 491526a
Showing
5 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.codehaus.mojo.exec; | ||
|
||
import org.apache.commons.lang3.NotImplementedException; | ||
import org.apache.maven.toolchain.Toolchain; | ||
|
||
public class DummyToolchain implements Toolchain { | ||
|
||
private final String testJavaPath; | ||
|
||
public DummyToolchain(String testJavaPath) { | ||
this.testJavaPath = testJavaPath; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
throw new NotImplementedException("testToolchain"); | ||
} | ||
|
||
@Override | ||
public String findTool(String s) { | ||
return "java".equals(s) ? testJavaPath : null; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.cb.maven.plugins.exec</groupId> | ||
<artifactId>project20</artifactId> | ||
<version>0.1</version> | ||
<packaging>jar</packaging> | ||
<name>Maven Exec Plugin</name> | ||
<inceptionYear>2005</inceptionYear> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache License 2</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<test.name>${project.artifactId} project</test.name> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<toolchainJavaHomeEnvName>CUSTOM_NAME_FOR_TOOLCHAIN_JAVA</toolchainJavaHomeEnvName> | ||
<executable>${basedir}/src/test/projects/project20/testscript.sh</executable> | ||
</configuration> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo $CUSTOM_NAME_FOR_TOOLCHAIN_JAVA > testfile.txt |