I set maven-surefire-plugin version in pluginManagement.
Then I have a profile (on by default) that brings in another
pluginManagement element. If I don't want to use the stateless reporter I
can turn this profile off:
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.children="append">
<statelessTestsetInfoReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporterUnicode"/>
</configuration>
<dependencies>
<dependency>
<groupId>me.fabriciorby</groupId>
<artifactId>maven-surefire-junit5-tree-reporter</artifactId>
<version>${dep.maven-surefire-junit5-tree-reporter}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
I'm guessing that
With 4.0.0-alpha-4 enforcer evaluates the version number after combining
all pluginManagement sections.
With 4.0.0-alpha-5 enforcer evaluates each pluginManagement section
independently.
I would like to only set the version number once. Is this an issue for
enforcer-plugin/rules?
On Wed, 15 Mar 2023 at 20:25, Guillaume Nodet <[email protected]> wrote:
> Do you have a small project to reproduce the problem ?
> The violation looks legit if you haven't specified a version for the
> surefire plugin.
>
> Le mer. 15 mars 2023 à 19:21, Delany <[email protected]> a écrit
> :
>
> > Build fails
> >
> > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
> > goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (fail)
> on
> > project t1000:
> > Rule 0: org.apache.maven.enforcer.rules.RequirePluginVersions failed with
> > message:
> > Some plugins are missing valid versions or depend on Maven 4.0.0-alpha-5
> > defaults (LATEST, RELEASE as plugin version are not allowed)
> > org.apache.maven.plugins:maven-surefire-plugin. The version
> > currently in use is 3.0.0 via super POM or default lifecycle bindings
> >
> > I don't get this with 4.0.0-alpha-4
> >
> >
> > On Wed, 15 Mar 2023 at 19:14, Guillaume Nodet <[email protected]> wrote:
> >
> > > Hey
> > >
> > > We solved 26 issues:
> > >
> > >
> > >
> >
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12352862&projectId=12316922
> > >
> > > Staging repository:
> > > https://repository.apache.org/content/repositories/maven-1890
> > >
> > > Dev dist directory:
> > > https://dist.apache.org/repos/dist/dev/maven/maven-4/4.0.0-alpha-5/
> > >
> > > Staged site:
> > > https://maven.apache.org/ref/4-LATEST/
> > >
> > > Guide to testing staged releases:
> > > http://maven.apache.org/guides/development/guide-testing-releases.html
> > >
> > > Please review and vote !
> > >
> > > Cheers,
> > > Guillaume Nodet
> > >
> >
>
>
> --
> ------------------------
> Guillaume Nodet
>