Openshift jobssas 7云正在建立战争,但没有部署它

时间:2015-10-31 01:30:40

标签: java maven deployment jboss7.x openshift

Openshift正在建立战争,但没有部署它

enter image description here

如果想要部署生成的战争,则必须通过命令

复制

cp app-root/runtime/repo/target/GameStore-0.0.1-SNAPSHOT.war app-root/dependencies/jbossas/deployments/ROOT.war

如何自动复制生成的战争?

1 个答案:

答案 0 :(得分:1)

首先,openshift jbossas7云需要pom.xml的存在才能在推送git push命令后构建代码。 其次,在构建它之后自动部署生成的战争写入pom.xml

<profiles>
    <profile>
        <!-- When built in OpenShift the 'openshift' profile will be used when 
            invoking mvn. -->
        <!-- Use this profile for any OpenShift specific customization your app 
            will need. -->
        <!-- By default that is to put the resulting archive into the 'deployments' 
            folder. -->
        <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
        <id>openshift</id>
        <build>
            <finalName>GameStore</finalName>
            <plugins>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <outputDirectory>deployments</outputDirectory>
                        <warName>ROOT</warName>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>