Skip to content
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

includeProjectDependencies is false by default #138

Open
marcelstoer opened this issue Jun 26, 2019 · 2 comments
Open

includeProjectDependencies is false by default #138

marcelstoer opened this issue Jun 26, 2019 · 2 comments

Comments

@marcelstoer
Copy link

I was getting java.lang.ClassNotFoundException for a class in the same Maven project as the plugin is running against. This despite the fact that the class was available in target/classes.

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <executions>
        <execution>
            <phase>prepare-package</phase>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>mypackage.MyClass</mainClass>
    </configuration>
</plugin>

This failed until I added <includeProjectDependencies>true</includeProjectDependencies>.

This shouldn't be necessary as https://github.com/mojohaus/exec-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java#L105 says that it's true by default and so does the generated documentation at https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#includeProjectDependencies.

$ mvn --version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00)
Maven home: /Applications/ApacheGroup/Maven-3.6.1
Java version: 1.8.0_202, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre
Default locale: en_CH, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.5", arch: "x86_64", family: "mac"
@cstroe
Copy link

cstroe commented Sep 5, 2019

In the latest released version (1.6.0), the default value for includeProjectDependencies is true:

https://github.com/mojohaus/exec-maven-plugin/blob/exec-maven-plugin-1.6.0/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java#L139

@marcelstoer
Copy link
Author

That's the same piece of code I referenced (you from 1.6, I from master). My point is that it behaves like it is false despite what it says in that annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants