Recently reformed automation engineering, want to introduce foreign automation framework: SELENIDE. Packet conflicts continue to be reported after an imported JAR is found. One of Maven’s conflict-detection plugins threw an exception

. < groupId > org, apache maven plugins < / groupId > < artifactId > maven - enforcer - plugin < / artifactId > < version > 1.4.1 < / version >

Specific errors are as follows:

NFO] Adding ignore: com.sun.jna.*
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.BanDuplicateClasses failed with message:
Duplicate classes found:

Found in:
org.seleniumhq.selenium:selenium-ie-driver:jar:3.141.59:test
org.seleniumhq.selenium:selenium-edge-driver:jar:3.141.59:test
org.seleniumhq.selenium:selenium-chrome-driver:jar:3.141.59:test
org.seleniumhq.selenium:selenium-opera-driver:jar:3.141.59:test
org.seleniumhq.selenium:selenium-remote-driver:jar:3.141.59:test
org.seleniumhq.selenium:selenium-api:jar:3.141.59:test
org.seleniumhq.selenium:selenium-firefox-driver:jar:3.141.59:test
org.seleniumhq.selenium:selenium-safari-driver:jar:3.141.59:test
Duplicate classes:
META-INF/versions/9/module-info.class

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.097 s
[INFO] Finished at: 2021-05-08T18:37:03+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project Cross_border_WebTest: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project Cross_border_WebTest: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
at java.lang.reflect.Method.invoke (Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:237)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
at java.lang.reflect.Method.invoke (Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Well, look at this plugin and there is no way to eliminate it. Search for a long time, tried all kinds of different methods. Such as:

<configuration> <! --<failFast>true</failFast>--> <rules> < requireJavb4 <version>1.6.0</version> </ requireJavb7 <banDuplicateClasses> <ignoreClasses> <ignoreClass>org.w3c.dom.*</ignoreClass> <ignoreClass>com.sun.jna.*</ignoreClass> <ignoreClass>module-info</ignoreClass> </ignoreClasses> <findAllDuplicates>true</findAllDuplicates> </banDuplicateClasses> <bannedDependencies> </rules> </configuration>

module.info >

<inLibsFilter>! META-INF/**,! META-INF/versions/9/**.class</inLibsFilter>
<ignoredClassPatterns>
  <ignoredClassPattern>
    ^META-INF.versions.9.module-info$
  </ignoredClassPattern>
</ignoredClassPatterns>

The result is that his mother is not working well.

The /9/module-info.class looks like an add-on to JDK9. I’m using JDK8 now, so I don’t need to use it. No way, turn over a strong, still don’t say, this Buddha jump wall is really very good. Foreign technical sites are good, especially Google’s engine search for the GitHub class is very deep. Unlike baidu, I day, how to search also on that a few blogs.

Finally read this article to solve.

https://github.com/mojohaus/e…

Adjust the Extra-Enforcer-Rules version. Oh, I’ll go… JAR dependencies for Java are annoying.

<dependency> <groupId>org.codehaus.mojo</groupId> <artifactId>extra-enforcer-rules</artifactId> 1.0 beta - < version > 4 < / version > < / dependency > < / dependencies > < executions >

Modified to

1.0 beta - < version > 7 < / version >

Okay, compile through, go do the next step, Nima’s a fucking problem that kept me drunk for hours.