Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346725 - "Overriding managed version" in pom.xml should not be a warning severity
Summary: "Overriding managed version" in pom.xml should not be a warning severity
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 12:00 EDT by Mark A. Ziesemer CLA
Modified: 2021-04-19 13:27 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark A. Ziesemer CLA 2011-05-20 12:00:25 EDT
I have a parent pom.xml that has dependencies defined under <dependencyManagement>, such that the versions defined are used by default by most child projects.

However, I have some child projects that require an overridden dependency version.

Maven itself doesn't seem to complain about doing this.  However, m2e issues a Warning that appears in the Problems view:

Description: "Overriding manged version x.x.x for <component>"
Resource: "pom.xml"
Type: "Maven pom Loading Problem"

2 options I would propose are to either have this type of warning configurable (short of hiding the "Maven pom Loading Problem" all together, which may hide other desired warnings) - or to switch the "Overriding managed" warning to be of "Info" severity, so that it can still be observed if desired - without contributing warnings to the project.  (I guess I would vote for the later option.)

Thanks!
Comment 1 Mark A. Ziesemer CLA 2011-05-20 12:11:39 EDT
I do see that m2e offers a Quick Fix to "Ignore this warning", which adds "<!--$NO-MVN-MAN-VER$-->" directly after the related <version/> in the pom.xml.  However, I can't find this documented anywhere, and I'm guessing this is also specific to m2e - and not Maven in general?
Comment 2 Milos Kleint CLA 2011-05-20 15:45:20 EDT
yes, the comment it's m2e specific (as is the warning marker itself, maven will not complain but you might get problems down the road when upgrading the given dependency).
Comment 3 Keith Wedinger CLA 2011-06-29 08:08:54 EDT
I have a pom that uses version 1.6 of the antrun plugin.  The relevant section from my pom is below:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
</plugin>

This pom does not have a parent pom.  After updating Eclipse 3.6.2 with m2e 1.0.0, the following warning is now being displayed on the Problems tab:

Overriding managed version 1.3 for maven-antrun-plugin Maven pom Loading Problem

I believe this warning is invalid.
Comment 4 Milos Kleint CLA 2011-06-29 08:11:32 EDT
There are problems with a selection of plugins defined in the super POM apparently, this is tracked separately in issue 350203

(In reply to comment #3)
> I have a pom that uses version 1.6 of the antrun plugin.  The relevant section
> from my pom is below:
> 
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-antrun-plugin</artifactId>
> <version>1.6</version>
> </plugin>
> 
> This pom does not have a parent pom.  After updating Eclipse 3.6.2 with m2e
> 1.0.0, the following warning is now being displayed on the Problems tab:
> 
> Overriding managed version 1.3 for maven-antrun-plugin Maven pom Loading
> Problem
> 
> I believe this warning is invalid.
Comment 5 Igor Fedorenko CLA 2011-08-01 02:50:47 EDT
I assume <!--$NO-MVN-MAN-VER$--> together with fixes for bug 350203 address all concerns. Please reopen if you believe this can be improved further (with specific description of desired behaviour, of course)
Comment 6 Richard Kennard CLA 2012-12-11 21:17:09 EST
I would like to reopen this bug because I "believe this can be improved further" (to quote the above comment!).

In my POMs, I often use <version>${project.version}</version> so that I don't have to repeat my version number everywhere. This warning fails here, presumably because the string '${project.version}' is not equal to the actual version string (say, '2.6-SNAPSHOT').

Could you please either a) try and resolve what ${project.version} is, or b) disable this warning if the value is an expression?

Regards,

Richard.
Comment 7 Igor Fedorenko CLA 2012-12-11 23:03:08 EST
This warning is only created when both <dependency> and matching <dependencyManagement> elements have <version>. I believe this warning is useful in many/most cases, but agree it does not necessary represent a problem. If you feel strongly enough about this warning, please provide a quality patch that will allow configuration of severity of this problem via eclipse preference.
Comment 8 Denis Roy CLA 2021-04-19 13:27:06 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/