mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-05-26 17:25:11 +00:00
Archetypes - Change share archetype build approach
- Build the project using package goal instead of install - Remove unused test tasks of the scripts
This commit is contained in:
parent
d949a778ef
commit
1ce98f09aa
@ -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.
|
* `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_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.
|
* `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
|
# Few things to notice
|
||||||
|
|
||||||
|
@ -92,6 +92,41 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<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.
|
<!-- 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. -->
|
We need this config so this is done before the Alfresco Maven Plugin 'run' is executed. -->
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -160,6 +195,25 @@
|
|||||||
</resources>
|
</resources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</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>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
@ -218,75 +272,22 @@
|
|||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.1.1</version>
|
<version>3.1.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<!-- Copy the share extension -->
|
<!-- Collect extensions (JARs or AMPs) declared in this module to be deployed to docker -->
|
||||||
<execution>
|
<execution>
|
||||||
<id>copy-share-extension</id>
|
<id>collect-extensions</id>
|
||||||
<phase>pre-integration-test</phase>
|
<phase>package</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>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>copy-dependencies</goal>
|
<goal>copy-dependencies</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
||||||
<includeScope>runtime</includeScope>
|
<includeScope>runtime</includeScope>
|
||||||
|
<!-- IMPORTANT: if using amp dependencies only, add <includeTypes>amp</includeTypes> -->
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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 -->
|
<!-- Hot reloading with JRebel -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.zeroturnaround</groupId>
|
<groupId>org.zeroturnaround</groupId>
|
||||||
|
@ -47,20 +47,7 @@ IF %1==reload_share (
|
|||||||
CALL :tail
|
CALL :tail
|
||||||
GOTO END
|
GOTO END
|
||||||
)
|
)
|
||||||
IF %1==build_test (
|
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share}"
|
||||||
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}"
|
|
||||||
:END
|
:END
|
||||||
EXIT /B %ERRORLEVEL%
|
EXIT /B %ERRORLEVEL%
|
||||||
|
|
||||||
@ -79,12 +66,12 @@ EXIT /B 0
|
|||||||
)
|
)
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
:build
|
:build
|
||||||
call %MVN_EXEC% clean install -DskipTests
|
call %MVN_EXEC% clean package
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
:build_share
|
:build_share
|
||||||
docker-compose -f "%COMPOSE_FILE_PATH%" kill ${rootArtifactId}-share
|
docker-compose -f "%COMPOSE_FILE_PATH%" kill ${rootArtifactId}-share
|
||||||
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f ${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
|
EXIT /B 0
|
||||||
:tail
|
:tail
|
||||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
||||||
@ -92,9 +79,6 @@ EXIT /B 0
|
|||||||
:tail_all
|
:tail_all
|
||||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
|
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
|
||||||
EXIT /B 0
|
EXIT /B 0
|
||||||
:test
|
|
||||||
call %MVN_EXEC% verify
|
|
||||||
EXIT /B 0
|
|
||||||
:purge
|
:purge
|
||||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||||
docker volume rm -f ${rootArtifactId}-db-volume
|
docker volume rm -f ${rootArtifactId}-db-volume
|
||||||
|
@ -33,13 +33,13 @@ purge() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
|
${symbol_dollar}MVN_EXEC clean package
|
||||||
}
|
}
|
||||||
|
|
||||||
build_share() {
|
build_share() {
|
||||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH kill ${rootArtifactId}-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
|
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() {
|
tail() {
|
||||||
@ -50,10 +50,6 @@ tail_all() {
|
|||||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
||||||
}
|
}
|
||||||
|
|
||||||
test() {
|
|
||||||
${symbol_dollar}MVN_EXEC verify
|
|
||||||
}
|
|
||||||
|
|
||||||
case "${symbol_dollar}1" in
|
case "${symbol_dollar}1" in
|
||||||
build_start)
|
build_start)
|
||||||
down
|
down
|
||||||
@ -80,17 +76,6 @@ case "${symbol_dollar}1" in
|
|||||||
start_share
|
start_share
|
||||||
tail
|
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
|
esac
|
Loading…
x
Reference in New Issue
Block a user