jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-4583

warning printed when a pom does not use an activated profile is poorly worded and also should not be printed for multi-module builds

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not A Bug
  • Affects Version/s: 2.0.11, 2.2.1, 3.0-alpha-6
  • Fix Version/s: 3.0-alpha-6
  • Component/s: Profiles
  • Labels:
    None
  • Complexity:
    Intermediate

Description

This is a followup to http://jira.codehaus.org/browse/MNG-3641. Refer to that issue for the background.

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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    MNG-4583.zip
    10/Mar/10 9:41 AM
    3 kB
    Benjamin Bentmann
    1. Text File
      MNG-4583/build.log 2 kB
    2. XML File
      MNG-4583/mod-a/pom.xml 1 kB
    3. XML File
      MNG-4583/mod-b/pom.xml 1 kB
    4. XML File
      MNG-4583/pom.xml 1 kB
    Download Zip
    Show
    Zip Archive
    MNG-4583.zip
    10/Mar/10 9:41 AM
    3 kB
    Benjamin Bentmann

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MNG-3641 Lack of error checks on profiles

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Benjamin Bentmann added a comment - 10/Mar/10 8:05 AM

The output from Maven 3.0-alpha-6 has already been clarified:

[WARNING] The requested profile "foo" could not be activated because it does not exist.

I think this message is misleading, because the profile actually is activated

Something that doesn't exist can hardly be activated so I disagree with your argument here.

Also, I don't think it makes sense to print this warning at all in a multi-module build.

The original request for this warning was to capture typos and this holds for any build. At least Maven 3 outputs this warning at most once so it doesn't matter how many modules your project has.

Show
Benjamin Bentmann added a comment - 10/Mar/10 8:05 AM The output from Maven 3.0-alpha-6 has already been clarified:
[WARNING] The requested profile "foo" could not be activated because it does not exist.
I think this message is misleading, because the profile actually is activated
Something that doesn't exist can hardly be activated so I disagree with your argument here.
Also, I don't think it makes sense to print this warning at all in a multi-module build.
The original request for this warning was to capture typos and this holds for any build. At least Maven 3 outputs this warning at most once so it doesn't matter how many modules your project has.
Hide
Permalink
Wendy Smoak added a comment - 10/Mar/10 8:06 AM

How about 'Profile with id [X] is activated, but not defined' or '...does not exist' ?

I agree that the message is confusing, there's an irc conversation somewhere in the logs when I first encountered it...

Show
Wendy Smoak added a comment - 10/Mar/10 8:06 AM How about 'Profile with id [X] is activated, but not defined' or '...does not exist' ? I agree that the message is confusing, there's an irc conversation somewhere in the logs when I first encountered it...
Hide
Permalink
Ian Springer added a comment - 10/Mar/10 8:27 AM

> [WARNING] The requested profile "foo" could not be activated because it does not exist.

I don't agree that this is clarified.

Based on my understanding on Maven terminology, "foo" is activated in the reactor. It's just not referenced in the pom currently being processed, which is the point of this warning. When building a single module, there's a good chance this is a mistake/typo in the user's settings.xml or mvn command line. For a multi-module build, it is common to activate a profile "foo" that may only be referenced in some of the modules in the reactor, so in that case, I don't think the warning should be printed at all, or maybe it should be printed as an INFO or DEBUG message, rather than a WARN.

Show
Ian Springer added a comment - 10/Mar/10 8:27 AM > [WARNING] The requested profile "foo" could not be activated because it does not exist. I don't agree that this is clarified. Based on my understanding on Maven terminology, "foo" is activated in the reactor. It's just not referenced in the pom currently being processed, which is the point of this warning. When building a single module, there's a good chance this is a mistake/typo in the user's settings.xml or mvn command line. For a multi-module build, it is common to activate a profile "foo" that may only be referenced in some of the modules in the reactor, so in that case, I don't think the warning should be printed at all, or maybe it should be printed as an INFO or DEBUG message, rather than a WARN.
Hide
Permalink
Benjamin Bentmann added a comment - 10/Mar/10 9:41 AM

For a multi-module build, it is common to activate a profile "foo" that may only be referenced in some of the modules in the reactor, so in that case, I don't think the warning should be printed at all

And that's what Maven does. The attached example has two modules mod-a and mod-b, each with an equally named profile. Running "mvn validate -P mod-a" from the parent doesn't produce any warnings.

Show
Benjamin Bentmann added a comment - 10/Mar/10 9:41 AM
For a multi-module build, it is common to activate a profile "foo" that may only be referenced in some of the modules in the reactor, so in that case, I don't think the warning should be printed at all
And that's what Maven does. The attached example has two modules mod-a and mod-b, each with an equally named profile. Running "mvn validate -P mod-a" from the parent doesn't produce any warnings.
Hide
Permalink
Ian Springer added a comment - 10/Mar/10 9:47 AM

Great, it's good to hear that's already been addressed.

Would you please reopen this issue, so the misleading warning message can be addressed for single-module builds?

Show
Ian Springer added a comment - 10/Mar/10 9:47 AM Great, it's good to hear that's already been addressed. Would you please reopen this issue, so the misleading warning message can be addressed for single-module builds?
Hide
Permalink
Benjamin Bentmann added a comment - 10/Mar/10 10:16 AM - edited

Would you please reopen this issue, so the misleading warning message can be addressed for single-module builds?

No, I checked with some other Maven developers and we agreed that the warning as produced in Maven 3 is fine. As I tried to explain before, a command line like "mvn ... -P foo" does not mean the profile "foo" gets actually activated. You as a user can only request to activate a profile, the actual activation happens inside Maven by injecting the profile into the effective model and only if such a profile exists. You can request to activate something that doesn't exist but I don't agree that stating a non-existing profile has been activated is an improvement to the warning message.

Great, it's good to hear that's already been addressed.

Using the attached example project, I didn't observe any Maven version to output the warning more than once during a multi-module build.

Show
Benjamin Bentmann added a comment - 10/Mar/10 10:16 AM - edited
Would you please reopen this issue, so the misleading warning message can be addressed for single-module builds?
No, I checked with some other Maven developers and we agreed that the warning as produced in Maven 3 is fine. As I tried to explain before, a command line like "mvn ... -P foo" does not mean the profile "foo" gets actually activated. You as a user can only request to activate a profile, the actual activation happens inside Maven by injecting the profile into the effective model and only if such a profile exists. You can request to activate something that doesn't exist but I don't agree that stating a non-existing profile has been activated is an improvement to the warning message.
Great, it's good to hear that's already been addressed.
Using the attached example project, I didn't observe any Maven version to output the warning more than once during a multi-module build.
Hide
Permalink
Ian Springer added a comment - 10/Mar/10 10:52 AM

Interesting. That's not how activation is described in the docs (http://maven.apache.org/guides/introduction/introduction-to-profiles.html). Hopefully, the docs will be updated for 3.0. Otherwise, the warning message will continue to be confusing/misleading for users, as it has been for me.

Show
Ian Springer added a comment - 10/Mar/10 10:52 AM Interesting. That's not how activation is described in the docs (http://maven.apache.org/guides/introduction/introduction-to-profiles.html). Hopefully, the docs will be updated for 3.0. Otherwise, the warning message will continue to be confusing/misleading for users, as it has been for me.
Hide
Permalink
Stevo Slavic added a comment - 04/Mar/11 4:50 AM

Are there any means to configure Maven not to print this warning? In my case a multi-module project uses activated profile only in a single module. If this is not supported, maybe support could be added, e.g. to allow one to specify profile names for which this warning should not be printed.

Show
Stevo Slavic added a comment - 04/Mar/11 4:50 AM Are there any means to configure Maven not to print this warning? In my case a multi-module project uses activated profile only in a single module. If this is not supported, maybe support could be added, e.g. to allow one to specify profile names for which this warning should not be printed.
Hide
Permalink
Benjamin Bentmann added a comment - 04/Mar/11 5:10 AM

The warning is supposed to only show up when not a single project within the reactor was affected by the profile. So consider to provide an example project to prove otherwise.

Show
Benjamin Bentmann added a comment - 04/Mar/11 5:10 AM The warning is supposed to only show up when not a single project within the reactor was affected by the profile. So consider to provide an example project to prove otherwise.
Hide
Permalink
Stevo Slavic added a comment - 04/Mar/11 5:32 AM

It seems this is m2eclipse issue - checked, it doesn't get printed in CLI, only in eclipse for incremental builds.

Show
Stevo Slavic added a comment - 04/Mar/11 5:32 AM It seems this is m2eclipse issue - checked, it doesn't get printed in CLI, only in eclipse for incremental builds.

People

  • Assignee:
    Benjamin Bentmann
    Reporter:
    Ian Springer
Vote (0)
Watch (2)

Dates

  • Created:
    10/Mar/10 7:55 AM
    Updated:
    04/Mar/11 5:32 AM
    Resolved:
    10/Mar/10 10:16 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.