parent
83e0662b75
commit
4acde5a0ed
|
|
@ -0,0 +1,2 @@
|
|||
datasource.properties
|
||||
wildfly.properties
|
||||
|
|
@ -1,7 +1,42 @@
|
|||
## Prepare Wildfly:
|
||||
# ccm-bundle-devel-wildfly README
|
||||
|
||||
mvn -pl ccm-bundle-devel-wildfly-web wildfly:start wildfly:deploy-artifact@deploy-jdbc-driver wildfly:add-resource@add-datasource wildfly:shutdown
|
||||
This module creates a WAR which can be deployed to a Wildfly Application
|
||||
Server. For testing, the module also provides an runtime environment
|
||||
and the setup. The runtime is managed using the
|
||||
[wildfly-maven-plugin](https://docs.jboss.org/wildfly/plugins/maven/latest/).
|
||||
|
||||
At the moment the runtime only supports PostgreSQL as database.
|
||||
|
||||
To use these runtime some prepration steps are necessary.
|
||||
|
||||
1. Create the configuration files. The runtime is configured using two files:
|
||||
* wildfly.properties allows it to configure the ports used by the Wildfly server
|
||||
* datasource.properties provides the configuration data for datasource used by
|
||||
LibreCCM.
|
||||
|
||||
For both files examples are provided (`datasource.example.properties`,
|
||||
`wildfly.example.properties`). Copy the example files and customize
|
||||
the settings is necessary.
|
||||
|
||||
2. Run a build using the `setup-runtime` profile. It is important to add the
|
||||
`package` goal, otherwise the WAR file which is deployed in this step is
|
||||
not build correctly:
|
||||
|
||||
```
|
||||
mvn package -Psetup-runtime -pl ccm-bundle-devel-wildfly -am
|
||||
```
|
||||
|
||||
During the `package` phase of the this module Wildfly will be downloaded,
|
||||
unpackaged into the `target` directory, the PostgreSQL driver will be
|
||||
deployed, a datasource will be generated and the WAR file will be deployed.
|
||||
|
||||
To run LibreCCM in this environment, use the `enable-runtime` profile and the `wildfly:start`
|
||||
goal:
|
||||
|
||||
mvn -Penable-runtime -pl ccm-bundle-devel-wildfly wildfly:start
|
||||
|
||||
To shutdown the server:
|
||||
|
||||
mvn -Penable-runtime -pl ccm-bundle-devel-wildfly wildfly:shutdown
|
||||
|
||||
## Running
|
||||
|
||||
mvn -pl ccm-bundle-devel-wildfly-web -am wildfly:run
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
libreccm.datasource.connectionUrl=jdbc:postgresql://localhost:5432/ccm-devel-beta
|
||||
libreccm.datasource.username=ccm
|
||||
libreccm.datasource.password=ccm
|
||||
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<wildfly.datasource.connectionUrl>jdbc:postgresql://localhost:5432/ccm-devel</wildfly.datasource.connectionUrl>
|
||||
<wildfly.datasource.username>ccm</wildfly.datasource.username>
|
||||
<wildfly.datasource.password>ccm</wildfly.datasource.password>
|
||||
|
||||
</properties>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
@ -62,11 +60,11 @@
|
|||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
@ -232,158 +230,95 @@
|
|||
<filesets>
|
||||
<fileset>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<includes>
|
||||
<include>classes/</include>
|
||||
<include>generated-resources/</include>
|
||||
<include>libreccm-web-wildfly/</include>
|
||||
<include>libreccm-web-wildfly.war</include>
|
||||
<include>maven-archiver/</include>
|
||||
<include>test-classes/</include>
|
||||
<include>war/</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<execlude>wildfly*</execlude>
|
||||
<exclude>wildfly*/**</exclude>
|
||||
</excludes>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- <plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<commands>
|
||||
<command>/subsystem=datasources/data-source=ccm-devel:add(driver-name=postgresql,jndi-name="java:/comp/env/jdbc/libreccm/db",connection-url="${wildfly.datasource.connectionUrl}",user-name="${wildfly.datasource.username}",password="${wildfly.datasource.password}",use-ccm="false")</command>
|
||||
</commands>
|
||||
</configuration>
|
||||
</plugin>-->
|
||||
|
||||
<plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>start</id>
|
||||
<goals>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<stdout>System.out</stdout>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>deploy-jdbc-driver</id>
|
||||
<configuration>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<name>postgresql.jar</name>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>deploy-artifact</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-datasource</id>
|
||||
<configuration>
|
||||
<address>subsystem=datasources,data-source=ccm-devel</address>
|
||||
<resources>
|
||||
<resource>
|
||||
<!--<enableResource>true</enableResource>-->
|
||||
<properties>
|
||||
<connection-url>${wildfly.datasource.connectionUrl}</connection-url>
|
||||
<jndi-name>java:/comp/env/jdbc/libreccm/db</jndi-name>
|
||||
<enabled>true</enabled>
|
||||
<user-name>${wildfly.datasource.username}</user-name>
|
||||
<password>${wildfly.datasource.password}</password>
|
||||
<use-ccm>false</use-ccm>
|
||||
<driver-name>postgresql.jar</driver-name>
|
||||
</properties>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>add-resource</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>shutdown</id>
|
||||
<goals>
|
||||
<goal>shutdown</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>prepare-wildfly</id>
|
||||
<id>setup-runtime</id>
|
||||
<!-- <properties>
|
||||
<libreccm.datasource.connectionUrl>jdbc:postgresql://localhost:5432/ccm-devel</libreccm.datasource.connectionUrl>
|
||||
<libreccm.datasource.username>ccm</libreccm.datasource.username>
|
||||
<libreccm.datasource.password>ccm</libreccm.datasource.password>
|
||||
</properties>-->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>properties-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>read-datasource-properties</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>read-project-properties</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<files>
|
||||
<file>${project.basedir}/datasource.properties</file>
|
||||
</files>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>false</skip>
|
||||
<propertiesFile>${project.basedir}/wildfly.properties</propertiesFile>
|
||||
</configuration>
|
||||
<executions>
|
||||
<!-- <execution>
|
||||
<id>undeploy</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>undeploy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<ignoreMissingDeployment>true</ignoreMissingDeployment>
|
||||
</configuration>
|
||||
</execution>-->
|
||||
<execution>
|
||||
<id>start</id>
|
||||
<phase>package</phase>
|
||||
<id>start-for-prepare</id>
|
||||
<goals>
|
||||
<goal>start</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<stdout>System.out</stdout>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>deploy-jdbc-driver</id>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<name>postgresql.jar</name>
|
||||
<force>true</force>
|
||||
</configuration>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>deploy-artifact</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-datasource</id>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<address>subsystem=datasources,data-source=ccm-devel</address>
|
||||
<force>true</force>
|
||||
<resources>
|
||||
<resource>
|
||||
<!--<enableResource>true</enableResource>-->
|
||||
<properties>
|
||||
<connection-url>${wildfly.datasource.connectionUrl}</connection-url>
|
||||
<connection-url>${libreccm.datasource.connectionUrl}</connection-url>
|
||||
<jndi-name>java:/comp/env/jdbc/libreccm/db</jndi-name>
|
||||
<enabled>true</enabled>
|
||||
<user-name>${wildfly.datasource.username}</user-name>
|
||||
<password>${wildfly.datasource.password}</password>
|
||||
<user-name>${libreccm.datasource.username}</user-name>
|
||||
<password>${libreccm.datasource.password}</password>
|
||||
<use-ccm>false</use-ccm>
|
||||
<driver-name>postgresql.jar</driver-name>
|
||||
</properties>
|
||||
|
|
@ -391,38 +326,23 @@
|
|||
</resources>
|
||||
|
||||
</configuration>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>add-resource</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!-- <execution>
|
||||
<id>run</id>
|
||||
<phase>package</phase>
|
||||
<execution>
|
||||
<id>deploy-libreccm-bundle-devel</id>
|
||||
<configuration>
|
||||
<commands>
|
||||
<command>/subsystem=datasources/data-source=ccm-devel:add(driver-name=postgresql,jndi-name="java:/comp/env/jdbc/libreccm/db",connection-url="${wildfly.datasource.connectionUrl}",user-name="${wildfly.datasource.username}",password="${wildfly.datasource.password}",use-ccm="false")</command>
|
||||
</commands>
|
||||
<force>true</force>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>-->
|
||||
<!-- <execution>
|
||||
<id>run</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>-->
|
||||
<!-- <execution>
|
||||
<id>deploy</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>deploy-only</goal>
|
||||
</goals>
|
||||
</execution>-->
|
||||
</execution>
|
||||
<execution>
|
||||
<id>shutdown</id>
|
||||
<id>shutdown-after-deploy</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shutdown</goal>
|
||||
|
|
@ -433,5 +353,33 @@
|
|||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>enable-runtime</id>
|
||||
<properties>
|
||||
<runtime.hostname>localhost</runtime.hostname>
|
||||
<runtime.bind>127.0.0.1</runtime.bind>
|
||||
<runtime.http.port>8180</runtime.http.port>
|
||||
<runtime.https.port>8543</runtime.https.port>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>false</skip>
|
||||
<propertiesFile>${project.basedir}/wildfly.properties</propertiesFile>
|
||||
<!-- <serverArgs>
|
||||
<serverArg>-Djboss.http.port=${runtime.http.port}</serverArg>
|
||||
<serverArg>-Djboss.https.port=${runtime.https.port}</serverArg>
|
||||
</serverArgs>-->
|
||||
<!-- <hostname>${runtime.hostname}</hostname>
|
||||
<port>${runtime.port}</port>-->
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" ?>
|
||||
<jboss-web>
|
||||
<context-root>/libreccm</context-root>
|
||||
</jboss-web>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# Configuration for Wildfly, primarly ports on which Wildfly will listen
|
||||
|
||||
# Ports for Undertow (Servlet Container). These are the ports which you are
|
||||
# using the access your application
|
||||
jboss.http.port=8080
|
||||
jboss.https.port=8443
|
||||
|
||||
# Ports for Wildfly's Management Interface
|
||||
jboss.management.http.port=9990
|
||||
jboss.management.https.port=9993
|
||||
|
||||
|
||||
7
pom.xml
7
pom.xml
|
|
@ -321,6 +321,11 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>properties-maven-plugin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
|
|
@ -382,7 +387,7 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- <plugin>
|
||||
<!-- <plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
|
|
|
|||
Loading…
Reference in New Issue