Я пытаюсь создать базовый трубопровод развертывания с использованием Maven, Glassfish и плагина Maven-Glassfish. Я хочу сделать удаленное развертывание .war на удаленном сервере из старинной рыбы, который у меня есть.Простое удаленное развертывание с Maven и Glassfish
Я после этого учебника: https://programmaticponderings.wordpress.com/2013/11/04/continuous-integration-and-deployment-using-git-maven-jenkins-and-glassfish/
я застрял на этапе, когда я должен выполнить цели ÄÂ Maven с следующими целями:
properties:read-project-properties clean install glassfish:redeploy -e
со следующими свойствами:
glassfish.properties.file.argument=testing
pom.xml выглядит следующим образом:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.blogpost</groupId>
<artifactId>HelloGlassFishMaven</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>HelloGlassFishMaven</name>
<properties>
<!-- Input Parameter - GlassFish properties file -->
<glassfish.properties.file.argument></glassfish.properties.file.argument>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
<webresources>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetpath>WEB-INF</targetpath>
<includes>
<include>**/glassfish-web.xml</include>
</includes>
</resource>
</webresources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<files>
<file>${basedir}/properties/${glassfish.properties.file.argument}.properties</file>
</files>
</configuration>
</plugin>
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>D:\CreepyStation\Work\Virtual environment\GlassFishInpuJavaEE\glassfish</glassfishDirectory>
<user>${glassfish.user}</user>
<passwordFile>${basedir}/passwords/${glassfish.pwdfile}</passwordFile>
<echo>true</echo>
<debug>true</debug>
<terse>true</terse>
<domain>
<name>${glassfish.domain}</name>
<host>${glassfish.host}</host>
<adminPort>${glassfish.adminport}</adminPort>
<httpPort>6061</httpPort>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
</component>
</components>
</configuration>
</plugin>
</plugins>
</build>
</project>
Это Используйте .properties файл со следующими параметрами (К моему удаленному домену Glassfish)
# GlassFish 4 testing domain properties
glassfish.domain=testing
glassfish.host=XX.XX.XX.XX
glassfish.adminport=6060
glassfish.user=admin
glassfish.pwdfile=pwdfile_testing
Насколько я понимаю:
- Это правильно подключиться к удаленному Glassfishserver (Если я измените пароль в файле свойств, предупреждайте меня, что пользователь/пароль неверны)
- Я правильно настроил свой удаленный Glassfishserver с доменом под названием «тестирование», и активирован-безопасный-админ активирован, я могу получить доступ к моему сервер с Glas графический интерфейс администратора sfish.
- Если я использую .war в графическом интерфейсе администратора Glassfish, он работает.
Он висит в течение нескольких минут и дать мне ошибку, вот журнал ошибок (Много линии, как я Активизированные отладки, ошибка в конце файла):
Это сводит меня с ума, я провел бесчисленные часы, пытаясь понять это, пока не повезло.
Большое спасибо!