当我在maven及其shade插件的帮助下构建一个包含jasperreport的java项目时,如果在aws lambda中运行jar,总是会出现以下错误
2020-11-24T13:37:52.867+01:00 java.util.logging.ErrorManager: 5
2020-11-24T13:37:52.867+01:00 Handler.reportError caught:
如果我在aws工具箱中使用eclipse,那么一切都按预期工作(这里也提到了同样的情况https://community.jaspersoft.com/questions/1037691/no-log-messages-eclipse-console).
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>${executable.classifier}</shadedClassifierName>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>classworlds:classworlds</exclude>
<exclude>junit:junit</exclude>
<exclude>jmock:*</exclude>
<exclude>*:xml-apis</exclude>
<exclude>org.apache.maven:lib:tests</exclude>
<exclude>log4j:log4j:jar:</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>jasperreports_extension.properties</resource>
<resource>default.jasperreports.properties/</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<!-- add Main-Class to manifest file -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.myorg.lambda.demo.GenerateReport</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
暂无答案!
目前还没有任何答案,快来回答吧!