[ 
http://jira.codehaus.org/browse/MEXEC-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=135191#action_135191
 ] 

Jerome Lacoste commented on MEXEC-43:
-------------------------------------

I think there's something missingin your description.

You are not doing 

  mvn compile

then

  mvn -Dexec.mainClass=BMain -Dexec.failIfNoClass=false exec:java -e

because this would fail in B trying to find the A dependency.

You're probably doing

  mvn compile -Dexec.mainClass=BMain -Dexec.failIfNoClass=false exec:java -e

*OR*

you've configured your B POM to run exec:java in a particular phase.


Right  ?



I see 2 problems with your approach:

* if I understood well your requirement, you're trying to do weird things with 
inter-dependent multi modules without installing them in the local repo. I 
would like to understand why you need to do this, because it's use case I've 
never come accross.

* by asking maven to run from the parent-pom, you're obvisouly asking the wrong 
thing. maven is going to try to run the class in all modules which is not what 
you want. This could cause all sort of problems: what about a C module 
depending on B, thus having B in the classpath ?

I've tested your patch and created the attached test project, but I would like 
to be convinced we need to add this to the plugin before going further.

> Patch: failIfNoClass adds the ability to disable failing if no class was 
> found, as well as a better error message
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MEXEC-43
>                 URL: http://jira.codehaus.org/browse/MEXEC-43
>             Project: Maven 2.x Exec Plugin
>          Issue Type: New Feature
>          Components: java
>    Affects Versions: 1.1-beta-1
>            Reporter: Joshua Pollak
>             Fix For: future
>
>         Attachments: failIfNoClass.patch, it001.tar
>
>
> exec:java is pretty much useless to execute main classes in multi-module 
> projects (without first installing) because the exec:java command can't be 
> run from the top level pom because it will fail with class not found, and 
> when run from the correct module it will fail because it can't locate the 
> dependancies.
> This patch adds the ability to disable the 'fail if class not found' behavior 
> via the 'failIfNoClass' property. If set to false the plugin will NOT fail if 
> the Java class specified is not found. This is useful in a multi-module 
> project where you might want to exec a class in one module which won't be 
> found in other modules.
> The default value of failIfNoClass is TRUE, which preserves the current 
> behavior.
> This patch also adds a constructive error in the case where failIfNoClass is 
> true, and no class is found. In the past, just the string "null" was 
> displayed.

-- 
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