You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julian Reschke <ju...@gmx.de> on 2019/06/24 10:23:25 UTC

Problem with use of enforcer-plugin after upgrading the Apache parent POM (18->21)

Hi there,

I've found a strange issue (well, strange to me) when I tried to upgrade
Oak's parent POM from 18 to 21 (details at
<https://issues.apache.org/jira/browse/OAK-8255>).

The actual change that triggers the issue for us was between version 18
and 19, which introduces the use of the enforcer plugin to check the
Maven version
(<https://github.com/apache/maven-apache-parent/commit/35c824cfef4d8ae3ec7234365635e43f57b8e05a#diff-600376dffeb79835ede4a0b285078036>,
<https://issues.apache.org/jira/browse/MPOM-164>).

In Oak, we use the enforcer plugin to check the size of a generated JAR
file. After updating the parent POM, this check fails (or does not
happen?) - if and only if when done using "release:prepare".

To reproduce:

- clone https://github.com/apache/jackrabbit-oak
- update oak-parent/pom.xml to use version 21 instead of 18 of parent pom
- run mvn:release-prepare -DdryRun=true -Darguments="-DskipTests"

<https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/pom.xml#L157>
is the place in oak-run's POM where we use the enforcer plugin.

Are we doing something stupid here that conflicts with the use of the
enforcer plugin in the Apache parent POM?

Best regards, Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with use of enforcer-plugin after upgrading the Apache parent POM (18->21)

Posted by Julian Reschke <ju...@gmx.de>.
On 24.06.2019 14:49, Thomas Broyer wrote:
> One of the POMs might need to use `combine.children="append"` on the
> <rules> element: https://maven.apache.org/pom.html#Plugins
> No idea why that would only manifest during releases thoguh… have you
> compared "mvn help:effective-pom" vs "mvn help:effective-pom
> -Papache-release,release"?

I don't see any differences with respect to the enforcer, but show:


>       <plugin>
>         <artifactId>maven-enforcer-plugin</artifactId>
>         <version>3.0.0-M2</version>
>         <executions>
>           <execution>
>             <id>enforce-maven-version</id>
>             <goals>
>               <goal>enforce</goal>
>             </goals>
>             <configuration>
>               <rules>
>                 <requireMavenVersion>
>                   <version>3.0.5</version>
>                 </requireMavenVersion>
>               </rules>
>             </configuration>
>           </execution>
>           <execution>
>             <id>enforce-file-size</id>
>             <phase>package</phase>
>             <goals>
>               <goal>enforce</goal>
>             </goals>
>             <configuration>
>               <rules>
>                 <requireFilesSize>
>                   <maxsize>51000000</maxsize>
>                   <files>
>                     <file>C:\tmp\jackrabbit-oak\oak-run\target/oak-run-1.16-SNAPSHOT.jar</file>
>                   </files>
>                 </requireFilesSize>
>               </rules>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>

Best regards, Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with use of enforcer-plugin after upgrading the Apache parent POM (18->21)

Posted by Thomas Broyer <t....@gmail.com>.
One of the POMs might need to use `combine.children="append"` on the
<rules> element: https://maven.apache.org/pom.html#Plugins
No idea why that would only manifest during releases thoguh… have you
compared "mvn help:effective-pom" vs "mvn help:effective-pom
-Papache-release,release"?

On Mon, Jun 24, 2019 at 12:23 PM Julian Reschke <ju...@gmx.de>
wrote:

> Hi there,
>
> I've found a strange issue (well, strange to me) when I tried to upgrade
> Oak's parent POM from 18 to 21 (details at
> <https://issues.apache.org/jira/browse/OAK-8255>).
>
> The actual change that triggers the issue for us was between version 18
> and 19, which introduces the use of the enforcer plugin to check the
> Maven version
> (<
> https://github.com/apache/maven-apache-parent/commit/35c824cfef4d8ae3ec7234365635e43f57b8e05a#diff-600376dffeb79835ede4a0b285078036
> >,
> <https://issues.apache.org/jira/browse/MPOM-164>).
>
> In Oak, we use the enforcer plugin to check the size of a generated JAR
> file. After updating the parent POM, this check fails (or does not
> happen?) - if and only if when done using "release:prepare".
>
> To reproduce:
>
> - clone https://github.com/apache/jackrabbit-oak
> - update oak-parent/pom.xml to use version 21 instead of 18 of parent pom
> - run mvn:release-prepare -DdryRun=true -Darguments="-DskipTests"
>
> <https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/pom.xml#L157>
> is the place in oak-run's POM where we use the enforcer plugin.
>
> Are we doing something stupid here that conflicts with the use of the
> enforcer plugin in the Apache parent POM?
>
> Best regards, Julian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>