[ 
https://issues.apache.org/jira/browse/MNG-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16682455#comment-16682455
 ] 

Falko Modler commented on MNG-6511:
-----------------------------------

Improving help output is a good idea!

{quote}
why do you want these modules to be excluded? Can it be solved with profiles?
{quote}
Me and my developer colleagues have our own scripts to quickly build a 90+ 
modules project. These scripts contain options that _could_ be defined by 
profiles like {{-Dcheckstyle.skip=true}} and {{-Denforcer.skip=true}} but also 
options like {{-T4}} which cannot be defined by profiles.
That project has a couple of modules that you don't want to and also don't need 
rebuild all the time, like a final big assembly of everything. I admit that the 
project structure might not be ideal but with a more flexible {{-pl}}, people 
could just use for (instance) {{-pl ! final-assembly}} in their "quick build" 
script and wouldn't need to worry on which level their are invoking that script.

Excluding modules with profiles is pretty verbose, especially since you cannot 
say in root pom that you want to exclude one or more modules two or more levels 
deeper. You would end up with "module exclusion profiles" scattered all over 
the project and that's not something I want to do.

In the end I am just asking for a litte more flexibility of {{-pl ! ...}}. I 
mean when I say {{-pl ! foo}} I just don't want that module to be built. At 
that point I don't care if it exists or not.

{quote}
However, there's an issue that wants make this more strict, just to ensure you 
haven't made a typo or that you accidentally excluded one. For that reason I 
tend to say -1 for this proposal.
{quote}
For me this is not the same. When you specify a non-existing profile (which 
just issues a warning) you _don't get_ what you wanted (which might be pretty 
bad) but when I _don't want_ something then IMHO it is irrelevant whether this 
is "achieved" by non-existence or due to being disabled/excluded.
Am I making sense?

> Option -pl ! foo should not fail if foo does not exist
> ------------------------------------------------------
>
>                 Key: MNG-6511
>                 URL: https://issues.apache.org/jira/browse/MNG-6511
>             Project: Maven
>          Issue Type: Improvement
>    Affects Versions: 3.3.9, 3.6.0
>            Reporter: Falko Modler
>            Priority: Major
>
> While I completely understand why Maven throws an error when 
> {{\-pl/--projects}} defines/contains a non-existing project, I don't really 
> see why the negation of a non-existing project yields the same error, e.g.:
> {noformat}
> c:\_dev\git\gitflow-incremental-builder>mvn -pl !foo
> [INFO] Scanning for projects...
> [ERROR] [ERROR] Could not find the selected project in the reactor: foo @
> [ERROR] Could not find the selected project in the reactor: foo -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please 
> read the following articles:
> [ERROR] [Help 1] 
> http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException
> {noformat}
> I'd say that at most this should be a warning, not an error.
> This change would come in handy to reuse scripts with certain default options 
> (e.g. quickly build everything without tests, checkstyle, _exclude moduleX_, 
> etc.) on different hierarchy levels of larger multi module project.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to