cloud-opensource-java icon indicating copy to clipboard operation
cloud-opensource-java copied to clipboard

Error - A required class was missing org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule

Open mathewm3 opened this issue 11 months ago • 1 comments

Getting following error while running mvn verify

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-linkage-checker) on project matt: Execution enforce-linkage-checker of goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce failed: A required class was missing while executing org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce: org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule

Plugin details added in pom.xml

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>3.5.0</version>
    <executions>
        <execution>
            <id>enforce-linkage-checker</id>
            <!-- Important! Should run after compile -->
            <phase>verify</phase>
            <goals>
                <goal>enforce</goal>
            </goals>
            <configuration>
                <rules>
                    <LinkageCheckerRule
                            implementation="com.google.cloud.tools.dependencies.enforcer.LinkageCheckerRule"/>
                </rules>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>1.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.cloud.tools</groupId>
            <artifactId>linkage-checker-enforcer-rules</artifactId>
            <version>1.5.13</version>
        </dependency>
    </dependencies>
</plugin>

Details included as provided in https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/Linkage-Checker-Enforcer-Rule

mathewm3 avatar Jan 27 '25 15:01 mathewm3