Merge branch 'sdk-4.0' of https://github.com/Alfresco/alfresco-sdk into sdk-4.0

This commit is contained in:
Martin Bergljung
2019-03-27 10:42:29 +00:00
16 changed files with 209 additions and 233 deletions
@@ -11,7 +11,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -12,7 +12,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -14,6 +14,8 @@ All the services of the project are now run as docker containers. The run script
* `build_start`. Build the whole project, recreate the ACS docker image, start the dockerised environment composed by ACS, Share (optional), ASS
and PostgreSQL and tail the logs of all the containers.
* `build_start_it_supported`. Build the whole project including dependencies required for IT execution, recreate the ACS docker image, start the dockerised environment
composed by ACS, Share (optional), ASS and PostgreSQL and tail the logs of all the containers.
* `start`. Start the dockerised environment without building the project and tail the logs of all the containers.
* `stop`. Stop the dockerised environment.
* `purge`. Stop the dockerised container and delete all the persistent data (docker volumes).
@@ -98,6 +98,41 @@
<build>
<plugins>
<!--
Build an AMP if 3rd party libs are needed by the extensions
JARs are the default artifact produced in your modules, if you want to build an amp for each module
you have to enable this plugin and inspect the src/main/assembly.xml file if you want to customize
the layout of your AMP. The end result is that Maven will produce both a JAR file and an AMP with your
module.
-->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>build-amp-file</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/amp.xml</descriptor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
</dependency>
</dependencies>
</plugin>
-->
<!-- Filter the test resource files in the AIO parent project, and do property substitutions.
We need this config so this is done before the Alfresco Maven Plugin 'run' is executed. -->
<plugin>
@@ -192,6 +227,44 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-repository-extension</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<resources>
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}.jar</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-repository-tests</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<resources>
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}-tests.jar</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
@@ -200,73 +273,29 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<!-- Copy the repository extension and the dependencies required for execute integration tests -->
<!-- Copy the dependencies required for execute integration tests -->
<execution>
<id>copy-repo-extension</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${project.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
<!-- Test dependencies -->
<!-- We need these dependencies installed in ACS in order to execute the test remotely making use of the Alfresco RAD module -->
<artifactItem>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-rad</artifactId>
<version>${alfresco.sdk.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<!-- Copy other dependencies (JARs or AMPs) declared in the platform module -->
<execution>
<id>copy-third-party-dependencies</id>
<id>collect-test-artifacts</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<excludeScope>compile</excludeScope>
</configuration>
</execution>
<!-- Collect extensions (JARs or AMPs) declared in this module to be deployed to docker -->
<execution>
<id>collect-extensions</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<includeScope>runtime</includeScope>
<!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
</configuration>
</execution>
</executions>
@@ -372,41 +401,6 @@
</executions>
</plugin>
<!--
Build an AMP if 3rd party libs are needed by the extensions
JARs are the default artifact produced in your modules, if you want to build an amp for each module
you have to enable this plugin and inspect the src/main/assembly.xml file if you want to customize
the layout of your AMP. The end result is that Maven will produce both a JAR file and an AMP with your
module.
-->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>build-amp-file</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/amp.xml</descriptor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
</dependency>
</dependencies>
</plugin>
-->
<!-- Hot reloading with JRebel -->
<plugin>
<groupId>org.zeroturnaround</groupId>
@@ -12,7 +12,7 @@ IF NOT [%M2_HOME%]==[] (
)
IF [%1]==[] (
echo "Usage: %0 {build_start|start|stop|purge|tail|build_test|test}"
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}"
GOTO END
)
@@ -23,6 +23,14 @@ IF %1==build_start (
CALL :tail
GOTO END
)
IF %1==build_start_it_supported (
CALL :down
CALL :build
CALL :prepare_test
CALL :start
CALL :tail
GOTO END
)
IF %1==start (
CALL :start
CALL :tail
@@ -44,6 +52,7 @@ IF %1==tail (
IF %1==build_test (
CALL :down
CALL :build
CALL :prepare_test
CALL :start
CALL :test
CALL :tail_all
@@ -70,7 +79,7 @@ EXIT /B 0
)
EXIT /B 0
:build
call %MVN_EXEC% clean install -DskipTests
call %MVN_EXEC% clean package
EXIT /B 0
:tail
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
@@ -78,6 +87,9 @@ EXIT /B 0
:tail_all
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
EXIT /B 0
:prepare_test
call %MVN_EXEC% verify -DskipTests=true
EXIT /B 0
:test
call %MVN_EXEC% verify
EXIT /B 0
@@ -29,7 +29,7 @@ purge() {
}
build() {
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
${symbol_dollar}MVN_EXEC clean package
}
tail() {
@@ -40,6 +40,10 @@ tail_all() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
}
prepare_test() {
${symbol_dollar}MVN_EXEC verify -DskipTests=true
}
test() {
${symbol_dollar}MVN_EXEC verify
}
@@ -51,6 +55,13 @@ case "${symbol_dollar}1" in
start
tail
;;
build_start_it_supported)
down
build
prepare_test
start
tail
;;
start)
start
tail
@@ -68,6 +79,7 @@ case "${symbol_dollar}1" in
build_test)
down
build
prepare_test
start
test
tail_all
@@ -77,5 +89,5 @@ case "${symbol_dollar}1" in
test
;;
*)
echo "Usage: ${symbol_dollar}0 {build_start|start|stop|purge|tail|build_test|test}"
echo "Usage: ${symbol_dollar}0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}"
esac
@@ -14,7 +14,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -20,9 +20,6 @@ All the services of the project are now run as docker containers. The run script
* `tail`. Tail the logs of all the containers.
* `reload_share`. Build the Share module, recreate the Share docker image and restart the Share container.
* `reload_acs`. Build the ACS module, recreate the ACS docker image and restart the ACS container.
* `build_test`. Build the whole project, recreate the Share docker image, start the dockerised environment, execute the integration tests from the
`integration-tests` module and stop the environment.
* `test`. Execute the integration tests (the environment must be already started).
# Few things to notice
@@ -92,6 +92,41 @@
<build>
<plugins>
<!--
Build an AMP if 3rd party libs are needed by the extensions
JARs are the default artifact produced in your modules, if you want to build an amp for each module
you have to enable this plugin and inspect the src/main/assembly.xml file if you want to customize
the layout of your AMP. The end result is that Maven will produce both a JAR file and an AMP with your
module.
-->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>build-amp-file</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/amp.xml</descriptor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
</dependency>
</dependencies>
</plugin>
-->
<!-- Filter the test resource files in the AIO parent project, and do property substitutions.
We need this config so this is done before the Alfresco Maven Plugin 'run' is executed. -->
<plugin>
@@ -160,6 +195,25 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-share-extension</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<resources>
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}.jar</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
@@ -218,75 +272,22 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<!-- Copy the share extension -->
<!-- Collect extensions (JARs or AMPs) declared in this module to be deployed to docker -->
<execution>
<id>copy-share-extension</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${project.version}</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<!-- Copy other dependencies (JARs or AMPs) declared in the share module -->
<execution>
<id>copy-third-party-dependencies</id>
<phase>pre-integration-test</phase>
<id>collect-extensions</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<includeScope>runtime</includeScope>
<!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
</configuration>
</execution>
</executions>
</plugin>
<!--
Build an AMP if 3rd party libs are needed by the extensions
JARs are the default artifact produced in your modules, if you want to build an amp for each module
you have to enable this plugin and inspect the src/main/assembly.xml file if you want to customize
the layout of your AMP. The end result is that Maven will produce both a JAR file and an AMP with your
module.
-->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>build-amp-file</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/amp.xml</descriptor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
</dependency>
</dependencies>
</plugin>
-->
<!-- Hot reloading with JRebel -->
<plugin>
<groupId>org.zeroturnaround</groupId>
@@ -47,20 +47,7 @@ IF %1==reload_share (
CALL :tail
GOTO END
)
IF %1==build_test (
CALL :down
CALL :build
CALL :start
CALL :test
CALL :tail_all
CALL :down
GOTO END
)
IF %1==test (
CALL :test
GOTO END
)
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|build_test|test}"
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share}"
:END
EXIT /B %ERRORLEVEL%
@@ -79,12 +66,12 @@ EXIT /B 0
)
EXIT /B 0
:build
call %MVN_EXEC% clean install -DskipTests
call %MVN_EXEC% clean package
EXIT /B 0
:build_share
docker-compose -f "%COMPOSE_FILE_PATH%" kill ${rootArtifactId}-share
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f ${rootArtifactId}-share
call %MVN_EXEC% clean install -DskipTests
call %MVN_EXEC% clean package
EXIT /B 0
:tail
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
@@ -92,9 +79,6 @@ EXIT /B 0
:tail_all
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
EXIT /B 0
:test
call %MVN_EXEC% verify
EXIT /B 0
:purge
docker volume rm -f ${rootArtifactId}-acs-volume
docker volume rm -f ${rootArtifactId}-db-volume
@@ -33,13 +33,13 @@ purge() {
}
build() {
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
${symbol_dollar}MVN_EXEC clean package
}
build_share() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH kill ${rootArtifactId}-share
yes | docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH rm -f ${rootArtifactId}-share
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
${symbol_dollar}MVN_EXEC clean package
}
tail() {
@@ -50,10 +50,6 @@ tail_all() {
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
}
test() {
${symbol_dollar}MVN_EXEC verify
}
case "${symbol_dollar}1" in
build_start)
down
@@ -80,17 +76,6 @@ case "${symbol_dollar}1" in
start_share
tail
;;
build_test)
down
build
start
test
tail_all
down
;;
test)
test
;;
*)
echo "Usage: ${symbol_dollar}0 {build_start|start|stop|purge|tail|reload_share|build_test|test}"
echo "Usage: ${symbol_dollar}0 {build_start|start|stop|purge|tail|reload_share}"
esac
+1 -1
View File
@@ -17,7 +17,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+20 -31
View File
@@ -95,39 +95,28 @@ do is modify the `pom.xml` file of the corresponding docker module / project in
### Platform / Share project
1. Modify the Maven Dependency Plugin in the file `pom.xml` to set the platform / share JAR dependency type to `amp`:
1. Modify the Maven Resource Plugin in the file `pom.xml` to set the platform / share JAR artifact to copy to `amp`:
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- Copy the repository extension and the dependencies required for execute integration tests -->
<execution>
<id>copy-repo-extension</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>sample-platform-jar</artifactId>
<version>1.0-SNAPSHOT</version>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<type>amp</type>
</artifactItem>
<!-- Test dependencies -->
...
</artifactItems>
</configuration>
</execution>
<!-- Copy other dependencies (JARs or AMPs) declared in the platform module -->
...
</executions>
</plugin>
<execution>
<id>copy-repository-extension</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
<resources>
<resource>
<directory>target</directory>
<includes>
<include>${build.finalName}.amp</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
```
Once this configuration is in place, you simply need to rebuild and restart the project. The new configuration will make the Docker images automatically
+1 -1
View File
@@ -10,7 +10,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
+1 -1
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>4.0.0-SNAPSHOT</version>
<version>4.0.1-SNAPSHOT</version>
<name>Alfresco SDK</name>
<description>This aggregator Project builds all modules required for the Alfresco SDK</description>
<packaging>pom</packaging>