在Openshift 2中,我在pom.xml文件中有这样一个配置文件:
<profile>
<!-- openshift red hat cloud build profile -->
<id>openshift</id>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<outputDirectory>webapps</outputDirectory>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>它负责将WAR文件放到目录中,从目录中自动部署到类似Tomcat的jboss。
现在,在Openshift 3中,通过使用浏览器嵌入式ssh控制台,我检查了是否构建了WAR文件并将其放入/tmp/src/webapps目录。我应该在哪里移动它(我应该如何修改Maven配置文件)以使新的Openshift 3类似Tomcat的jboss部署并托管它?
发布于 2017-09-24 22:21:18
我找到了这套衣服--正确的outputDirectory是target,所以WAR插件现在看起来:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>target</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>我在那里找到了它:https://github.com/gshipley/book-helloworld/blob/master/pom.xml --在一个示例OpenShift应用程序中。现在我的战争正被部署到WildFly!
而且--这个免费的电子书真的很棒:https://www.openshift.com/promotions/for-developers.html。
https://stackoverflow.com/questions/46384222
复制相似问题