欢迎,
我在打包 aspectj 程序时遇到问题。在 pom.xml 中使用这段代码:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/log4j.properties</exclude>
</excludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.mkyong.core.utils.App</mainClass>
<classpathPrefix>dependency-jars/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<ajdtBuildDefFile>build-1-5.ajproperties</ajdtBuildDefFile>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- OTHER PLUGINS -->
</plugins>
</build>
在控制台上使用此命令:
mvn aspectj:compile
mvn exec:java
运行程序的各个方面都很好。但是执行这条路线:
mvn package
java -jar target\<my-package>.jar
没有奏效。例外情况是有关以下信息:
Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.Signature
问题是什么?