Output directory is not included if classpathScope is 'runtime'
---------------------------------------------------------------

                 Key: MEXEC-49
                 URL: http://jira.codehaus.org/browse/MEXEC-49
             Project: Maven 2.x Exec Plugin
          Issue Type: Bug
          Components: java
    Affects Versions: 1.1
         Environment: All
            Reporter: Stefan Wismer
            Priority: Critical


I need to execute a project that has a runtime dependency to a JDBC driver. If 
I take classpathScope 'compile' then the JDBC driver is not found. But if I 
take classpathScope 'runtime' then the main class cannot be found anymore. I 
would expect that 'runtime' means 'everything that you need for running it' 
because maven also includes 'compile'-scoped dependencies when calling 
getRuntimeArtifacts(). Therefore exec-maven-plugin should behave the same and 
include the output directory.

Adding one line in AbstractExecMojo.java (method 
collectProjectArtifactsAndClasspath) would fix it.
...
else if ( "runtime".equals( classpathScope ) )
{
        artifacts.addAll( project.getRuntimeArtifacts() );
        theClasspathFiles.add( new File( 
project.getBuild().getOutputDirectory() ) );   // NEW
}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to