我正在用Maven执行SOAPUI项目并收到以下错误。我如何找出缺少的类,因为错误提示缺少必需的类,但没有类的名称?下面是执行mvn -e
**[ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.4.0:test (ServiceCPEWebservice-soapui-project.
xml) on project Single_Service: Execution ServiceCPEWebservice-soapui-project.xml of goal com.smartbear.soapui:soapui-ma
ven-plugin:5.4.0:test failed: A required class was missing while executing com.smartbear.soapui:soapui-maven-plugin:5.4.
0:test: org/apache/log4j/Layout**
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.smartbear.soapui:soapui-maven-plugin:5.4.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui-maven-plugin/5.4.0/soapui-maven-plugin-5.4.0.j
ar
[ERROR] urls[1] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui/5.4.0/soapui-5.4.0.jar
[ERROR] urls[2] = file:/C:/work/m2-repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.apache.log4j.Layout
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:
5.4.0:test (ServiceCPEWebservice-soapui-project.xml) on project Single_Service: Execution ServiceCPEWebservice-soapui-pr
oject.xml of goal com.smartbear.soapui:soapui-maven-plugin:5.4.0:test failed: A required class was missing while executi
ng com.smartbear.soapui:soapui-maven-plugin:5.4.0:test: org/apache/log4j/Layout
-----------------------------------------------------
realm = plugin>com.smartbear.soapui:soapui-maven-plugin:5.4.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui-maven-plugin/5.4.0/soapui-maven-plugin-5.4.0.jar
urls[1] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui/5.4.0/soapui-5.4.0.jar
urls[2] = file:/C:/work/m2-repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
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:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.PluginExecutionException: Execution ServiceCPEWebservice-soapui-project.xml of goal c
om.smartbear.soapui:soapui-maven-plugin:5.4.0:test failed: A required class was missing while executing com.smartbear.so
apui:soapui-maven-plugin:5.4.0:test: org/apache/log4j/Layout
-----------------------------------------------------
realm = plugin>com.smartbear.soapui:soapui-maven-plugin:5.4.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui-maven-plugin/5.4.0/soapui-maven-plugin-5.4.0.jar
urls[1] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui/5.4.0/soapui-5.4.0.jar
urls[2] = file:/C:/work/m2-repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:168)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing com.smartbear.
soapui:soapui-maven-plugin:5.4.0:test: org/apache/log4j/Layout
-----------------------------------------------------
realm = plugin>com.smartbear.soapui:soapui-maven-plugin:5.4.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui-maven-plugin/5.4.0/soapui-maven-plugin-5.4.0.jar
urls[1] = file:/C:/work/m2-repository/com/smartbear/soapui/soapui/5.4.0/soapui-5.4.0.jar
urls[2] = file:/C:/work/m2-repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
-----------------------------------------------------
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:166)
... 21 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout
at com.eviware.soapui.maven2.TestMojo.execute(TestMojo.java:52)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 23 more
[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/PluginContainerException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :Single_Service
我有两个绒球。 1是主POM,1是子POM。
下面是POM
主POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.orange.papyrus.customercare</groupId>
<artifactId>FullRegression</artifactId>
<version>10.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>AutomationSingleTest</module>
<module>AutomationCompleteTest</module>
</modules>
<properties>
<soap.path>${project.basedir}/../North/CC_Projects</soap.path>
<soap.version>5.4.0</soap.version>
<soap.outputFolder>${project.build.directory}</soap.outputFolder>
<soap.ip>${ipaddress}</soap.ip>
<soap.port>${port}</soap.port>
<soap.username>${username}</soap.username>
<soap.password>${password}</soap.password>
<soap.servicename>${servicename}</soap.servicename>
<soap.serviceendpoint>${endpoint}</soap.serviceendpoint>
</properties>
<dependencies>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.4.0</version>
<configuration>
<exportAll>true</exportAll>
<testFailIgnore>true</testFailIgnore>
<junitReport>true</junitReport>
<outputFolder>${project.basedir}/target/surefire-reports/</outputFolder>
<printReport>true</printReport>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.5.4</version>
</plugin>
</plugins>
</build>
</project>
儿童POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.orange.papyrus.customercare</groupId>
<artifactId>FullRegression</artifactId>
<version>10.1.0-SNAPSHOT</version>
</parent>
<artifactId>Single_Service</artifactId>
<version>10.2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<executions>
<execution>
<id>${servicename}</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>${soap.path}/${servicename}</projectFile>
<endpoint>http://${soap.ip}:${soap.port}/${soap.serviceendpoint}</endpoint>
<username>${soap.username}</username>
<password>${soap.password}</password>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
答案 0 :(得分:0)
我认为您正在使用的maven-surefire-report-plugin
版本3.5.4
尚未发布。最新版本为3.0.0-M3
Maven Surefire Report Plugin
更新现有的 Maven Surefire报告插件版本。
尽管错误来自log4j库。您是否有任何自定义配置来生成日志?则布局未正确写入。 在此处检查自定义SOAPUI soapui-log4j.xml文件
我的API Testing之一将maven与SOAPUI一起使用。选中此项,然后尝试在您的Master
pom文件中进行修改。希望能解决您的问题。