forked from mojohaus/exec-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NullPointerException when using PluginDependencies since version
1.6.0 Fixes mojohaus#76 A regression was introduced with the following change: exec mojo can run executableDependency instead of executable (7684096)
- Loading branch information
1 parent
a4d0207
commit dc9bdc6
Showing
9 changed files
with
241 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.codehaus.mojo.exec.it</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>0.1</version> | ||
</parent> | ||
|
||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>Exec Plugin Example Project 5 Parent</name> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<modules> | ||
<module>project5exec</module> | ||
<module>project5lib</module> | ||
<module>project5libB</module> | ||
</modules> | ||
</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,71 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<parent> | ||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>project5exec</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Exec Plugin Example Project 5 Exec</name> | ||
<url>http://maven.apache.org</url> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<executions> | ||
<execution> | ||
<phase>process-classes</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<systemProperties> | ||
<systemProperty> | ||
<key>propkey</key> | ||
<value>propvalue</value> | ||
</systemProperty> | ||
</systemProperties> | ||
<mainClass> | ||
org.codehaus.mojo.exec.project5libB.App | ||
</mainClass> | ||
<arguments> | ||
<argument>argument1</argument> | ||
<argument>argument2</argument> | ||
</arguments> | ||
<includeProjectDependencies>false</includeProjectDependencies> | ||
<includePluginDependencies>true</includePluginDependencies> | ||
<executableDependency> | ||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5libB</artifactId> | ||
</executableDependency> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5libB</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<!--junit dependency is an intentional extraneous dependency--> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
<version>1.0.4</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<parent> | ||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>project5lib</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Exec Plugin Example Project 5 Lib</name> | ||
<url>http://maven.apache.org</url> | ||
<dependencies> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>1.1</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
14 changes: 14 additions & 0 deletions
14
...project6/project5lib/src/main/java/org/codehaus/mojo/exec/project5lib/ExampleLibrary.java
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,14 @@ | ||
package org.codehaus.mojo.exec.project5lib; | ||
|
||
/** | ||
* Used for manual integrationtest of the java goal. | ||
* | ||
*/ | ||
public class ExampleLibrary | ||
{ | ||
public ExampleLibrary() { | ||
} | ||
public boolean isAGoodDay() { | ||
return true; | ||
} | ||
} |
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,21 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<parent> | ||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>project5libB</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Exec Plugin Example Project 5 Lib B</name> | ||
<url>http://maven.apache.org</url> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.mojo.exec.project5</groupId> | ||
<artifactId>project5lib</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
49 changes: 49 additions & 0 deletions
49
...projects/project6/project5libB/src/main/java/org/codehaus/mojo/exec/project5libB/App.java
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,49 @@ | ||
package org.codehaus.mojo.exec.project5libB; | ||
|
||
/** | ||
* Used for manual integrationtest of the java goal. | ||
* | ||
*/ | ||
public class App | ||
{ | ||
public static void main( String[] args ) | ||
{ | ||
System.out.println("I was started. So obviously I found the main class"); | ||
|
||
App app = new App(); | ||
|
||
try | ||
{ | ||
Class fileUtils = app.getClass().getClassLoader().loadClass( "org.codehaus.mojo.exec.project5lib.ExampleLibrary" ); | ||
if ( null != fileUtils ) | ||
{ | ||
System.out.println( "Found the ExampleLibrary" ); | ||
} | ||
} | ||
|
||
catch ( Exception e ) | ||
{ | ||
System.out.println( "Did not find the ExampleLibrary" ); | ||
} | ||
|
||
try | ||
{ | ||
Class fileUtils = app.getClass().getClassLoader().loadClass( "org.apache.commons.io.FileUtils" ); | ||
if ( null != fileUtils ) | ||
{ | ||
System.out.println( "Found the runtime dependency" ); | ||
} | ||
} | ||
catch ( Exception e ) | ||
{ | ||
System.out.println( "Did not find the runtime dependency" ); | ||
} | ||
|
||
|
||
String value = System.getProperty("propkey"); | ||
if (null != value) | ||
{ | ||
System.out.println("Found the system property passed"); | ||
} | ||
} | ||
} |
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,24 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
File log = new File(basedir, 'build.log') | ||
assert log.exists() | ||
assert log.getText().contains("I was started. So obviously I found the main class") | ||
assert log.getText().contains("Found the ExampleLibrary") | ||
assert log.getText().contains("Found the runtime dependency") | ||
assert log.getText().contains("Found the system property passed") |
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