【发布时间】:2015-05-20 08:53:45
【问题描述】:
我的问题非常类似于:Jersey exception only thrown when depencencies assembled into a single jar
我运行我的应用程序(jetty Embedded + jersey)并且一切正常。当我尝试创建一个可执行的 JAR 时,我得到了错误:
org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor 周围写到 GRAVE:找不到媒体类型 = 应用程序/json、类型 = 类的 MessageBodyWriter
我的 POM.XML:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>server.application.DeepDig</mainClass>
</transformer>
</transformers>
<filters>
<!-- filter to address "Invalid signature file" issue - see https://stackoverflow.com/a/6743609/589215 -->
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
【问题讨论】:
-
如果我尝试使用导出到 Runnable Jar 从 eclipse 制作它,它可以工作!
标签: java maven jersey embedded-jetty