我正在尝试使用Jboss和Eclipse在Openshift上部署一个简单的REST Web服务。 我有一个Jar库,包含了一些类,我把它放在路径中:
的src /主/ web应用/ WEB-INF / LIB /
项目。在本地部署应用程序并测试它是可以的,但是当我尝试在Openshift上部署时,我在构建时遇到错误:
ClassNotFoundException的
阅读日志我注意到Jboss(在Openshift上)找不到我的Jar:为什么?
答案 0 :(得分:0)
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestEntries>
<Dependencies>org.slf4j,org.apache.commons.logging,org.joda.time</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>openshift</id>
<build>
<finalName>yourapp</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<outputDirectory>deployments</outputDirectory>
<warName>ROOT</warName><!-- ROOT -->
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestEntries>
<Dependencies>org.slf4j,org.apache.commons.logging,org.joda.time</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>openshift</id>
<build>
<finalName>yourapp</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<outputDirectory>deployments</outputDirectory>
<warName>ROOT</warName><!-- ROOT -->
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>