我正在使用maven-assembly-plugin生成一个包含单个类的jar文件。当我尝试将我的jar部署到JBoss服务器时,我收到一个错误:jar中没有找到带注释的类:我已经从jar中反编译了类文件并对其进行了注释。我唯一的猜测是由于某些原因maven-assembly-plugin引起了一个问题。如果我从命令行生成jar并插入相同的.class文件,则部署将起作用。
该插件的摘录:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<inherited>false</inherited>
<executions>
<execution>
<id>make-RC04InquirySvc-v1.jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
<outputDirectory>${project.build.directory}/dist</outputDirectory>
<finalName>RC04InquirySvc-v1</finalName>
<descriptors>
<descriptor>assembly-RC04InquirySvc-v1.xml</descriptor>
</descriptors>
<archive>
<manifestEntries>
<Implementation-Vendor>EDS</Implementation-Vendor>
<Implementation-Title>Agile Card Framework</Implementation-Title>
<Implementation-Version>6.0</Implementation-Version>
<Built-Date>${maven.build.timestamp}</Built-Date>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
汇编文件:
<assembly>
<id>acf-bundle</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}/classes/com/eds/agilecard/wsdl/rc04Inquirysvc_v1</directory>
<outputDirectory>/com/eds/agilecard/wsdl/rc04Inquirysvc_v1</outputDirectory>
<includes>
<include>**/ServiceEndpointImpl.class</include>
</includes>
</fileSet>
</fileSets>
</assembly>