You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kohsuke Kawaguchi (JIRA)" <ji...@codehaus.org> on 2008/07/01 01:39:27 UTC

[jira] Created: (MNG-3641) Lack of error checks on profiles

Lack of error checks on profiles
--------------------------------

                 Key: MNG-3641
                 URL: http://jira.codehaus.org/browse/MNG-3641
             Project: Maven 2
          Issue Type: Bug
          Components: Profiles
    Affects Versions: 2.0.9
            Reporter: Kohsuke Kawaguchi


DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.

Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Updated: (MNG-3641) Lack of error checks on profiles

Posted by "Torben S. Giesselmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torben S. Giesselmann updated MNG-3641:
---------------------------------------

    Attachment: MNG-3641-maven-project.patch

This patch will have Maven print a warning if a profile which should have been explicitely activated has in fact not been activated.

It's just a warning message, therefore I didn't write a test case. But just out of curiosity: how _would_ I test whether a warning with a specific message was logged or not? Is there a pattern for that?

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>             Fix For: 2.0.11
>
>         Attachments: MNG-3641-maven-project.patch
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Updated: (MNG-3641) Lack of error checks on profiles

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3641:
-----------------------------------

    Attachment: mng-3641.zip

This might need some more love: The current approach produces a lot of warnings during a multi-module buid, namely one per each module that does not contain a profile. See the attached demo project (run "mvn validate -P test") or one of the core bootstrap jobs on Hudson that run with the profile "run-its" which is only present in one of the modules, leaving about fifty warnings about profile activation around.

While I don't have objections to a warning per module, their placement is the log output appears suboptimal. Right now, the warnings appear right at the start, even before the reactor build order, so outside of any context that might be helpful for a user to associate the warning with the module that caused it. Also, given the verbosity of Maven's log, the warnings are easily overlooked when printed first instead of say at the end of a module build.

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch, mng-3641.zip
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Commented: (MNG-3641) Lack of error checks on profiles

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=167127#action_167127 ] 

Brett Porter commented on MNG-3641:
-----------------------------------

applied - great patch, thanks!

Two things to watch out for:
- if your IT runs multiple times on a project, set different log filenames for debugging purposes (I added this)
- watch the code formatting (tabs, specifically :)


> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Updated: (MNG-3641) Lack of error checks on profiles

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MNG-3641:
-----------------------------------

    Fix Version/s: 3.0-alpha-3

Ported to 3.x in [r787045|http://svn.apache.org/viewvc?view=rev&revision=787045].

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0, 3.0-alpha-3
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch, mng-3641.zip
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Closed: (MNG-3641) Lack of error checks on profiles

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed MNG-3641.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Closed: (MNG-3641) Lack of error checks on profiles

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed MNG-3641.
-----------------------------

    Resolution: Fixed

moved to the reactor so it only checks once for all the projects being built.

The warning is still "inconspicuous", but I can't really see a better place to put it. This is a more general Maven problem :)

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch, mng-3641.zip
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Commented: (MNG-3641) Lack of error checks on profiles

Posted by "Ian Springer (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=213203#action_213203 ] 

Ian Springer commented on MNG-3641:
-----------------------------------

The current warning message is:

"Profile with id: '" + explicitProfileId + "' has not been activated."

I think this message is misleading, because the profile actually is activated - it's just not used at all in the pom being processed. I suggest changing the message to something like:

"Profile with id '" + explicitProfileId + "' is activated, but this pom does not contain any usages of the profile."

Also, I don't think it makes sense to print this warning at all in a multi-module build. In the large multi-module project I work on, we have a number of profiles that are only used in a handful of the 50 or so modules.


> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0, 3.0-alpha-3
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch, mng-3641.zip
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Updated: (MNG-3641) Lack of error checks on profiles

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-3641:
------------------------------

    Patch Submitted: [Yes]

you can do it in an integration test by checking the log output

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>             Fix For: 2.0.11
>
>         Attachments: MNG-3641-maven-project.patch
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Updated: (MNG-3641) Lack of error checks on profiles

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Casey updated MNG-3641:
----------------------------

    Fix Version/s: 2.0.11

given the fact that we can trigger settings profiles at the CLI, we can't make these cases fail the build I don't think...but we could provide a prominent warning.

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>             Fix For: 2.0.11
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Commented: (MNG-3641) Lack of error checks on profiles

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=213265#action_213265 ] 

Brett Porter commented on MNG-3641:
-----------------------------------

Ian, please open a new issue for suggested changes. Closed issues don't get any attention.

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0, 3.0-alpha-3
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch, mng-3641.zip
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Reopened: (MNG-3641) Lack of error checks on profiles

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter reopened MNG-3641:
-------------------------------


> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>            Assignee: Brett Porter
>             Fix For: 2.0.11, 2.1.0
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch, mng-3641.zip
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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

        

[jira] Updated: (MNG-3641) Lack of error checks on profiles

Posted by "Torben S. Giesselmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torben S. Giesselmann updated MNG-3641:
---------------------------------------

    Attachment: MNG-3641-IT.tar.gz

... and here's the IT. Yay! ;-)

> Lack of error checks on profiles
> --------------------------------
>
>                 Key: MNG-3641
>                 URL: http://jira.codehaus.org/browse/MNG-3641
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Profiles
>    Affects Versions: 2.0.9
>            Reporter: Kohsuke Kawaguchi
>             Fix For: 2.0.11
>
>         Attachments: MNG-3641-IT.tar.gz, MNG-3641-maven-project.patch
>
>
> DefaultProfileManager performs no error checks on the profile IDs So If I specify bogus profile IDs from plugins (like {{mvn -P no-such-profile}}), Maven doesn't complain, and it just runs as if nothing was specified. This is very error prone.
> Also, I've seen some documentation that says deactivating a profile is "-P !profile". As far as I can tell from the code, this is wrong, but because of the lack of error check, such usage just gets ignored, and the user is left confused as to why the profile isn't deactivated.

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