[ https://issues.apache.org/jira/browse/MNG-7228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655727#comment-17655727 ]
Slawomir Jaranowski edited comment on MNG-7228 at 1/7/23 8:29 PM: ------------------------------------------------------------------ Tested with Maven master - fc2d94f0777998000f7b886d45efb88c28fc09cd {{requireNoRepositories}} in {{enforcer}} not working with Maven 4. Confirm that {{mavenProject.getOriginalModel()}} returns already interpolated model. {{OriginalModel}} contains repositories defined in settings.xml not only defined in project, this is a one of reason with break in {{requireNoRepositories}} was (Author: slawekjaranowski): Tested with Maven master - fc2d94f0777998000f7b886d45efb88c28fc09cd {{requireNoRepositories}} in {{enforcer}} not working with Maven 4. Confirm that {{(mavenProject.getOriginalModel()}} returns returns already interpolated model. {{OriginalModel}} contains repositories defined in settings.xml not only defined in project, this is a one of reason with break in {{requireNoRepositories}} > MavenProject.getOriginalModel returns interpolated parts > -------------------------------------------------------- > > Key: MNG-7228 > URL: https://issues.apache.org/jira/browse/MNG-7228 > Project: Maven > Issue Type: Bug > Components: Core > Affects Versions: 3.0-alpha-1, 4.0.0-alpha-3 > Reporter: Karl Heinz Marbaise > Priority: Minor > Fix For: 4.0.0-alpha-4, 4.0.0 > > > I have tested the maven-enforcer-plugin 3.0.0 running in a project where I > use the following configuration: > {code:xml} > <requireNoRepositories> > <message>The rules for repo1.maven.org are that pom.xml > files should not include repository definitions. If > repository definitions are included, they must be limited > to SNAPSHOT only repositories.</message> > <banRepositories>true</banRepositories> > <banPluginRepositories>true</banPluginRepositories> > <allowSnapshotRepositories>true</allowSnapshotRepositories> > </requireNoRepositories> > <requirePluginVersions> > {code} > The project works correct with Maven 3.X but fails with Maven 4.X (current > state of master 92d2c2e3b43ca214989f0f517aa90f1525f0ff2e). > After some investigation it looks like that the > {{mavenProject.getOriginalModel()}} returns already interpolated model and > **NOT** the original model. -- This message was sent by Atlassian Jira (v8.20.10#820010)