Hi Karl-Heinz,
Let's make a clear separation between the plugin, the enforcer-api and the
standard rules.
Only the first one can be restricted to a specific Maven version by
specifying the prerequisite for Maven.
Although the standard rules are included by default, there's no real
relationship.
Be aware that you can also write custom rules. If there is no change to
the enforcer-api, it's hard to explain why you must upgrade.
I think it should be the rule itself which should require a specific Maven
version. So it would be nice if we could somehow specify the required
Maven version.
Right now I'm thinking of an Annotation. Maybe you also want to require a
specific Java version...
These are just some ideas, I just think it's too early to require M3, the
other options are extra codebases. Not my favorite.
Robert
Op Tue, 01 Apr 2014 08:09:10 +0200 schreef Karl Heinz Marbaise
<khmarba...@gmx.de>:
Hi Robert,
first of all thanks for your answer....
> For Maven2 all arguments are immediately processed, you can't trace
back
the values of -pl or -amd.
I think you should go for the easy and solid solution by requiring
specific Maven versions.
For instance: In the rule, read the version value of
/META-INF/maven/org.apache.maven/maven-core/pom.properties
I think I've found a simpler (?) solution to check for the Maven version
by using the parts of the rule RequireMavenVersion....so apart from
that....
All information i needed about the "mvn -pl ..." is only available via
classes / interfaces for Maven 3 but at the moment maven-enforcer is
based on Maven 2.0.6 interfaces...which do not contain the methods i
need...like this:
List<String> selectedProjects =
session.getRequest().getSelectedProjects();
(The MavenSession interface only contains getRequest() starting with
Maven 3) which would get the information about "mvn -pl m1,m2 .."...
So may be i oversight things but currently i see only three solutions:
1. Update Maven Enforcer to Maven 3.X only
In my opinion it is to early to go that hard way in particular
to fully drop down Maven 2.X compatibility so early
(may be in the future)
2. Create separate branches:
* 2.X Branch which is Maven 3 only
* 1.X branch which keeps Maven 2.X compatibility...
and drop that later (currently we have 1.3.1 out
as release. So the next could be 1.4 or 1.3.2)
3. Extract the code I have and create a separate Maven Plugin
to fullfil the needs and make that plugin Maven 3. only...
may be for a limited time. But may there are up comming other
rules which are Maven 3 only...This solution would solve
only the single rule.
What do you think?
Kind regards
Karl-Heinz Marbaise
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org