【发布时间】:2015-01-29 07:13:58
【问题描述】:
我需要使用 maven 构建和部署战争到 glassfish(问题解释如下)。
目前我设法使用 maven glassfish 插件部署战争,并且我使用了如下 POM 中所示的目标 redploy:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Myapp</groupId>
<artifactId>Myapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>APP WEB APP</name>
<url>http://maven.apache.org</url>
<build>
<finalName>MyApp</finalName>
<plugins>
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<configuration>
<terse>false</terse>
<echo>true</echo>
<debug>true</debug>
<glassfishDirectory>C:\glassfish3\glassfish</glassfishDirectory>
<user>admin</user>
<adminPassword>admin</adminPassword>
<domain>
<name>domain1</name>
<host>localhost</host>
<adminPort>4848</adminPort>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
</component>
</components>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>redeploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
问题:说已经部署了一个战争,当我执行命令 mvn clean install 并且在部署过程中出现问题。因为我已经将目标用作重新部署,所以第一个做战争取消部署,然后进行部署。在我的情况下,此 POM 不能用于下一次,因为出现故障并且战争不存在。
需要帮助 请帮助我检查 POM 是否已部署战争,然后根据结果我需要启动目标部署或取消部署哪些套件。
假设没有部署战争,我需要在 POM 中调用 glassfish:deploy。
提前感谢您的宝贵时间
【问题讨论】:
标签: pom.xml maven-glassfish-plugin