执行目标时出现找不到类错误
mvn surefire:test
pom.xml
....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<reuseForks>false</reuseForks>
<argLine>-javaagent:../lib/spring-agent-${version.spring}.jar
</argLine>
<useManifestOnlyJar>false</useManifestOnlyJar>
<useSystemClassLoader>false</useSystemClassLoader>
<additionalClasspathElements>
<additionalClasspathElement>${basedir}/lib/*.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
日志:
[DEBUG]测试类路径:/安装路径/ project1 / target / test-integration-src /安装路径/ project1 / target / classes /安装路径/apache-maven-3.5.4/repo/javax/activation/activation /1.1/activation-1.1.jar /安装路径/apache-maven-3.5.4/r epo / apache-log4j / log4j / 1.2.15 / log4j-1.2.15.jar /安装路径/apache-maven-3.5.4/repo/com/ibm/mq/allclient/9.0.0.2/allclient-9.0.0.2 .jar /安装路径/apache-maven-3.5.4/repo/javax/jms/javax.jms-api/2.0.1/javax.jms-api-2.0.1.jar apache-maven-3.5.4 / repo /org/springframework/spring-agent/2.5.6/spring-agent-2.5.6.jar /安装路径/apache-maven-3.5.4/repo/junit/junit/4.12/junit-4.12.jar /安装路径/apache-maven-3.5.4/repo/org/hamcrest/hamcrest-core/1.3/hamcres t-core-1.3.jar /安装路径/apache-maven-3.5.4/repo/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar /安装路径/apache-maven-3.5.4/ repo / ant-contrib / ant-contrib / 1.0b3 / ant-contrib-1.0b3.jar /安装路径/apache-maven-3.5.4/repo/ant/ant/1.5/ant-1 .5.jar /安装路径/apache-maven-3.5.4/repo/org/apache/ant/ant-jsch/1.9.9/ant-jsch-1.9.9.jar /安装路径/apache-maven-3.5 .4 / repo / org / apache / ant / ant / 1.9.9 / ant-1.9.9.jar /安装路径/apache-maven-3.5.4/repo/org/apache/ant/ant-launcher/ 1.9.9 / ant-launcher-1.9.9.jar /安装路径/project1/lib/spring-context-2.5.2.jar /安装路径/project1/lib/mule-1.4.4-embedded.jar /安装路径/ project1 / lib / mule-core-1。 4.4.jar /安装路径/ project1 / lib / *。jar
[DEBUG]提供程序类路径:/安装路径/apache-maven-3.5.4/repo/org/apache/maven/surefire/surefire-junit4/2.18.1/surefire-junit4-2.18.1.jar / installation路径/apache-maven-3.5.4/repo/org/apache/maven/surefire/surefire-api/2.18.1/surefire-ap i-2.18.1.jar
[DEBUG] test(compact)类路径:test-integration-src类Activation-1.1.jar log4j-1.2.15.jar allclient-9.0.0.2.jar javax.jms-api-2.0.1.jar spring- agent-2.5.6.jar junit-4。 12.jar hamcrest-core-1.3.jar jsch-0.1.54.jar ant-contrib-1.0b3.jar ant-1.5.jar ant-jsch-1.9.9.jar ant-1.9.9.jar ant-launcher- 1.9.9.jar spring-context-2.5.2.jar mule-1.4.4-embedded.jar mule-core-1.4.4.jar * .jar
[DEBUG] provider(compact)类路径:surefire-junit4-2.18.1.jar surefire-api-2.18.1.jar
它选择* .jar(上面突出显示),但不包括所有jar文件到classpath并抛出ClassNotFoundException。
请帮助。