好不容易第一次部署运行报错:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15:47 min
[INFO] Finished at: 2019-03-10T21:26:26+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project hello1: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy failed: Failed to create deployer with implementation class org.codehaus.cargo.container.glassfish.GlassFish4xInstalledLocalDeployer for the parameters (container [id = [glassfish4x]], deployer type [installed]).: InvocationTargetException: The container configuration directory "c://glassfish5/glassfish/domains" does not exist. Please configure the container before attempting to perform any local deployment. Read more on: http://cargo.codehaus.org/Local+Configuration -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
解决:
编辑下图文件
<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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <artifactId>jsf</artifactId> <groupId>org.glassfish.javaeetutorial</groupId> <version>8.1-SNAPSHOT</version> </parent> <groupId>org.glassfish.javaeetutorial</groupId> <artifactId>hello1</artifactId> <version>8.1-SNAPSHOT</version> <packaging>war</packaging> <name>${project.artifactId}</name> <build> <defaultGoal>compile</defaultGoal> </build> <profiles> <profile> <id>windows</id> <activation> <os> <family>windows</family> </os> </activation> <properties> <glassfish.home>E:Program Files (x86)glassfishglassfish5</glassfish.home> </properties> </profile> </profiles> </project>
增加16-31行
更改下面的地址为自己的glassfish地址
<glassfish.home>E:Program Files (x86)glassfishglassfish5</glassfish.home>