mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-09-10 14:12:12 +00:00
Compare commits
203 Commits
alfresco-s
...
sdk-4.2
Author | SHA1 | Date | |
---|---|---|---|
|
c8b7e111db | ||
|
577202625f | ||
|
ce53cddf16 | ||
|
8086c04f11 | ||
|
80106f2d31 | ||
|
ea44c0b983 | ||
|
f2bea13467 | ||
|
8149484b1a | ||
|
bb92221b28 | ||
|
57124f2dd9 | ||
|
0ce741b9a3 | ||
|
b410483fcb | ||
|
9fbbe1c1f2 | ||
|
5ecb109f50 | ||
|
302d9bbed0 | ||
|
8568232a97 | ||
|
bf853d72c8 | ||
|
57bc796cda | ||
|
23075b0dd5 | ||
|
252a1cffb4 | ||
|
fc2ce1b724 | ||
|
18ed71327b | ||
|
de5b0fbd23 | ||
|
7f19645f20 | ||
|
e61146ea07 | ||
|
10809ad2ba | ||
|
22f024e933 | ||
|
58c55ab358 | ||
|
b90f11cde7 | ||
|
ec57395718 | ||
|
df891784c6 | ||
|
f50f18c9c1 | ||
|
1979cf6acb | ||
|
d164014074 | ||
|
0df4357069 | ||
|
34ad2d9a2a | ||
|
56080682aa | ||
|
6a68bb9946 | ||
|
447ff43b75 | ||
|
51d053a7f8 | ||
|
a93af82a2b | ||
|
3d2ff7b1e8 | ||
|
c69d51a495 | ||
|
dd0056b7a0 | ||
|
610d373896 | ||
|
0b4588a841 | ||
|
8998e37414 | ||
|
c3ae5760e8 | ||
|
89d4d3fd9a | ||
|
372afc6ba4 | ||
|
3908cc73b7 | ||
|
76d813f2f4 | ||
|
5edd1f7b43 | ||
|
12db1fcb17 | ||
|
3e4a793f5d | ||
|
fba08f9ab7 | ||
|
56300e35aa | ||
|
b4b0be82ae | ||
|
50f43f23d3 | ||
|
2ee5120413 | ||
|
7f861a9672 | ||
|
b199afcd7e | ||
|
7baf3fb0a1 | ||
|
54504b4962 | ||
|
1503134f77 | ||
|
71ed669795 | ||
|
7d9b7de8c8 | ||
|
7483212c1f | ||
|
3d30a5893b | ||
|
32666d167f | ||
|
b737483c18 | ||
|
4cdc281f7f | ||
|
f4c3ac7c84 | ||
|
af8c6c42c4 | ||
|
e61c08c650 | ||
|
cc14a39be4 | ||
|
c910fa2b40 | ||
|
3050c9deb4 | ||
|
1ce98f09aa | ||
|
6dc927e668 | ||
|
68155ef5a6 | ||
|
e5e0a7f76d | ||
|
ea4c12a836 | ||
|
d949a778ef | ||
|
099ac2ddeb | ||
|
b0bc6a38d5 | ||
|
1d1e89a86d | ||
|
517b20859e | ||
|
e27d6f1a70 | ||
|
10557e500d | ||
|
f7e4ea1b5c | ||
|
7838649c81 | ||
|
deaf4c06b8 | ||
|
067d751193 | ||
|
c0658f3a94 | ||
|
e378eec194 | ||
|
01e79d6953 | ||
|
b00ee7f5e5 | ||
|
6e5445a271 | ||
|
388f74eea3 | ||
|
2db3051599 | ||
|
8bb094b61a | ||
|
a4e79cc569 | ||
|
c14887f549 | ||
|
4e225147ea | ||
|
c5e92bdc25 | ||
|
ef59a6a39a | ||
|
42dc3659bd | ||
|
5d1fb4f4d9 | ||
|
185c4ad2bd | ||
|
0b85afc6fd | ||
|
9db0f5cff1 | ||
|
243f94227b | ||
|
330c66a1be | ||
|
ab4927afeb | ||
|
c48dffea69 | ||
|
b3391a67c3 | ||
|
465aa3de5a | ||
|
b32a78b7b3 | ||
|
7bd5c58136 | ||
|
5b21775793 | ||
|
1d551d1895 | ||
|
766847585e | ||
|
b366ae3ddd | ||
|
19369a23b5 | ||
|
93c28f5dde | ||
|
7792574dae | ||
|
e8976addea | ||
|
a7f2db61e8 | ||
|
2926a9ae83 | ||
|
246ae7a138 | ||
|
387a584aa1 | ||
|
edd8d8317b | ||
|
eb30a2d9e2 | ||
|
cf777840be | ||
|
efec137a10 | ||
|
210bee7d76 | ||
|
534e70a2c4 | ||
|
0fcec384fd | ||
|
9d1c2feaf2 | ||
|
709b820f2c | ||
|
217f135006 | ||
|
64843588f8 | ||
|
f1a7e645e4 | ||
|
e3ae54be9b | ||
|
2871883c7d | ||
|
3661a06206 | ||
|
436b9a455a | ||
|
5418b57325 | ||
|
376815c746 | ||
|
b76bb5730c | ||
|
7c4fc7a700 | ||
|
62dc99e9c6 | ||
|
ccee83f92d | ||
|
0027ef3ec4 | ||
|
32d286cb50 | ||
|
7017b057ea | ||
|
bb3780d31d | ||
|
2954b72765 | ||
|
13f6457fbd | ||
|
29006d1e93 | ||
|
301d0e81a0 | ||
|
4002c01134 | ||
|
64d53e0fe6 | ||
|
d1fb454772 | ||
|
cdcf9c6a96 | ||
|
9d7c80a147 | ||
|
beae915836 | ||
|
a6a199ad50 | ||
|
328faa3a5a | ||
|
cdaa995422 | ||
|
8617c29300 | ||
|
d2e21a38c6 | ||
|
a01573eff8 | ||
|
079b916d46 | ||
|
37275bcbf1 | ||
|
7d521e9f27 | ||
|
a7211c206b | ||
|
cb50841385 | ||
|
0d91902752 | ||
|
43405d037f | ||
|
45cf124566 | ||
|
0f500fab25 | ||
|
26c4364063 | ||
|
0c391693e4 | ||
|
92886f2ee9 | ||
|
991caa2191 | ||
|
f99521a851 | ||
|
972c96ba0f | ||
|
067473669b | ||
|
3b0c2ddc9b | ||
|
9068c3209b | ||
|
4651f0a941 | ||
|
6bef9222eb | ||
|
a97975acec | ||
|
48a3eb6d7d | ||
|
0b79b0a71d | ||
|
3b25a7549c | ||
|
1f18d34e8e | ||
|
8ff7f929e2 | ||
|
a891119b84 | ||
|
f0210c173a | ||
|
ea521ba7ee |
10
.pre-commit-config.yaml
Normal file
10
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
default_language_version:
|
||||
# force all unspecified python hooks to run python3
|
||||
python: python3
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v3.4.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
args: [--allow-multiple-documents]
|
65
.travis.yml
Normal file
65
.travis.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
import:
|
||||
- source: Alfresco/alfresco-build-tools:.travis.docker_login.yml@v1.0.1
|
||||
- source: Alfresco/alfresco-build-tools:.travis.java.yml@v1.0.1
|
||||
- source: Alfresco/alfresco-build-tools:.travis.pre-commit.yml@v1.0.1
|
||||
|
||||
dist: focal
|
||||
|
||||
git:
|
||||
depth: false
|
||||
quiet: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /feature\/.*/
|
||||
- /fix\/.*/
|
||||
- sdk-4.2
|
||||
|
||||
stages:
|
||||
- name: test
|
||||
if: commit_message !~ /\[skip tests\]/
|
||||
- name: release
|
||||
if: commit_message ~= /\[release\]/ AND branch = master AND type != push AND type != pull_request AND fork = false
|
||||
|
||||
env:
|
||||
global:
|
||||
- MAVEN_INSTALL_CMD="mvn clean install -B"
|
||||
|
||||
jobs:
|
||||
include:
|
||||
|
||||
- name: "current version"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD}
|
||||
|
||||
- name: "7.0 Enterprise"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD} -Penterprise-70-tests
|
||||
|
||||
- name: "7.0 Community"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD} -Pcommunity-70-tests
|
||||
|
||||
- name: "6.2 Enterprise"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD} -Penterprise-62-tests
|
||||
|
||||
- name: "6.2 Community"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD} -Pcommunity-62-tests
|
||||
|
||||
- name: "6.1 Enterprise"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD} -Penterprise-61-tests
|
||||
|
||||
- name: "6.1 Community"
|
||||
stage: test
|
||||
script:
|
||||
- ${MAVEN_INSTALL_CMD} -Pcommunity-61-tests
|
51
README.md
51
README.md
@@ -1,6 +1,13 @@
|
||||
# [](#features) Alfresco SDK
|
||||
|
||||
This is the home of the Alfresco SDK. The Alfresco SDK is used by developers to build extensions for the Alfresco Digital Business Platform. It is based on [Apache Maven](http://maven.apache.org/), compatible with major IDEs and enables Rapid Application Development (RAD) and Test Driven Development (TDD).
|
||||
|
||||
[](https://travis-ci.com/Alfresco/alfresco-sdk)
|
||||
[](https://github.com/pre-commit/pre-commit)
|
||||

|
||||
|
||||
This is the home of the Alfresco SDK. The Alfresco SDK is used by developers to build extensions for the Alfresco Digital Business Platform. It is based on
|
||||
[Apache Maven](http://maven.apache.org/), compatible with major IDEs and enables [Rapid Application Development (RAD)](https://en.wikipedia.org/wiki/Rapid_application_development)
|
||||
and [Test Driven Development (TDD)](https://en.wikipedia.org/wiki/Test-driven_development).
|
||||
|
||||
## License
|
||||
This project is released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license.
|
||||
@@ -8,6 +15,10 @@ If you are an Enterprise customer check the [Support](#alfresco-enterprise-custo
|
||||
|
||||
## News
|
||||
|
||||
- 2021-02: Alfresco SDK 4.2.0 released
|
||||
- 2019-10: Alfresco SDK 4.1.0 released
|
||||
- 2019-03: Alfresco SDK 4.0.0 released
|
||||
- 2019-03: Alfresco SDK 3.1.0 released
|
||||
- 2017-06-23: Alfresco SDK 3.0.1 released, [containing a critical bugfix](https://github.com/Alfresco/alfresco-sdk/issues/461)
|
||||
- 2017-04-01: Alfresco SDK 3.0.0 released
|
||||
- 2017-03-27: After years of hard work, countless iterations and gathering feedback, SDK 3.0 has finally been merged into the master branch, ready for release in the coming days
|
||||
@@ -20,20 +31,41 @@ If you are an Enterprise customer check the [Support](#alfresco-enterprise-custo
|
||||
|
||||
## User Getting Started
|
||||
|
||||
### Important Notice about Version Numbers
|
||||
|
||||
In Q4 2020, Alfresco Platform has undergone a major structural refactoring.
|
||||
|
||||
Depending on the Platform version desired, you might need to use SDK 4.1 instead of SDK 4.2.
|
||||
|
||||
- For Enterprise and Community versions of 7.x, SDK 4.2 must be used
|
||||
- For Enterprise versions of 6.0.x, 6.1.x, 6.2.x newer than November 2020, SDK 4.2 must be used
|
||||
- For Enterprise and Community versions of 6.0.x, 6.1.x, 6.2.x older than November 2020, SDK 4.1 must be used
|
||||
|
||||
A more precise compatibility matrix, with specific version numbers, is expected to be provided soon.
|
||||
|
||||
It's also important to remember that:
|
||||
|
||||
- Community Platform versions are built by [acs-community-packaging](https://github.com/Alfresco/acs-community-packaging)
|
||||
- Community Docker images are published on [Docker Hub](https://hub.docker.com/r/alfresco/alfresco-content-repository-community/tags?page=1&ordering=last_updated)
|
||||
- Enterprise Platform versions are built by [acs-packaging](https://github.com/Alfresco/acs-packaging)
|
||||
- Enterprise Docker images are published on *Quay.io*
|
||||
|
||||
### Latest Documentation
|
||||
To get started with **Alfresco SDK 4.0.x** (latest) visit the [Alfresco Documentation](https://docs.alfresco.com/6.0/concepts/dev-for-developers.html) (documentation pending).
|
||||
To get started with **Alfresco SDK 4.2.x** (latest) visit the [Alfresco Documentation](docs/README.md).
|
||||
|
||||
#### Documentation about Previous Versions
|
||||
| SDK Version | Alfresco Enterprise Version | Alfresco Community Version | Documentation |
|
||||
| ------------- |:-------------:| :-----:|:-----|
|
||||
| SDK 4.2 | Alfresco 6.0.x / 6.1.x / 6.2.x / 7.0.x | Alfresco 7.0.x | https://github.com/Alfresco/alfresco-sdk/tree/master/docs/README.md |
|
||||
| SDK 4.1 | Alfresco 6.0.x / 6.1.x / 6.2.x | Alfresco 6.0.x / 6.1.x / 6.2.x | https://github.com/Alfresco/alfresco-sdk/blob/sdk-4.1/docs/README.md |
|
||||
| SDK 4.0 | Alfresco 6.0.x / 6.1.x | Alfresco 6.0.x / 6.1.x | https://github.com/Alfresco/alfresco-sdk/blob/sdk-4.0/docs/README.md |
|
||||
| SDK 3.1 | Alfresco 5.2.x | Alfresco 5.2.x | http://docs.alfresco.com/5.2/concepts/sdk-intro.html |
|
||||
| SDK 3.0 | Alfresco 5.2.x | Alfresco 5.2.x | http://docs.alfresco.com/5.2/concepts/sdk-intro.html |
|
||||
| SDK 2.2 | Alfresco 5.1.x | Alfresco 5.1.x | https://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html |
|
||||
| SDK 2.1 | Alfresco 5.0.1 | Alfresco 5.0.d | https://docs.alfresco.com/sdk2.1/concepts/alfresco-sdk-intro.html |
|
||||
| SDK 2.0 | Alfresco 5.0.0 | Alfresco 5.0.c | https://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html |
|
||||
| SDK 1.1.1 | Alfresco 4.2.x | Alfresco 4.2.x | https://docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-intro.html |
|
||||
|
||||
|
||||
|
||||
## Reporting Issues and Community Support
|
||||
Report issues (and contribute!) [here](https://github.com/Alfresco/alfresco-sdk/issues?milestone=1&state=open) or join us on the [IRC Channel](http://chat.alfresco.com/).
|
||||
|
||||
@@ -43,12 +75,13 @@ please check the [SDK Support status](http://www.alfresco.com/services/subscript
|
||||
for the version you are using. If your version is in Limited or Full Support and you need help, visit the [Support Portal](http://support.alfresco.com).
|
||||
|
||||
## Maven repositories
|
||||
- As of version 2.0-beta-1, The Alfresco SDK is released in [Maven Central](http://search.maven.org/#search|ga|1|alfresco-sdk). Previous versions are available in the [Alfresco Artifacts Repository](https://artifacts.alfresco.com/).
|
||||
- As of version 2.0-beta-1, The Alfresco SDK is released in [Maven Central](http://search.maven.org/#search|ga|1|alfresco-sdk). Previous versions are available
|
||||
in the [Alfresco Artifacts Repository](https://artifacts.alfresco.com/).
|
||||
- Alfresco (Community and Enterprise) artifacts are hosted in the [Alfresco Artifacts Repository](https://artifacts.alfresco.com/).
|
||||
- Alfresco Community artifacts (JARs, WARs, AMPs, poms) and SDK artifacts are publicly available.
|
||||
|
||||
*NOTE:* By default the Alfresco SDK will use Community Edition releases but it can be configured to use Enterprise Edition releases. Enterprise and Premier customers can use the SDK with
|
||||
Enterprise Edition releases by following the process described in [Working with Enterprise](https://docs.alfresco.com/5.2/concepts/sdk-using-enterprise.html)
|
||||
*NOTE:* By default the Alfresco SDK will use Community Edition releases but it can be configured to use Enterprise Edition releases. Enterprise and Premier
|
||||
customers can use the SDK with Enterprise Edition releases by following the process described in [Working with Enterprise](docs/advanced-topics/working-with-enterprise/README.md).
|
||||
|
||||
### Alfresco Artifacts Repository
|
||||
|
||||
@@ -72,5 +105,9 @@ To test new unreleased (unsupported) features, you can use the following snippet
|
||||
</repository>
|
||||
```
|
||||
|
||||
## Docker registries
|
||||
- Alfresco Community Docker images are publicly available at the [Alfresco's Docker Hub profile](https://hub.docker.com/u/alfresco/).
|
||||
- Alfresco Enterprise Docker images are hosted at [Quay.io](https://quay.io/). Its configuration process is described in detail in [How to configure private Alfresco Docker registry](docs/advanced-topics/working-with-enterprise/enterprise-docker-registry.md).
|
||||
|
||||
## For Developers that want to contribute to the SDK
|
||||
See the [Developers Wiki page](https://github.com/Alfresco/alfresco-sdk/wiki/Developer-Wiki).
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-sdk-aggregator</artifactId>
|
||||
<version>4.0.0-beta-1</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<delimiters>
|
||||
<delimiter>@@</delimiter>
|
||||
</delimiters>
|
||||
<addDefaultExcludes>false</addDefaultExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@@ -10,9 +10,9 @@
|
||||
</requiredProperty>
|
||||
</requiredProperties>
|
||||
<modules>
|
||||
<module id="${rootArtifactId}-platform-jar"
|
||||
name="${rootArtifactId}-platform-jar"
|
||||
dir="__rootArtifactId__-platform-jar">
|
||||
<module id="${rootArtifactId}-platform"
|
||||
name="${rootArtifactId}-platform"
|
||||
dir="__rootArtifactId__-platform">
|
||||
<fileSets>
|
||||
<fileSet filtered="false" packaged="false" encoding="UTF-8">
|
||||
<directory>src/main/assembly</directory>
|
||||
@@ -50,9 +50,9 @@
|
||||
</fileSets>
|
||||
</module>
|
||||
|
||||
<module id="${rootArtifactId}-share-jar"
|
||||
name="${rootArtifactId}-share-jar"
|
||||
dir="__rootArtifactId__-share-jar">
|
||||
<module id="${rootArtifactId}-share"
|
||||
name="${rootArtifactId}-share"
|
||||
dir="__rootArtifactId__-share">
|
||||
<fileSets>
|
||||
<fileSet filtered="false" packaged="false" encoding="UTF-8">
|
||||
<directory>src/main/assembly</directory>
|
||||
@@ -97,7 +97,9 @@
|
||||
</fileSets>
|
||||
</module>
|
||||
|
||||
<module id="integration-tests" name="integration-tests" dir="integration-tests">
|
||||
<module id="${rootArtifactId}-integration-tests"
|
||||
name="${rootArtifactId}-integration-tests"
|
||||
dir="__rootArtifactId__-integration-tests">
|
||||
<fileSets>
|
||||
<fileSet filtered="true" packaged="true" encoding="UTF-8">
|
||||
<directory>src/main/java</directory>
|
||||
@@ -118,12 +120,6 @@
|
||||
name="${rootArtifactId}-platform-docker"
|
||||
dir="__rootArtifactId__-platform-docker">
|
||||
<fileSets>
|
||||
<fileSet encoding="UTF-8" filtered="false">
|
||||
<directory>src/main/docker/license</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet encoding="UTF-8" filtered="false">
|
||||
<directory>src/main/docker</directory>
|
||||
<includes>
|
||||
@@ -187,6 +183,7 @@
|
||||
<fileSet encoding="UTF-8" filtered="true">
|
||||
<directory></directory>
|
||||
<includes>
|
||||
<include>.gitignore</include>
|
||||
<include>run.sh</include>
|
||||
<include>run.bat</include>
|
||||
<include>README.md</include>
|
||||
|
38
archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/.gitignore
vendored
Normal file
38
archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
**.log*
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
# Eclipse
|
||||
.metadata
|
||||
.project
|
||||
.classpath
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# IntelliJ IDEA
|
||||
**.idea
|
||||
**.iml
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# macOS
|
||||
*.DS_Store
|
@@ -1,6 +1,6 @@
|
||||
# Alfresco AIO Project - SDK 4.0
|
||||
# Alfresco AIO Project - SDK 4.2
|
||||
|
||||
This is an All-In-One (AIO) project for Alfresco SDK 4.0.
|
||||
This is an All-In-One (AIO) project for Alfresco SDK 4.2.
|
||||
|
||||
Run with `./run.sh build_start` or `./run.bat build_start` and verify that it
|
||||
|
||||
@@ -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 and Share docker images, start the dockerised environment composed by ACS, Share, 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 and Share docker images, start the
|
||||
dockerised environment composed by ACS, Share, 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).
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<name>Integration Tests Module</name>
|
||||
<description>Integration Tests module for in-container integration testing - part of AIO - SDK 4.0</description>
|
||||
<description>Integration Tests module for in-container integration testing - part of AIO - SDK 4.2</description>
|
||||
<packaging>jar</packaging> <!-- Note. this just runs Integration Tests, but it needs to be a JAR otherwise
|
||||
nothing is compiled (i.e. you cannot set it to pom) -->
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
that is generated for the AIO project -->
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-platform-jar</artifactId>
|
||||
<artifactId>${rootArtifactId}-platform</artifactId>
|
||||
<version>${version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
@@ -42,7 +42,6 @@
|
||||
<plugin>
|
||||
<groupId>org.zeroturnaround</groupId>
|
||||
<artifactId>jrebel-maven-plugin</artifactId>
|
||||
<version>${jrebel.version}</version>
|
||||
<configuration>
|
||||
<rebelXmlDirectory>${project.build.testOutputDirectory}</rebelXmlDirectory>
|
||||
</configuration>
|
||||
@@ -52,7 +51,6 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -67,35 +65,11 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.19.1</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<acs.endpoint.path>${test.acs.endpoint.path}</acs.endpoint.path>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>integration-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify-test</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
@@ -50,10 +50,9 @@ public class DemoComponentIT extends AbstractAlfrescoIT {
|
||||
DemoComponent demoComponent = (DemoComponent) getApplicationContext().getBean("${package}.DemoComponent");
|
||||
NodeRef companyHome = demoComponent.getCompanyHome();
|
||||
assertNotNull(companyHome);
|
||||
String companyHomeName = (String) getServiceRegistry().getNodeService().getProperty(
|
||||
companyHome, ContentModel.PROP_NAME);
|
||||
assertNotNull(companyHomeName);
|
||||
assertEquals("Company Home", companyHomeName);
|
||||
String companyHomePath = getServiceRegistry().getNodeService().getPath(companyHome).toPrefixString(getServiceRegistry().getNamespaceService());
|
||||
assertNotNull(companyHomePath);
|
||||
assertEquals("/app:company_home", companyHomePath);
|
||||
}
|
||||
|
||||
@Test
|
@@ -19,9 +19,28 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-platform-jar</artifactId>
|
||||
<artifactId>${rootArtifactId}-platform</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-integration-tests</artifactId>
|
||||
<version>${version}</version>
|
||||
<scope>test</scope>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<!-- Add any additional AMPs or extension JARs here that you want to be deployed in Alfresco -->
|
||||
<!-- IMPORTANT:
|
||||
If using amp extensions only, add <includeTypes>amp</includeTypes> to the "collect-extensions" execution below.
|
||||
If using both amp and jar extensions, you have to add:
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>*</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
to each amp dependency definition.
|
||||
-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -29,75 +48,30 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<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>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-platform-jar</artifactId>
|
||||
<version>${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>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>${groupId}</groupId>
|
||||
<artifactId>integration-tests</artifactId>
|
||||
<version>${version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<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 do 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>
|
||||
@@ -106,7 +80,6 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources</id>
|
||||
@@ -123,6 +96,7 @@
|
||||
<excludes>
|
||||
<exclude>**/*.jar</exclude>
|
||||
<exclude>**/*.so</exclude>
|
||||
<exclude>**/*.gz</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
@@ -143,6 +117,7 @@
|
||||
<includes>
|
||||
<include>**/*.jar</include>
|
||||
<include>**/*.so</include>
|
||||
<include>**/*.gz</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
@@ -2,6 +2,8 @@ FROM ${docker.acs.image}:${alfresco.platform.version}
|
||||
|
||||
ARG TOMCAT_DIR=/usr/local/tomcat
|
||||
|
||||
USER root
|
||||
|
||||
# Copy Dockerfile to avoid an error if no JARs exist
|
||||
COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/
|
||||
|
||||
@@ -15,4 +17,6 @@ COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
|
||||
COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension
|
||||
|
||||
# Copy Dockerfile to avoid an error if no license file exists
|
||||
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
|
||||
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
|
||||
|
||||
USER ${USERNAME}
|
@@ -76,4 +76,12 @@ db.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco
|
||||
cifs.enabled=false
|
||||
ftp.enabled=false
|
||||
|
||||
csrf.filter.enabled=false
|
||||
csrf.filter.enabled=false
|
||||
|
||||
# Embedded broker without persistence
|
||||
messaging.broker.url=vm://localhost?broker.persistent=false
|
||||
|
||||
# Disable ATS
|
||||
transform.service.enabled=false
|
||||
local.transform.service.enabled=false
|
||||
legacy.transform.service.enabled=false
|
||||
|
@@ -26,12 +26,12 @@ disabledPlugins=Hibernate,Spring
|
||||
#
|
||||
# Load web application resources (such as HTML, JSP, CSS, ...) from this directory prior to default processing.
|
||||
# Use this setting to set to serve resources from source directory directly (e.g. src/main/webapp).
|
||||
extraWebappContext=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-platform-jar/target/classes/META-INF/resources;
|
||||
extraWebappContext=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-platform/target/classes/META-INF/resources;
|
||||
|
||||
# Load static web resources from different directory.
|
||||
#
|
||||
# This setting is dependent on application server plugin(Jetty, Tomcat, JBoss, ...)
|
||||
webappDir=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-platform-jar/target/classes/META-INF/resources;
|
||||
webappDir=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-platform/target/classes/META-INF/resources;
|
||||
|
||||
# Watch for changes in a directory (resources only).
|
||||
#
|
||||
|
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
|
||||
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
|
||||
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
|
||||
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
|
||||
|
||||
<process id="my-process">
|
||||
|
||||
<startEvent id="start" />
|
||||
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask" />
|
||||
|
||||
<userTask id="someTask" name="Activiti is awesome!" />
|
||||
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end" />
|
||||
|
||||
<endEvent id="end" />
|
||||
|
||||
</process>
|
||||
|
||||
</definitions>
|
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<name>Alfresco Platform/Repository JAR Module</name>
|
||||
<description>Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 4.0
|
||||
<description>Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 4.2
|
||||
</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- Add here any JAR or AMP dependency that needs to be deployed to ACS -->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
@@ -10,7 +10,7 @@
|
||||
<platformModules>
|
||||
<moduleDependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>some-platform-jar</artifactId>
|
||||
<artifactId>some-platform</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</moduleDependency>
|
||||
@@ -35,6 +35,11 @@
|
||||
<source>src/main/assembly/file-mapping.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
|
||||
<file>
|
||||
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
<fileSets>
|
@@ -10,7 +10,7 @@ any existing web resources in the Alfresco.WAR.
|
||||
`
|
||||
<moduleDependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>some-platform-jar</artifactId>
|
||||
<artifactId>some-platform</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</moduleDependency>
|
@@ -36,5 +36,10 @@
|
||||
</props>
|
||||
</list>
|
||||
</property>
|
||||
<property name="labels">
|
||||
<list>
|
||||
<value>alfresco/module/${project.artifactId}/messages/workflow-messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
@@ -0,0 +1 @@
|
||||
# Add here module-specific custom log4j.properties configuration
|
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Activiti My Process Workflow
|
||||
#
|
||||
my-process.workflow.title=My Process
|
||||
my-process.workflow.description=This is my custom process
|
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<definitions
|
||||
xmlns:activiti="http://activiti.org/bpmn"
|
||||
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" typeLanguage="http://www.w3.org/2001/XMLSchema"
|
||||
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
|
||||
|
||||
<process id="my-process">
|
||||
|
||||
<startEvent id="start" activiti:formKey="wf:submitAdhocTask"/>
|
||||
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask"/>
|
||||
|
||||
<userTask id="someTask" name="Activiti is awesome!" activiti:formKey="wf:adhocTask">
|
||||
<humanPerformer>
|
||||
<resourceAssignmentExpression>
|
||||
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
|
||||
</resourceAssignmentExpression>
|
||||
</humanPerformer>
|
||||
</userTask>
|
||||
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end"/>
|
||||
|
||||
<endEvent id="end"/>
|
||||
|
||||
</process>
|
||||
|
||||
</definitions>
|
@@ -19,7 +19,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-share-jar</artifactId>
|
||||
<artifactId>${rootArtifactId}-share</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -29,37 +29,18 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<executions>
|
||||
<!-- Copy the share extension -->
|
||||
<!-- Collect extensions (JARs or AMPs) declared in this module do be deployed to docker -->
|
||||
<execution>
|
||||
<id>copy-repo-extension</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${rootArtifactId}-share-jar</artifactId>
|
||||
<version>${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>
|
||||
@@ -68,7 +49,6 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources</id>
|
||||
|
@@ -27,12 +27,12 @@ disabledPlugins=Hibernate,Spring
|
||||
#
|
||||
# Load web application resources (such as HTML, JSP, CSS, ...) from this directory prior to default processing.
|
||||
# Use this setting to set to serve resources from source directory directly (e.g. src/main/webapp).
|
||||
extraWebappContext=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-share-jar/target/classes/META-INF/resources;
|
||||
extraWebappContext=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-share/target/classes/META-INF/resources;
|
||||
|
||||
# Load static web resources from different directory.
|
||||
#
|
||||
# This setting is dependent on application server plugin(Jetty, Tomcat, JBoss, ...)
|
||||
webappDir=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-share-jar/target/classes/META-INF/resources;
|
||||
webappDir=/usr/local/tomcat/hotswap-agent/${rootArtifactId}-share/target/classes/META-INF/resources;
|
||||
|
||||
# Watch for changes in a directory (resources only).
|
||||
#
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<name>Alfresco Share JAR Module</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Sample Share JAR Module (to be included in the share.war) - part of AIO - SDK 4.0</description>
|
||||
<description>Sample Share JAR Module (to be included in the share.war) - part of AIO - SDK 4.2</description>
|
||||
|
||||
<parent>
|
||||
<groupId>${groupId}</groupId>
|
||||
@@ -25,7 +25,6 @@
|
||||
<artifactId>share</artifactId>
|
||||
<classifier>classes</classifier>
|
||||
</dependency>
|
||||
<!-- Add here any JAR or AMP dependency that needs to be deployed to share -->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
@@ -10,7 +10,7 @@
|
||||
<shareModules>
|
||||
<moduleDependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>some-share-jar</artifactId>
|
||||
<artifactId>some-share</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</moduleDependency>
|
||||
@@ -35,6 +35,11 @@
|
||||
<source>src/main/assembly/file-mapping.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
|
||||
<file>
|
||||
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
<fileSets>
|
@@ -10,7 +10,7 @@ any existing web resources in the Share.WAR.
|
||||
`
|
||||
<moduleDependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>some-share-jar</artifactId>
|
||||
<artifactId>some-share</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>amp</type>
|
||||
</moduleDependency>
|
@@ -0,0 +1 @@
|
||||
# Add here module-specific custom log4j.properties configuration
|
@@ -7,7 +7,7 @@ services:
|
||||
dockerfile: ./Dockerfile
|
||||
context: ../../../${rootArtifactId}-share-docker/target
|
||||
environment:
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
|
||||
REPO_HOST: ${rootArtifactId}-acs
|
||||
REPO_PORT: 8080
|
||||
ports:
|
||||
@@ -19,7 +19,8 @@ services:
|
||||
dockerfile: ./Dockerfile
|
||||
context: ../../../${rootArtifactId}-platform-docker/target
|
||||
environment:
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
|
||||
JAVA_TOOL_OPTIONS: "${symbol_dollar}{keystore.settings}"
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
|
||||
ports:
|
||||
- "${symbol_dollar}{acs.port}:8080"
|
||||
- "${symbol_dollar}{acs.debug.port}:8888"
|
||||
@@ -33,6 +34,7 @@ services:
|
||||
POSTGRES_DB: alfresco
|
||||
POSTGRES_USER: alfresco
|
||||
POSTGRES_PASSWORD: alfresco
|
||||
command: postgres -c max_connections=300 -c log_min_messages=LOG
|
||||
ports:
|
||||
- "${symbol_dollar}{postgres.port}:5432"
|
||||
volumes:
|
||||
@@ -56,4 +58,4 @@ volumes:
|
||||
${rootArtifactId}-db-volume:
|
||||
external: true
|
||||
${rootArtifactId}-ass-volume:
|
||||
external: true
|
||||
external: true
|
||||
|
@@ -5,10 +5,14 @@
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${version}</version>
|
||||
<name>AIO - SDK 4.0</name>
|
||||
<description>All-In-One (AIO) project for SDK 4.0</description>
|
||||
<name>AIO - SDK 4.2</name>
|
||||
<description>All-In-One (AIO) project for SDK 4.2</description>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<prerequisites>
|
||||
<maven>3.3.0</maven>
|
||||
</prerequisites>
|
||||
|
||||
<properties>
|
||||
<!-- Alfresco Maven Plugin version to use -->
|
||||
<alfresco.sdk.version>@@alfresco.sdk.parent.version@@</alfresco.sdk.version>
|
||||
@@ -25,12 +29,12 @@
|
||||
<docker.acs.image>@@alfresco.platform.docker.image@@</docker.acs.image>
|
||||
<docker.share.image>@@alfresco.share.docker.image@@</docker.share.image>
|
||||
|
||||
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
|
||||
<jrebel.version>1.1.6</jrebel.version>
|
||||
<keystore.settings>@@keystore.settings@@</keystore.settings>
|
||||
|
||||
<!-- Compile with Java 8, default is 5 -->
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<activemq.version>@@activemq.version@@</activemq.version>
|
||||
|
||||
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
|
||||
<jrebel.version>1.1.8</jrebel.version>
|
||||
|
||||
<!-- Environment configuration properties -->
|
||||
<share.port>8180</share.port>
|
||||
@@ -51,7 +55,6 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -63,7 +66,6 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -81,6 +83,14 @@
|
||||
<version>${alfresco.sdk.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-all</artifactId>
|
||||
<version>${activemq.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -167,7 +177,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<nonFilteredFileExtensions> <!-- jpg, jpeg, gif, bmp and png are added automatically -->
|
||||
@@ -198,6 +208,53 @@
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.zeroturnaround</groupId>
|
||||
<artifactId>jrebel-maven-plugin</artifactId>
|
||||
<version>${jrebel.version}</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>integration-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify-test</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
@@ -209,14 +266,12 @@
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
|
||||
<plugins>
|
||||
<!-- 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>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<inherited>false</inherited>
|
||||
<!-- Run only for the AIO parent Project -->
|
||||
<executions>
|
||||
@@ -239,11 +294,60 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Compress JavaScript files and store as *-min.js -->
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>yuicompressor-maven-plugin</artifactId>
|
||||
<version>1.5.1</version>
|
||||
<executions>
|
||||
<!-- Compress the JS files under the assembly folder -->
|
||||
<execution>
|
||||
<id>compress-assembly</id>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
|
||||
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/webscripts/**</exclude>
|
||||
<exclude>**/site-webscripts/**</exclude>
|
||||
<exclude>**/META-INF/**</exclude>
|
||||
<exclude>**/*.lib.js</exclude>
|
||||
<exclude>**/*.css</exclude>
|
||||
<exclude>**/*-min.js</exclude>
|
||||
<exclude>**/*-min.css</exclude>
|
||||
</excludes>
|
||||
<force>true</force>
|
||||
<jswarn>false</jswarn>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- Compress the JS files under the resources folder -->
|
||||
<execution>
|
||||
<id>compress-resources</id>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/webscripts/**</exclude>
|
||||
<exclude>**/site-webscripts/**</exclude>
|
||||
<exclude>**/*.lib.js</exclude>
|
||||
<exclude>**/*.css</exclude>
|
||||
<exclude>**/*-min.js</exclude>
|
||||
<exclude>**/*-min.css</exclude>
|
||||
</excludes>
|
||||
<force>true</force>
|
||||
<jswarn>false</jswarn>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Hot reloading with JRebel -->
|
||||
<plugin>
|
||||
<groupId>org.zeroturnaround</groupId>
|
||||
<artifactId>jrebel-maven-plugin</artifactId>
|
||||
<version>${jrebel.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-rebel-xml</id>
|
||||
@@ -277,6 +381,46 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>java8</id>
|
||||
<activation>
|
||||
<jdk>[1.8,11.0)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>java11</id>
|
||||
<activation>
|
||||
<jdk>[11.0,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<!--
|
||||
Alfresco Maven Repositories
|
||||
-->
|
||||
|
@@ -12,7 +12,7 @@ IF NOT [%M2_HOME%]==[] (
|
||||
)
|
||||
|
||||
IF [%1]==[] (
|
||||
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
|
||||
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|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
|
||||
@@ -56,6 +64,7 @@ IF %1==reload_acs (
|
||||
IF %1==build_test (
|
||||
CALL :down
|
||||
CALL :build
|
||||
CALL :prepare-test
|
||||
CALL :start
|
||||
CALL :test
|
||||
CALL :tail_all
|
||||
@@ -83,24 +92,22 @@ EXIT /B 0
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d ${rootArtifactId}-acs
|
||||
EXIT /B 0
|
||||
:down
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" down
|
||||
if exist "%COMPOSE_FILE_PATH%" (
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" down
|
||||
)
|
||||
EXIT /B 0
|
||||
:build
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
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
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
call %MVN_EXEC% clean install -DskipTests -pl ${rootArtifactId}-share-jar
|
||||
call %MVN_EXEC% clean package -pl ${rootArtifactId}-share,${rootArtifactId}-share-docker
|
||||
EXIT /B 0
|
||||
:build_acs
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" kill ${rootArtifactId}-acs
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f ${rootArtifactId}-acs
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
call %MVN_EXEC% clean install -DskipTests -pl ${rootArtifactId}-platform-jar
|
||||
call %MVN_EXEC% clean package -pl ${rootArtifactId}-integration-tests,${rootArtifactId}-platform,${rootArtifactId}-platform-docker
|
||||
EXIT /B 0
|
||||
:tail
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
||||
@@ -108,11 +115,14 @@ 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 -pl ${rootArtifactId}-platform,${rootArtifactId}-integration-tests,${rootArtifactId}-platform-docker
|
||||
EXIT /B 0
|
||||
:test
|
||||
call %MVN_EXEC% verify -pl integration-tests
|
||||
call %MVN_EXEC% verify -pl ${rootArtifactId}-platform,${rootArtifactId}-integration-tests
|
||||
EXIT /B 0
|
||||
:purge
|
||||
docker volume rm ${rootArtifactId}-acs-volume
|
||||
docker volume rm ${rootArtifactId}-db-volume
|
||||
docker volume rm ${rootArtifactId}-ass-volume
|
||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||
docker volume rm -f ${rootArtifactId}-db-volume
|
||||
docker volume rm -f ${rootArtifactId}-ass-volume
|
||||
EXIT /B 0
|
@@ -1,7 +1,7 @@
|
||||
#set( $symbol_dollar = '$' )
|
||||
#!/bin/sh
|
||||
|
||||
export COMPOSE_FILE_PATH=${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml
|
||||
export COMPOSE_FILE_PATH="${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml"
|
||||
|
||||
if [ -z "${symbol_dollar}{M2_HOME}" ]; then
|
||||
export MVN_EXEC="mvn"
|
||||
@@ -13,57 +13,59 @@ start() {
|
||||
docker volume create ${rootArtifactId}-acs-volume
|
||||
docker volume create ${rootArtifactId}-db-volume
|
||||
docker volume create ${rootArtifactId}-ass-volume
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d
|
||||
}
|
||||
|
||||
start_share() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d ${rootArtifactId}-share
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d ${rootArtifactId}-share
|
||||
}
|
||||
|
||||
start_acs() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d ${rootArtifactId}-acs
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d ${rootArtifactId}-acs
|
||||
}
|
||||
|
||||
down() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH down
|
||||
if [ -f "${symbol_dollar}COMPOSE_FILE_PATH" ]; then
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" down
|
||||
fi
|
||||
}
|
||||
|
||||
purge() {
|
||||
docker volume rm ${rootArtifactId}-acs-volume
|
||||
docker volume rm ${rootArtifactId}-db-volume
|
||||
docker volume rm ${rootArtifactId}-ass-volume
|
||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||
docker volume rm -f ${rootArtifactId}-db-volume
|
||||
docker volume rm -f ${rootArtifactId}-ass-volume
|
||||
}
|
||||
|
||||
build() {
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
${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
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
${symbol_dollar}MVN_EXEC clean install -DskipTests=true -pl ${rootArtifactId}-share-jar
|
||||
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 package -pl ${rootArtifactId}-share,${rootArtifactId}-share-docker
|
||||
}
|
||||
|
||||
build_acs() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH kill ${rootArtifactId}-acs
|
||||
yes | docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH rm -f ${rootArtifactId}-acs
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
${symbol_dollar}MVN_EXEC clean install -DskipTests=true -pl ${rootArtifactId}-platform-jar
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" kill ${rootArtifactId}-acs
|
||||
yes | docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" rm -f ${rootArtifactId}-acs
|
||||
${symbol_dollar}MVN_EXEC clean package -pl ${rootArtifactId}-integration-tests,${rootArtifactId}-platform,${rootArtifactId}-platform-docker
|
||||
}
|
||||
|
||||
tail() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs -f
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs -f
|
||||
}
|
||||
|
||||
tail_all() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs --tail="all"
|
||||
}
|
||||
|
||||
prepare_test() {
|
||||
${symbol_dollar}MVN_EXEC verify -DskipTests=true -pl ${rootArtifactId}-platform,${rootArtifactId}-integration-tests,${rootArtifactId}-platform-docker
|
||||
}
|
||||
|
||||
test() {
|
||||
${symbol_dollar}MVN_EXEC verify -pl integration-tests
|
||||
${symbol_dollar}MVN_EXEC verify -pl ${rootArtifactId}-platform,${rootArtifactId}-integration-tests
|
||||
}
|
||||
|
||||
case "${symbol_dollar}1" in
|
||||
@@ -73,6 +75,13 @@ case "${symbol_dollar}1" in
|
||||
start
|
||||
tail
|
||||
;;
|
||||
build_start_it_supported)
|
||||
down
|
||||
build
|
||||
prepare_test
|
||||
start
|
||||
tail
|
||||
;;
|
||||
start)
|
||||
start
|
||||
tail
|
||||
@@ -100,6 +109,7 @@ case "${symbol_dollar}1" in
|
||||
build_test)
|
||||
down
|
||||
build
|
||||
prepare_test
|
||||
start
|
||||
test
|
||||
tail_all
|
||||
@@ -109,5 +119,5 @@ case "${symbol_dollar}1" in
|
||||
test
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ${symbol_dollar}0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
|
||||
echo "Usage: ${symbol_dollar}0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
|
||||
esac
|
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-sdk-aggregator</artifactId>
|
||||
<version>4.0.0-beta-1</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<delimiters>
|
||||
<delimiter>@@</delimiter>
|
||||
</delimiters>
|
||||
<addDefaultExcludes>false</addDefaultExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@@ -23,12 +23,6 @@
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet encoding="UTF-8" filtered="false">
|
||||
<directory>src/main/docker/license</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet encoding="UTF-8" filtered="false">
|
||||
<directory>src/main/docker</directory>
|
||||
<includes>
|
||||
@@ -81,6 +75,7 @@
|
||||
<fileSet encoding="UTF-8" filtered="true">
|
||||
<directory></directory>
|
||||
<includes>
|
||||
<include>.gitignore</include>
|
||||
<include>run.sh</include>
|
||||
<include>run.bat</include>
|
||||
<include>README.md</include>
|
||||
|
38
archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/.gitignore
vendored
Normal file
38
archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
**.log*
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
# Eclipse
|
||||
.metadata
|
||||
.project
|
||||
.classpath
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# IntelliJ IDEA
|
||||
**.idea
|
||||
**.iml
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# macOS
|
||||
*.DS_Store
|
@@ -1,6 +1,6 @@
|
||||
# Alfresco ACS JAR Module - SDK 4.0
|
||||
# Alfresco ACS JAR Module - SDK 4.2
|
||||
|
||||
This is an ACS project for Alfresco SDK 4.0.
|
||||
This is an ACS project for Alfresco SDK 4.2.
|
||||
|
||||
Run with `./run.sh build_start` or `./run.bat build_start` and verify that it
|
||||
|
||||
@@ -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).
|
||||
|
@@ -15,7 +15,8 @@ services:
|
||||
dockerfile: ./Dockerfile
|
||||
context: ../../../target
|
||||
environment:
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
|
||||
JAVA_TOOL_OPTIONS: "${symbol_dollar}{keystore.settings}"
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
|
||||
ports:
|
||||
- "${symbol_dollar}{acs.port}:8080"
|
||||
- "${symbol_dollar}{acs.debug.port}:8888"
|
||||
@@ -29,6 +30,7 @@ services:
|
||||
POSTGRES_DB: alfresco
|
||||
POSTGRES_USER: alfresco
|
||||
POSTGRES_PASSWORD: alfresco
|
||||
command: postgres -c max_connections=300 -c log_min_messages=LOG
|
||||
ports:
|
||||
- "${symbol_dollar}{postgres.port}:5432"
|
||||
volumes:
|
||||
@@ -52,4 +54,4 @@ volumes:
|
||||
${rootArtifactId}-db-volume:
|
||||
external: true
|
||||
${rootArtifactId}-ass-volume:
|
||||
external: true
|
||||
external: true
|
||||
|
@@ -1,430 +1,546 @@
|
||||
<?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/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${version}</version>
|
||||
<name>${artifactId} Platform/Repository JAR Module</name>
|
||||
<description>Platform/Repo JAR Module (to be included in the alfresco.war)</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<!-- Alfresco Maven Plugin version to use -->
|
||||
<alfresco.sdk.version>@@alfresco.sdk.parent.version@@</alfresco.sdk.version>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<!-- Properties used in dependency declarations, you don't need to change these -->
|
||||
<alfresco.groupId>org.alfresco</alfresco.groupId>
|
||||
<alfresco.bomDependencyArtifactId>@@alfresco.bomDependency.artifactId@@</alfresco.bomDependencyArtifactId>
|
||||
<alfresco.platform.version>@@alfresco.platform.version@@</alfresco.platform.version>
|
||||
<alfresco.share.version>@@alfresco.share.version@@</alfresco.share.version>
|
||||
|
||||
<!-- Docker images -->
|
||||
<docker.acs.image>@@alfresco.platform.docker.image@@</docker.acs.image>
|
||||
<docker.share.image>@@alfresco.share.docker.image@@</docker.share.image>
|
||||
|
||||
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
|
||||
<jrebel.version>1.1.6</jrebel.version>
|
||||
|
||||
<!-- Compile with Java 8, default is 5 -->
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
|
||||
<!-- Environment configuration properties -->
|
||||
<share.port>8180</share.port>
|
||||
<acs.host>${artifactId}-acs</acs.host>
|
||||
<acs.port>8080</acs.port>
|
||||
<acs.debug.port>8888</acs.debug.port>
|
||||
<postgres.port>5555</postgres.port>
|
||||
<!-- This parameter is only required for those cases in which ACS is not exposed in http://localhost:8080/alfresco (i.e. Windows Docker) -->
|
||||
<test.acs.endpoint.path></test.acs.endpoint.path>
|
||||
|
||||
</properties>
|
||||
|
||||
<!-- Libs used in Unit and Integration tests -->
|
||||
<!-- IMPORTANT - Test dependencies need to be here in the top parent POM as
|
||||
the Alfresco Maven IT Mojo runs as part of the parent project ... -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.9.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The main Alfresco Repo dependency for compiling Java code in src/main/java -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Bring in Alfresco RAD so we get access to AlfrescoTestRunner classes -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-rad</artifactId>
|
||||
<version>${alfresco.sdk.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- This will import the dependencyManagement for all artifacts in the selected Alfresco platform.
|
||||
NOTE: You still need to define dependencies in your POM, but you can omit version as
|
||||
it's enforced by this dependencyManagement.
|
||||
NOTE: It defaults to the latest version this SDK pom has been tested with,
|
||||
but alfresco version can/should be overridden in your project's pom
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>${alfresco.bomDependencyArtifactId}</artifactId>
|
||||
<version>${alfresco.platform.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 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>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<nonFilteredFileExtensions> <!-- jpg, jpeg, gif, bmp and png are added automatically -->
|
||||
<nonFilteredFileExtension>ftl</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>acp</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>pdf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ppt</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>pptx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>bin</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>lic</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>swf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>zip</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>msg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>jar</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>css</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ico</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>psd</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>js</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-compose-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.outputDirectory}/docker</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>docker</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>**/*.jar</exclude>
|
||||
<exclude>**/*.so</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources-non-filtered</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>**/*.jar</include>
|
||||
<include>**/*.so</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<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>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${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>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>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/extensions</outputDirectory>
|
||||
<includeScope>runtime</includeScope>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Runs the integration tests, any class that follows naming convention
|
||||
"**/IT*.java", "**/*IT.java", and "**/*ITCase.java" will be considered an integration test -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.19.1</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<acs.endpoint.path>${test.acs.endpoint.path}</acs.endpoint.path>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>integration-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify-test</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</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>
|
||||
<artifactId>jrebel-maven-plugin</artifactId>
|
||||
<version>${jrebel.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-rebel-xml</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- For more information about how to configure JRebel plugin see:
|
||||
http://manuals.zeroturnaround.com/jrebel/standalone/maven.html#maven-rebel-xml -->
|
||||
<classpath>
|
||||
<fallback>all</fallback>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.build.outputDirectory}</directory>
|
||||
<directory>${project.build.testOutputDirectory}</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</classpath>
|
||||
|
||||
<!--
|
||||
alwaysGenerate - default is false
|
||||
If 'false' - rebel.xml is generated if timestamps of pom.xml and the current rebel.xml file are not equal.
|
||||
If 'true' - rebel.xml will always be generated
|
||||
-->
|
||||
<alwaysGenerate>true</alwaysGenerate>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<!-- Filter the resource files in this project and do property substitutions -->
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<testResources>
|
||||
<!-- Filter the test resource files in this project and do property substitutions -->
|
||||
<testResource>
|
||||
<directory>src/test/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</testResource>
|
||||
</testResources>
|
||||
</build>
|
||||
|
||||
<!--
|
||||
Alfresco Maven Repositories
|
||||
-->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>alfresco-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>alfresco-public-snapshots</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>daily</updatePolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- Alfresco Enterprise Edition Artifacts, put username/pwd for server in settings.xml -->
|
||||
<repository>
|
||||
<id>alfresco-private-repository</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>alfresco-plugin-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>alfresco-plugin-public-snapshots</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>daily</updatePolicy>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
<?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/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${version}</version>
|
||||
<name>${artifactId} Platform/Repository JAR Module</name>
|
||||
<description>Platform/Repo JAR Module (to be included in the alfresco.war)</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<!-- Alfresco Maven Plugin version to use -->
|
||||
<alfresco.sdk.version>@@alfresco.sdk.parent.version@@</alfresco.sdk.version>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<!-- Properties used in dependency declarations, you don't need to change these -->
|
||||
<alfresco.groupId>org.alfresco</alfresco.groupId>
|
||||
<alfresco.bomDependencyArtifactId>@@alfresco.bomDependency.artifactId@@</alfresco.bomDependencyArtifactId>
|
||||
<alfresco.platform.version>@@alfresco.platform.version@@</alfresco.platform.version>
|
||||
<alfresco.share.version>@@alfresco.share.version@@</alfresco.share.version>
|
||||
|
||||
<!-- Docker images -->
|
||||
<docker.acs.image>@@alfresco.platform.docker.image@@</docker.acs.image>
|
||||
<docker.share.image>@@alfresco.share.docker.image@@</docker.share.image>
|
||||
|
||||
<keystore.settings>@@keystore.settings@@</keystore.settings>
|
||||
|
||||
<activemq.version>@@activemq.version@@</activemq.version>
|
||||
|
||||
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
|
||||
<jrebel.version>1.1.8</jrebel.version>
|
||||
|
||||
<!-- Environment configuration properties -->
|
||||
<share.port>8180</share.port>
|
||||
<acs.host>${artifactId}-acs</acs.host>
|
||||
<acs.port>8080</acs.port>
|
||||
<acs.debug.port>8888</acs.debug.port>
|
||||
<postgres.port>5555</postgres.port>
|
||||
<!-- This parameter is only required for those cases in which ACS is not exposed in http://localhost:8080/alfresco (i.e. Windows Docker) -->
|
||||
<test.acs.endpoint.path></test.acs.endpoint.path>
|
||||
|
||||
</properties>
|
||||
|
||||
<!-- Libs used in Unit and Integration tests -->
|
||||
<!-- IMPORTANT - Test dependencies need to be here in the top parent POM as
|
||||
the Alfresco Maven IT Mojo runs as part of the parent project ... -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.9.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- The main Alfresco Repo dependency for compiling Java code in src/main/java -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Bring in Alfresco RAD so we get access to AlfrescoTestRunner classes -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-rad</artifactId>
|
||||
<version>${alfresco.sdk.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>activemq-all</artifactId>
|
||||
<version>${activemq.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- This will import the dependencyManagement for all artifacts in the selected Alfresco platform.
|
||||
NOTE: You still need to define dependencies in your POM, but you can omit version as
|
||||
it's enforced by this dependencyManagement.
|
||||
NOTE: It defaults to the latest version this SDK pom has been tested with,
|
||||
but alfresco version can/should be overridden in your project's pom
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>${alfresco.bomDependencyArtifactId}</artifactId>
|
||||
<version>${alfresco.platform.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<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>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<nonFilteredFileExtensions> <!-- jpg, jpeg, gif, bmp and png are added automatically -->
|
||||
<nonFilteredFileExtension>ftl</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>acp</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>pdf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ppt</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>pptx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>bin</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>lic</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>swf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>zip</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>msg</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>jar</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>css</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>ico</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>psd</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>js</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-compose-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.outputDirectory}/docker</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>docker</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>**/*.jar</exclude>
|
||||
<exclude>**/*.so</exclude>
|
||||
<exclude>**/*.gz</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources-non-filtered</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>**/*.jar</include>
|
||||
<include>**/*.so</include>
|
||||
<include>**/*.gz</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</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>${project.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>${project.build.finalName}-tests.jar</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<executions>
|
||||
<!-- Copy the dependencies required for execute integration tests -->
|
||||
<execution>
|
||||
<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>
|
||||
</plugin>
|
||||
|
||||
<!-- Make sure we attach the tests so we can include them when running -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Runs the integration tests, any class that follows naming convention
|
||||
"**/IT*.java", "**/*IT.java", and "**/*ITCase.java" will be considered an integration test -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<acs.endpoint.path>${test.acs.endpoint.path}</acs.endpoint.path>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>integration-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify-test</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
<!-- Compress JavaScript files and store as *-min.js -->
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>yuicompressor-maven-plugin</artifactId>
|
||||
<version>1.5.1</version>
|
||||
<executions>
|
||||
<!-- Compress the JS files under the assembly folder -->
|
||||
<execution>
|
||||
<id>compress-assembly</id>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
|
||||
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/webscripts/**</exclude>
|
||||
<exclude>**/site-webscripts/**</exclude>
|
||||
<exclude>**/META-INF/**</exclude>
|
||||
<exclude>**/*.lib.js</exclude>
|
||||
<exclude>**/*.css</exclude>
|
||||
<exclude>**/*-min.js</exclude>
|
||||
<exclude>**/*-min.css</exclude>
|
||||
</excludes>
|
||||
<force>true</force>
|
||||
<jswarn>false</jswarn>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- Compress the JS files under the resources folder -->
|
||||
<execution>
|
||||
<id>compress-resources</id>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/webscripts/**</exclude>
|
||||
<exclude>**/site-webscripts/**</exclude>
|
||||
<exclude>**/*.lib.js</exclude>
|
||||
<exclude>**/*.css</exclude>
|
||||
<exclude>**/*-min.js</exclude>
|
||||
<exclude>**/*-min.css</exclude>
|
||||
</excludes>
|
||||
<force>true</force>
|
||||
<jswarn>false</jswarn>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Hot reloading with JRebel -->
|
||||
<plugin>
|
||||
<groupId>org.zeroturnaround</groupId>
|
||||
<artifactId>jrebel-maven-plugin</artifactId>
|
||||
<version>${jrebel.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-rebel-xml</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- For more information about how to configure JRebel plugin see:
|
||||
http://manuals.zeroturnaround.com/jrebel/standalone/maven.html#maven-rebel-xml -->
|
||||
<classpath>
|
||||
<fallback>all</fallback>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${project.build.outputDirectory}</directory>
|
||||
<directory>${project.build.testOutputDirectory}</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</classpath>
|
||||
|
||||
<!--
|
||||
alwaysGenerate - default is false
|
||||
If 'false' - rebel.xml is generated if timestamps of pom.xml and the current rebel.xml file are not equal.
|
||||
If 'true' - rebel.xml will always be generated
|
||||
-->
|
||||
<alwaysGenerate>true</alwaysGenerate>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<!-- Filter the resource files in this project and do property substitutions -->
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<testResources>
|
||||
<!-- Filter the test resource files in this project and do property substitutions -->
|
||||
<testResource>
|
||||
<directory>src/test/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</testResource>
|
||||
</testResources>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>java8</id>
|
||||
<activation>
|
||||
<jdk>[1.8,11.0)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>java11</id>
|
||||
<activation>
|
||||
<jdk>[11.0,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<!--
|
||||
Alfresco Maven Repositories
|
||||
-->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>alfresco-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>alfresco-public-snapshots</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>daily</updatePolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- Alfresco Enterprise Edition Artifacts, put username/pwd for server in settings.xml -->
|
||||
<repository>
|
||||
<id>alfresco-private-repository</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>alfresco-plugin-public</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>alfresco-plugin-public-snapshots</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>daily</updatePolicy>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
|
@@ -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
|
||||
@@ -65,11 +74,12 @@ EXIT /B %ERRORLEVEL%
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d
|
||||
EXIT /B 0
|
||||
:down
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" down
|
||||
if exist "%COMPOSE_FILE_PATH%" (
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" down
|
||||
)
|
||||
EXIT /B 0
|
||||
:build
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
call %MVN_EXEC% clean install -DskipTests
|
||||
call %MVN_EXEC% clean package
|
||||
EXIT /B 0
|
||||
:tail
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
||||
@@ -77,11 +87,14 @@ 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
|
||||
:purge
|
||||
docker volume rm ${rootArtifactId}-acs-volume
|
||||
docker volume rm ${rootArtifactId}-db-volume
|
||||
docker volume rm ${rootArtifactId}-ass-volume
|
||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||
docker volume rm -f ${rootArtifactId}-db-volume
|
||||
docker volume rm -f ${rootArtifactId}-ass-volume
|
||||
EXIT /B 0
|
@@ -1,7 +1,7 @@
|
||||
#set( $symbol_dollar = '$' )
|
||||
#!/bin/sh
|
||||
|
||||
export COMPOSE_FILE_PATH=${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml
|
||||
export COMPOSE_FILE_PATH="${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml"
|
||||
|
||||
if [ -z "${symbol_dollar}{M2_HOME}" ]; then
|
||||
export MVN_EXEC="mvn"
|
||||
@@ -13,30 +13,35 @@ start() {
|
||||
docker volume create ${rootArtifactId}-acs-volume
|
||||
docker volume create ${rootArtifactId}-db-volume
|
||||
docker volume create ${rootArtifactId}-ass-volume
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d
|
||||
}
|
||||
|
||||
down() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH down
|
||||
if [ -f "${symbol_dollar}COMPOSE_FILE_PATH" ]; then
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" down
|
||||
fi
|
||||
}
|
||||
|
||||
purge() {
|
||||
docker volume rm ${rootArtifactId}-acs-volume
|
||||
docker volume rm ${rootArtifactId}-db-volume
|
||||
docker volume rm ${rootArtifactId}-ass-volume
|
||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||
docker volume rm -f ${rootArtifactId}-db-volume
|
||||
docker volume rm -f ${rootArtifactId}-ass-volume
|
||||
}
|
||||
|
||||
build() {
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
|
||||
${symbol_dollar}MVN_EXEC clean package
|
||||
}
|
||||
|
||||
tail() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs -f
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs -f
|
||||
}
|
||||
|
||||
tail_all() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs --tail="all"
|
||||
}
|
||||
|
||||
prepare_test() {
|
||||
${symbol_dollar}MVN_EXEC verify -DskipTests=true
|
||||
}
|
||||
|
||||
test() {
|
||||
@@ -50,6 +55,13 @@ case "${symbol_dollar}1" in
|
||||
start
|
||||
tail
|
||||
;;
|
||||
build_start_it_supported)
|
||||
down
|
||||
build
|
||||
prepare_test
|
||||
start
|
||||
tail
|
||||
;;
|
||||
start)
|
||||
start
|
||||
tail
|
||||
@@ -67,6 +79,7 @@ case "${symbol_dollar}1" in
|
||||
build_test)
|
||||
down
|
||||
build
|
||||
prepare_test
|
||||
start
|
||||
test
|
||||
tail_all
|
||||
@@ -76,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
|
@@ -35,6 +35,11 @@
|
||||
<source>src/main/assembly/file-mapping.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
|
||||
<file>
|
||||
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
<fileSets>
|
||||
|
@@ -2,6 +2,8 @@ FROM ${docker.acs.image}:${alfresco.platform.version}
|
||||
|
||||
ARG TOMCAT_DIR=/usr/local/tomcat
|
||||
|
||||
USER root
|
||||
|
||||
# Copy Dockerfile to avoid an error if no JARs exist
|
||||
COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/
|
||||
|
||||
@@ -15,4 +17,6 @@ COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
|
||||
COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension
|
||||
|
||||
# Copy Dockerfile to avoid an error if no license file exists
|
||||
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
|
||||
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
|
||||
|
||||
USER ${USERNAME}
|
@@ -76,4 +76,12 @@ db.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco
|
||||
cifs.enabled=false
|
||||
ftp.enabled=false
|
||||
|
||||
csrf.filter.enabled=false
|
||||
csrf.filter.enabled=false
|
||||
|
||||
# Embedded broker without persistence
|
||||
messaging.broker.url=vm://localhost?broker.persistent=false
|
||||
|
||||
# Disable ATS
|
||||
transform.service.enabled=false
|
||||
local.transform.service.enabled=false
|
||||
legacy.transform.service.enabled=false
|
@@ -36,5 +36,10 @@
|
||||
</props>
|
||||
</list>
|
||||
</property>
|
||||
<property name="labels">
|
||||
<list>
|
||||
<value>alfresco/module/${project.artifactId}/messages/workflow-messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
|
@@ -0,0 +1 @@
|
||||
# Add here module-specific custom log4j.properties configuration
|
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Activiti My Process Workflow
|
||||
#
|
||||
my-process.workflow.title=My Process
|
||||
my-process.workflow.description=This is my custom process
|
@@ -1,20 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
|
||||
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
|
||||
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
|
||||
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
|
||||
<definitions
|
||||
xmlns:activiti="http://activiti.org/bpmn"
|
||||
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" typeLanguage="http://www.w3.org/2001/XMLSchema"
|
||||
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
|
||||
|
||||
<process id="my-process">
|
||||
|
||||
<startEvent id="start" />
|
||||
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask" />
|
||||
|
||||
<userTask id="someTask" name="Activiti is awesome!" />
|
||||
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end" />
|
||||
<startEvent id="start" activiti:formKey="wf:submitAdhocTask"/>
|
||||
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask"/>
|
||||
|
||||
<endEvent id="end" />
|
||||
<userTask id="someTask" name="Activiti is awesome!" activiti:formKey="wf:adhocTask">
|
||||
<humanPerformer>
|
||||
<resourceAssignmentExpression>
|
||||
<formalExpression>${bpm_assignee.properties.userName}</formalExpression>
|
||||
</resourceAssignmentExpression>
|
||||
</humanPerformer>
|
||||
</userTask>
|
||||
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end"/>
|
||||
|
||||
<endEvent id="end"/>
|
||||
|
||||
</process>
|
||||
|
||||
|
@@ -0,0 +1,191 @@
|
||||
#set($symbol_pound='#')
|
||||
#set($symbol_dollar='$')
|
||||
#set($symbol_escape='\' )
|
||||
/**
|
||||
* Copyright (C) 2017 Alfresco Software Limited.
|
||||
* <p/>
|
||||
* This file is part of the Alfresco SDK project.
|
||||
* <p/>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ${package}.platformsample;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.rad.test.AbstractAlfrescoIT;
|
||||
import org.alfresco.rad.test.AlfrescoTestRunner;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.nodelocator.CompanyHomeNodeLocator;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Integration Test sample for a custom content model.
|
||||
* See {@link DemoComponentIT} for more info.
|
||||
*
|
||||
* @author martin.bergljung@alfresco.com
|
||||
* @since 3.0
|
||||
*/
|
||||
@RunWith(value = AlfrescoTestRunner.class)
|
||||
public class CustomContentModelIT extends AbstractAlfrescoIT {
|
||||
private static final String ACME_MODEL_NS = "{http://www.acme.org/model/content/1.0}";
|
||||
private static final String ACME_MODEL_LOCALNAME = "contentModel";
|
||||
private static final String ACME_DOCUMENT_TYPE = "document";
|
||||
private static final String ACME_SECURITY_CLASSIFIED_ASPECT = "securityClassified";
|
||||
private static final String ACME_DOCUMENT_ID_PROPNAME = "documentId";
|
||||
|
||||
@Test
|
||||
public void testCustomContentModelPresence() {
|
||||
Collection<QName> allContentModels = getServiceRegistry().getDictionaryService().getAllModels();
|
||||
QName customContentModelQName = createQName(ACME_MODEL_LOCALNAME);
|
||||
assertTrue("Custom content model " + customContentModelQName.toString() +
|
||||
" is not present", allContentModels.contains(customContentModelQName));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateAcmeDocument() {
|
||||
// Create the ACME Doc file
|
||||
QName type = createQName(ACME_DOCUMENT_TYPE);
|
||||
String textContent = "Hello World!";
|
||||
String documentId = "DOC001";
|
||||
Map<QName, Serializable> nodeProperties = new HashMap<>();
|
||||
nodeProperties.put(createQName(ACME_DOCUMENT_ID_PROPNAME), documentId);
|
||||
nodeProperties.put(createQName("securityClassification"), "Company Confidential");
|
||||
NodeRef nodeRef = createNode("AcmeFile.txt", type, nodeProperties);
|
||||
addFileContent(nodeRef, textContent);
|
||||
|
||||
// Add an Aspect to the file (could be a custom aspect...)
|
||||
Map<QName, Serializable> aspectProperties = new HashMap<>();
|
||||
aspectProperties.put(ContentModel.PROP_TITLE, "Some Doc Title");
|
||||
aspectProperties.put(ContentModel.PROP_DESCRIPTION, "Some Doc Description");
|
||||
getServiceRegistry().getNodeService().addAspect(nodeRef, ContentModel.ASPECT_TITLED, aspectProperties);
|
||||
|
||||
// Assert that the file is created correctly
|
||||
assertEquals("Invalid type", type, getServiceRegistry().getNodeService().getType(nodeRef));
|
||||
assertTrue("Missing security aspect",
|
||||
getServiceRegistry().getNodeService().hasAspect(nodeRef, createQName(ACME_SECURITY_CLASSIFIED_ASPECT)));
|
||||
assertTrue("Missing titled aspect",
|
||||
getServiceRegistry().getNodeService().hasAspect(nodeRef, ContentModel.ASPECT_TITLED));
|
||||
assertEquals("Invalid property value", documentId,
|
||||
getServiceRegistry().getNodeService().getProperty(nodeRef, createQName(ACME_DOCUMENT_ID_PROPNAME)));
|
||||
readTextContent(nodeRef).equals(textContent);
|
||||
|
||||
// Clean up node
|
||||
if (nodeRef != null) {
|
||||
getServiceRegistry().getNodeService().deleteNode(nodeRef);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ==================== Helper Methods ============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a QName for the ACME content model
|
||||
*
|
||||
* @param localname the local content model name without namespace specified
|
||||
* @return the full ACME QName including namespace
|
||||
*/
|
||||
private QName createQName(String localname) {
|
||||
return QName.createQName(ACME_MODEL_NS + localname);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new node, such as a file or a folder, with passed in type and properties
|
||||
*
|
||||
* @param name the name of the file or folder
|
||||
* @param type the content model type
|
||||
* @param properties the properties from the content model
|
||||
* @return the Node Reference for the newly created node
|
||||
*/
|
||||
private NodeRef createNode(String name, QName type, Map<QName, Serializable> properties) {
|
||||
NodeRef parentFolderNodeRef = getCompanyHomeNodeRef();
|
||||
QName associationType = ContentModel.ASSOC_CONTAINS;
|
||||
QName associationQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||
QName.createValidLocalName(name));
|
||||
properties.put(ContentModel.PROP_NAME, name);
|
||||
ChildAssociationRef parentChildAssocRef = getServiceRegistry().getNodeService().createNode(
|
||||
parentFolderNodeRef, associationType, associationQName, type, properties);
|
||||
|
||||
return parentChildAssocRef.getChildRef();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add some text content to a file node
|
||||
*
|
||||
* @param nodeRef the node reference for the file that should have some text content added to it
|
||||
* @param fileContent the text content
|
||||
*/
|
||||
private void addFileContent(NodeRef nodeRef, String fileContent) {
|
||||
boolean updateContentPropertyAutomatically = true;
|
||||
ContentWriter writer = getServiceRegistry().getContentService().getWriter(nodeRef, ContentModel.PROP_CONTENT,
|
||||
updateContentPropertyAutomatically);
|
||||
writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
|
||||
writer.setEncoding("UTF-8");
|
||||
writer.putContent(fileContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read text content for passed in file Node Reference
|
||||
*
|
||||
* @param nodeRef the node reference for a file containing text
|
||||
* @return the text content
|
||||
*/
|
||||
private String readTextContent(NodeRef nodeRef) {
|
||||
ContentReader reader = getServiceRegistry().getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT);
|
||||
if (reader == null) {
|
||||
return ""; // Maybe it was a folder after all
|
||||
}
|
||||
|
||||
InputStream is = reader.getContentInputStream();
|
||||
try {
|
||||
return IOUtils.toString(is, "UTF-8");
|
||||
} catch (IOException ioe) {
|
||||
throw new RuntimeException(ioe);
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the node reference for the /Company Home top folder in Alfresco.
|
||||
* Use the standard node locator service.
|
||||
*
|
||||
* @return the node reference for /Company Home
|
||||
*/
|
||||
private NodeRef getCompanyHomeNodeRef() {
|
||||
return getServiceRegistry().getNodeLocatorService().getNode(CompanyHomeNodeLocator.NAME, null, null);
|
||||
}
|
||||
}
|
@@ -0,0 +1,67 @@
|
||||
#set($symbol_pound='#')
|
||||
#set($symbol_dollar='$')
|
||||
#set($symbol_escape='\' )
|
||||
/**
|
||||
* Copyright (C) 2017 Alfresco Software Limited.
|
||||
* <p/>
|
||||
* This file is part of the Alfresco SDK project.
|
||||
* <p/>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ${package}.platformsample;
|
||||
|
||||
import org.alfresco.rad.test.AbstractAlfrescoIT;
|
||||
import org.alfresco.rad.test.AlfrescoTestRunner;
|
||||
import org.alfresco.rad.test.Remote;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
* Integration Test of the DemoComponent using the Alfresco Test Runner.
|
||||
* The Alfresco Test Runner (i.e. AlfrescoTestRunner.class) will check if it is running in an Alfresco instance,
|
||||
* if so it will execute normally locally. On the other hand, if it detects no
|
||||
* Alfresco Spring context, then it will make a call to a custom Web Script that
|
||||
* will execute this test in the running container remotely. The remote location is
|
||||
* determined by the @Remote config.
|
||||
*
|
||||
* @author martin.bergljung@alfresco.com
|
||||
* @since 3.0
|
||||
*/
|
||||
@RunWith(value = AlfrescoTestRunner.class)
|
||||
public class DemoComponentIT extends AbstractAlfrescoIT {
|
||||
|
||||
@Test
|
||||
public void testGetCompanyHome() {
|
||||
DemoComponent demoComponent = (DemoComponent) getApplicationContext().getBean("${package}.DemoComponent");
|
||||
NodeRef companyHome = demoComponent.getCompanyHome();
|
||||
assertNotNull(companyHome);
|
||||
String companyHomePath = getServiceRegistry().getNodeService().getPath(companyHome).toPrefixString(getServiceRegistry().getNamespaceService());
|
||||
assertNotNull(companyHomePath);
|
||||
assertEquals("/app:company_home", companyHomePath);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testChildNodesCount() {
|
||||
DemoComponent demoComponent = (DemoComponent) getApplicationContext().getBean("${package}.DemoComponent");
|
||||
NodeRef companyHome = demoComponent.getCompanyHome();
|
||||
int childNodeCount = demoComponent.childNodesCount(companyHome);
|
||||
assertNotNull(childNodeCount);
|
||||
// There are 7 folders by default under Company Home
|
||||
assertEquals(7, childNodeCount);
|
||||
}
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
#set($symbol_pound='#')
|
||||
#set($symbol_dollar='$')
|
||||
#set($symbol_escape='\' )
|
||||
/**
|
||||
* Copyright (C) 2017 Alfresco Software Limited.
|
||||
* <p/>
|
||||
* This file is part of the Alfresco SDK project.
|
||||
* <p/>
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ${package}.platformsample;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
* Integration Test (IT) for Hello World web script.
|
||||
*
|
||||
* @author martin.bergljung@alfresco.com
|
||||
* @version 1.0
|
||||
* @since 3.0
|
||||
*/
|
||||
public class HelloWorldWebScriptIT {
|
||||
|
||||
private static final String ACS_ENDPOINT_PROP = "acs.endpoint.path";
|
||||
private static final String ACS_DEFAULT_ENDPOINT = "http://localhost:8080/alfresco";
|
||||
|
||||
@Test
|
||||
public void testWebScriptCall() throws Exception {
|
||||
String webscriptURL = getPlatformEndpoint() + "/service/sample/helloworld";
|
||||
String expectedResponse = "Message: 'Hello from JS!' 'HelloFromJava'";
|
||||
|
||||
// Login credentials for Alfresco Repo
|
||||
CredentialsProvider provider = new BasicCredentialsProvider();
|
||||
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("admin", "admin");
|
||||
provider.setCredentials(AuthScope.ANY, credentials);
|
||||
|
||||
// Create HTTP Client with credentials
|
||||
CloseableHttpClient httpclient = HttpClientBuilder.create()
|
||||
.setDefaultCredentialsProvider(provider)
|
||||
.build();
|
||||
|
||||
// Execute Web Script call
|
||||
try {
|
||||
HttpGet httpget = new HttpGet(webscriptURL);
|
||||
HttpResponse httpResponse = httpclient.execute(httpget);
|
||||
assertEquals("Incorrect HTTP Response Status",
|
||||
HttpStatus.SC_OK, httpResponse.getStatusLine().getStatusCode());
|
||||
HttpEntity entity = httpResponse.getEntity();
|
||||
assertNotNull("Response from Web Script is null", entity);
|
||||
assertEquals("Incorrect Web Script Response", expectedResponse, EntityUtils.toString(entity));
|
||||
} finally {
|
||||
httpclient.close();
|
||||
}
|
||||
}
|
||||
|
||||
private String getPlatformEndpoint() {
|
||||
final String platformEndpoint = System.getProperty(ACS_ENDPOINT_PROP);
|
||||
return StringUtils.isNotBlank(platformEndpoint) ? platformEndpoint : ACS_DEFAULT_ENDPOINT;
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-sdk-aggregator</artifactId>
|
||||
<version>4.0.0-beta-1</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
<delimiters>
|
||||
<delimiter>@@</delimiter>
|
||||
</delimiters>
|
||||
<addDefaultExcludes>false</addDefaultExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@@ -80,6 +80,7 @@
|
||||
<fileSet encoding="UTF-8" filtered="true">
|
||||
<directory></directory>
|
||||
<includes>
|
||||
<include>.gitignore</include>
|
||||
<include>run.sh</include>
|
||||
<include>run.bat</include>
|
||||
<include>README.md</include>
|
||||
|
38
archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/.gitignore
vendored
Normal file
38
archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/.gitignore
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
**.log*
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
# Eclipse
|
||||
.metadata
|
||||
.project
|
||||
.classpath
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# IntelliJ IDEA
|
||||
**.idea
|
||||
**.iml
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# macOS
|
||||
*.DS_Store
|
@@ -1,6 +1,6 @@
|
||||
# Alfresco Share JAR Module - SDK 4.0
|
||||
# Alfresco Share JAR Module - SDK 4.2
|
||||
|
||||
This is a Share project for Alfresco SDK 4.0.
|
||||
This is a Share project for Alfresco SDK 4.2.
|
||||
|
||||
Run with `./run.sh build_start` or `./run.bat build_start` and verify that it
|
||||
|
||||
@@ -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
|
||||
|
||||
|
@@ -7,60 +7,67 @@ services:
|
||||
dockerfile: ./Dockerfile
|
||||
context: ../../../target
|
||||
environment:
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
|
||||
REPO_HOST: ${rootArtifactId}-acs
|
||||
REPO_PORT: 8080
|
||||
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
|
||||
REPO_HOST: ${symbol_dollar}{acs.host}
|
||||
REPO_PORT: ${symbol_dollar}{acs.port}
|
||||
ports:
|
||||
- "${symbol_dollar}{share.port}:8080"
|
||||
- "${symbol_dollar}{share.debug.port}:8888"
|
||||
${rootArtifactId}-acs:
|
||||
image: ${symbol_dollar}{docker.acs.image}:${symbol_dollar}{alfresco.platform.version}
|
||||
environment:
|
||||
JAVA_OPTS: "
|
||||
-Ddb.driver=org.postgresql.Driver
|
||||
-Ddb.username=alfresco
|
||||
-Ddb.password=alfresco
|
||||
-Ddb.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco
|
||||
-Dsolr.host=${rootArtifactId}-ass
|
||||
-Dsolr.port=8983
|
||||
-Dsolr.secureComms=none
|
||||
-Dsolr.base.url=/solr
|
||||
-Dindex.subsystem.name=solr6
|
||||
-Dcsrf.filter.enabled=false
|
||||
"
|
||||
ports:
|
||||
- "${symbol_dollar}{acs.port}:8080"
|
||||
volumes:
|
||||
- ${rootArtifactId}-acs-volume:/usr/local/tomcat/alf_data
|
||||
depends_on:
|
||||
- ${rootArtifactId}-postgres
|
||||
${rootArtifactId}-postgres:
|
||||
image: postgres:9.6
|
||||
environment:
|
||||
POSTGRES_DB: alfresco
|
||||
POSTGRES_USER: alfresco
|
||||
POSTGRES_PASSWORD: alfresco
|
||||
ports:
|
||||
- "${symbol_dollar}{postgres.port}:5432"
|
||||
volumes:
|
||||
- ${rootArtifactId}-db-volume:/var/lib/postgresql/data
|
||||
${rootArtifactId}-ass:
|
||||
image: alfresco/alfresco-search-services:1.2.0
|
||||
environment:
|
||||
SOLR_ALFRESCO_HOST: ${rootArtifactId}-acs
|
||||
SOLR_ALFRESCO_PORT: 8080
|
||||
SOLR_SOLR_HOST: ${rootArtifactId}-ass
|
||||
SOLR_SOLR_PORT: 8983
|
||||
SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
|
||||
ports:
|
||||
- "8983:8983"
|
||||
volumes:
|
||||
- ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/contentstore
|
||||
- ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/data
|
||||
volumes:
|
||||
${rootArtifactId}-acs-volume:
|
||||
external: true
|
||||
${rootArtifactId}-db-volume:
|
||||
external: true
|
||||
${rootArtifactId}-ass-volume:
|
||||
external: true
|
||||
# Optional
|
||||
# ${rootArtifactId}-acs:
|
||||
# image: ${symbol_dollar}{docker.acs.image}:${symbol_dollar}{alfresco.platform.version}
|
||||
# environment:
|
||||
# JAVA_OPTS: "
|
||||
# -Ddb.driver=org.postgresql.Driver
|
||||
# -Ddb.username=alfresco
|
||||
# -Ddb.password=alfresco
|
||||
# -Ddb.url=jdbc:postgresql://${rootArtifactId}-postgres:5432/alfresco
|
||||
# -Dsolr.host=${rootArtifactId}-ass
|
||||
# -Dsolr.port=8983
|
||||
# -Dsolr.secureComms=none
|
||||
# -Dsolr.base.url=/solr
|
||||
# -Dindex.subsystem.name=solr6
|
||||
# -Dcsrf.filter.enabled=false
|
||||
# -Dmessaging.broker.url=\"vm://localhost?broker.persistent=false\"
|
||||
# -Dtransform.service.enabled=false
|
||||
# -Dlocal.transform.service.enabled=false
|
||||
# -Dlegacy.transform.service.enabled=false
|
||||
# ${symbol_dollar}{keystore.settings}
|
||||
# "
|
||||
# ports:
|
||||
# - "${symbol_dollar}{acs.port}:8080"
|
||||
# volumes:
|
||||
# - ${rootArtifactId}-acs-volume:/usr/local/tomcat/alf_data
|
||||
# depends_on:
|
||||
# - ${rootArtifactId}-postgres
|
||||
# ${rootArtifactId}-postgres:
|
||||
# image: postgres:9.6
|
||||
# environment:
|
||||
# POSTGRES_DB: alfresco
|
||||
# POSTGRES_USER: alfresco
|
||||
# POSTGRES_PASSWORD: alfresco
|
||||
# command: postgres -c max_connections=300 -c log_min_messages=LOG
|
||||
# ports:
|
||||
# - "${symbol_dollar}{postgres.port}:5432"
|
||||
# volumes:
|
||||
# - ${rootArtifactId}-db-volume:/var/lib/postgresql/data
|
||||
# ${rootArtifactId}-ass:
|
||||
# image: alfresco/alfresco-search-services:1.2.0
|
||||
# environment:
|
||||
# SOLR_ALFRESCO_HOST: ${rootArtifactId}-acs
|
||||
# SOLR_ALFRESCO_PORT: 8080
|
||||
# SOLR_SOLR_HOST: ${rootArtifactId}-ass
|
||||
# SOLR_SOLR_PORT: 8983
|
||||
# SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
|
||||
# ports:
|
||||
# - "8983:8983"
|
||||
# volumes:
|
||||
# - ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/contentstore
|
||||
# - ${rootArtifactId}-ass-volume:/opt/alfresco-search-services/data
|
||||
#volumes:
|
||||
# ${rootArtifactId}-acs-volume:
|
||||
# external: true
|
||||
# ${rootArtifactId}-db-volume:
|
||||
# external: true
|
||||
# ${rootArtifactId}-ass-volume:
|
||||
# external: true
|
||||
|
@@ -25,12 +25,10 @@
|
||||
<docker.acs.image>@@alfresco.platform.docker.image@@</docker.acs.image>
|
||||
<docker.share.image>@@alfresco.share.docker.image@@</docker.share.image>
|
||||
|
||||
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
|
||||
<jrebel.version>1.1.6</jrebel.version>
|
||||
<keystore.settings>@@keystore.settings@@</keystore.settings>
|
||||
|
||||
<!-- Compile with Java 8, default is 5 -->
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
|
||||
<jrebel.version>1.1.8</jrebel.version>
|
||||
|
||||
<!-- Environment configuration properties -->
|
||||
<share.port>8180</share.port>
|
||||
@@ -96,12 +94,47 @@
|
||||
|
||||
<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>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<nonFilteredFileExtensions> <!-- jpg, jpeg, gif, bmp and png are added automatically -->
|
||||
@@ -164,83 +197,99 @@
|
||||
</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>${project.build.finalName}.jar</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Compress JavaScript files and store as *-min.js -->
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>yuicompressor-maven-plugin</artifactId>
|
||||
<version>1.5.1</version>
|
||||
<executions>
|
||||
<!-- Compress the JS files under the assembly folder -->
|
||||
<execution>
|
||||
<id>compress-assembly</id>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
|
||||
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/webscripts/**</exclude>
|
||||
<exclude>**/site-webscripts/**</exclude>
|
||||
<exclude>**/META-INF/**</exclude>
|
||||
<exclude>**/*.lib.js</exclude>
|
||||
<exclude>**/*.css</exclude>
|
||||
<exclude>**/*-min.js</exclude>
|
||||
<exclude>**/*-min.css</exclude>
|
||||
</excludes>
|
||||
<force>true</force>
|
||||
<jswarn>false</jswarn>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- Compress the JS files under the resources folder -->
|
||||
<execution>
|
||||
<id>compress-resources</id>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/webscripts/**</exclude>
|
||||
<exclude>**/site-webscripts/**</exclude>
|
||||
<exclude>**/*.lib.js</exclude>
|
||||
<exclude>**/*.css</exclude>
|
||||
<exclude>**/*-min.js</exclude>
|
||||
<exclude>**/*-min.css</exclude>
|
||||
</excludes>
|
||||
<force>true</force>
|
||||
<jswarn>false</jswarn>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<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-repo-extension</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${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>
|
||||
@@ -294,6 +343,46 @@
|
||||
</testResources>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>java8</id>
|
||||
<activation>
|
||||
<jdk>[1.8,11.0)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>java11</id>
|
||||
<activation>
|
||||
<jdk>[11.0,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<!--
|
||||
Alfresco Maven Repositories
|
||||
-->
|
||||
@@ -331,4 +420,4 @@
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
</project>
|
||||
|
@@ -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%
|
||||
|
||||
@@ -74,18 +61,17 @@ EXIT /B 0
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d ${rootArtifactId}-share
|
||||
EXIT /B 0
|
||||
:down
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" down
|
||||
if exist "%COMPOSE_FILE_PATH%" (
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" down
|
||||
)
|
||||
EXIT /B 0
|
||||
:build
|
||||
docker rmi alfresco-content-services-${rootArtifactId}:development
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
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
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
call %MVN_EXEC% clean install -DskipTests
|
||||
call %MVN_EXEC% clean package
|
||||
EXIT /B 0
|
||||
:tail
|
||||
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
|
||||
@@ -93,11 +79,8 @@ 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 ${rootArtifactId}-acs-volume
|
||||
docker volume rm ${rootArtifactId}-db-volume
|
||||
docker volume rm ${rootArtifactId}-ass-volume
|
||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||
docker volume rm -f ${rootArtifactId}-db-volume
|
||||
docker volume rm -f ${rootArtifactId}-ass-volume
|
||||
EXIT /B 0
|
@@ -1,7 +1,7 @@
|
||||
#set( $symbol_dollar = '$' )
|
||||
#!/bin/sh
|
||||
|
||||
export COMPOSE_FILE_PATH=${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml
|
||||
export COMPOSE_FILE_PATH="${symbol_dollar}{PWD}/target/classes/docker/docker-compose.yml"
|
||||
|
||||
if [ -z "${symbol_dollar}{M2_HOME}" ]; then
|
||||
export MVN_EXEC="mvn"
|
||||
@@ -13,45 +13,41 @@ start() {
|
||||
docker volume create ${rootArtifactId}-acs-volume
|
||||
docker volume create ${rootArtifactId}-db-volume
|
||||
docker volume create ${rootArtifactId}-ass-volume
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d
|
||||
}
|
||||
|
||||
start_share() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH up --build -d ${rootArtifactId}-share
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" up --build -d ${rootArtifactId}-share
|
||||
}
|
||||
|
||||
down() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH down
|
||||
if [ -f "${symbol_dollar}COMPOSE_FILE_PATH" ]; then
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" down
|
||||
fi
|
||||
}
|
||||
|
||||
purge() {
|
||||
docker volume rm ${rootArtifactId}-acs-volume
|
||||
docker volume rm ${rootArtifactId}-db-volume
|
||||
docker volume rm ${rootArtifactId}-ass-volume
|
||||
docker volume rm -f ${rootArtifactId}-acs-volume
|
||||
docker volume rm -f ${rootArtifactId}-db-volume
|
||||
docker volume rm -f ${rootArtifactId}-ass-volume
|
||||
}
|
||||
|
||||
build() {
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
${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
|
||||
docker rmi alfresco-share-${rootArtifactId}:development
|
||||
${symbol_dollar}MVN_EXEC clean install -DskipTests=true
|
||||
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 package
|
||||
}
|
||||
|
||||
tail() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs -f
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs -f
|
||||
}
|
||||
|
||||
tail_all() {
|
||||
docker-compose -f ${symbol_dollar}COMPOSE_FILE_PATH logs --tail="all"
|
||||
}
|
||||
|
||||
test() {
|
||||
${symbol_dollar}MVN_EXEC verify
|
||||
docker-compose -f "${symbol_dollar}COMPOSE_FILE_PATH" logs --tail="all"
|
||||
}
|
||||
|
||||
case "${symbol_dollar}1" in
|
||||
@@ -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
|
@@ -35,6 +35,11 @@
|
||||
<source>src/main/assembly/file-mapping.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
|
||||
<file>
|
||||
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
|
||||
<filtered>false</filtered>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
<fileSets>
|
||||
|
@@ -0,0 +1 @@
|
||||
# Add here module-specific custom log4j.properties configuration
|
@@ -17,7 +17,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco.maven</groupId>
|
||||
<artifactId>alfresco-sdk-aggregator</artifactId>
|
||||
<version>4.0.0-beta-1</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.8.1</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -78,6 +78,7 @@
|
||||
<org.slf4j.simpleLogger.showDateTime>false</org.slf4j.simpleLogger.showDateTime>
|
||||
<org.slf4j.simpleLogger.showThreadName>false</org.slf4j.simpleLogger.showThreadName>
|
||||
<org.slf4j.simpleLogger.showLogName>false</org.slf4j.simpleLogger.showLogName>
|
||||
<projectArtifactId>${project.version}</projectArtifactId>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@@ -17,7 +17,7 @@ public class AllInOneArchetypeIT extends AbstractArchetypeIT {
|
||||
return ArchetypeProperties.builder()
|
||||
.withArchetypeGroupId("org.alfresco.maven.archetype")
|
||||
.withArchetypeArtifactId("alfresco-allinone-archetype")
|
||||
.withArchetypeVersion("4.0.0-SNAPSHOT")
|
||||
.withArchetypeVersion(System.getProperty("projectArtifactId"))
|
||||
.withProjectGroupId("archetype.it")
|
||||
.withProjectArtifactId("allinone-test-run")
|
||||
.withProjectVersion("0.1-SNAPSHOT")
|
||||
|
@@ -17,7 +17,7 @@ public class PlatformJarArchetypeIT extends AbstractArchetypeIT {
|
||||
return ArchetypeProperties.builder()
|
||||
.withArchetypeGroupId("org.alfresco.maven.archetype")
|
||||
.withArchetypeArtifactId("alfresco-platform-jar-archetype")
|
||||
.withArchetypeVersion("4.0.0-SNAPSHOT")
|
||||
.withArchetypeVersion(System.getProperty("projectArtifactId"))
|
||||
.withProjectGroupId("archetype.it")
|
||||
.withProjectArtifactId("repojar-test-run")
|
||||
.withProjectVersion("0.1-SNAPSHOT")
|
||||
@@ -32,11 +32,19 @@ public class PlatformJarArchetypeIT extends AbstractArchetypeIT {
|
||||
LOGGER.info("Building the generated project {}", archetypeProperties.getProjectArtifactId());
|
||||
LOGGER.info("---------------------------------------------------------------------");
|
||||
|
||||
// Since creating the archetype was successful, we now want to actually build the generated project
|
||||
// Since creating the archetype was successful, we now want to actually build the generated project executing the integration tests
|
||||
// Execute a purge to ensure old data don't make the test fail
|
||||
ProcessBuilder purge = getProcessBuilder("purge");
|
||||
purge.start().waitFor();
|
||||
ProcessBuilder pb = getProcessBuilder("build_test");
|
||||
pb.start().waitFor();
|
||||
|
||||
// Verify the execution of the integration tests of the project were successful
|
||||
Verifier verifier = new Verifier(projectPath);
|
||||
verifier.setAutoclean(false);
|
||||
verifier.executeGoal("install");
|
||||
verifier.setLogFileName(LOG_FILENAME);
|
||||
printVerifierLog("PROJECT BUILD", verifier, LOGGER);
|
||||
verifier.verifyErrorFreeLog();
|
||||
verifier.verifyTextInLog("Tests run: 5, Failures: 0, Errors: 0, Skipped: 0");
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ public class ShareJarArchetypeIT extends AbstractArchetypeIT {
|
||||
return ArchetypeProperties.builder()
|
||||
.withArchetypeGroupId("org.alfresco.maven.archetype")
|
||||
.withArchetypeArtifactId("alfresco-share-jar-archetype")
|
||||
.withArchetypeVersion("4.0.0-SNAPSHOT")
|
||||
.withArchetypeVersion(System.getProperty("projectArtifactId"))
|
||||
.withProjectGroupId("archetype.it")
|
||||
.withProjectArtifactId("sharejar-test-run")
|
||||
.withProjectVersion("0.1-SNAPSHOT")
|
||||
|
58
docs/README.md
Normal file
58
docs/README.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
Title: Alfresco SDK 4.2
|
||||
Added: v3.0.0
|
||||
Last reviewed: 2021-02-09
|
||||
---
|
||||
# Alfresco SDK 4.2
|
||||
|
||||
Alfresco SDK 4.2 is a Maven based development kit that provides an easy to use approach to developing applications and extensions for Alfresco. With this
|
||||
SDK you can develop, package, test, run, document and release your Alfresco extension project.
|
||||
|
||||
For earlier releases of the Alfresco SDK, see the Previous versions of [http://docs.alfresco.com](http://docs.alfresco.com).
|
||||
|
||||
The Alfresco Software Development Kit (Alfresco SDK) is a fundamental tool provided by Alfresco to developers to build customizations and extensions for
|
||||
the Alfresco Digital Business Platform. It is based on [Apache Maven](http://maven.apache.org/) and [Docker](https://www.docker.com/) and is compatible with
|
||||
major IDEs. This enables Rapid Application Development (RAD) and Test Driven Development (TDD).
|
||||
|
||||
Alfresco SDK 4.2 is released under [Apache License version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) and supports Alfresco Content Services both
|
||||
in Community Edition and Enterprise Edition. If you're an Enterprise customer, please check the [Alfresco SDK Support status](https://www.alfresco.com/alfresco-product-support-status)
|
||||
for the version you're using. If your version is in Limited or Full Support and you need help, contact our Support team [http://support.alfresco.com](http://support.alfresco.com/).
|
||||
|
||||
Alfresco SDK 4.2 is a minor update to the SDK and provides support for Alfresco 7.0.x.
|
||||
|
||||
The 4.0 release takes advantage of Semantic Versioning ([SEMVER](http://semver.org/)), which means that this new release is not directly compatible with the
|
||||
previous releases of the SDK.
|
||||
|
||||
If you have existing projects that you wish to upgrade to SDK 4.2.x, the recommended approach is to generate a new project from our archetypes and move your
|
||||
code into place.
|
||||
|
||||
## Documentation Content
|
||||
|
||||
* [What's new?](whats-new.md)
|
||||
* [Getting started with Alfresco SDK 4.2](getting-started.md)
|
||||
* [Alfresco SDK Maven archetypes](mvn-archetypes.md)
|
||||
* [Working with generated projects](working-with-generated-projects/README.md)
|
||||
* [All-In-One project structure](working-with-generated-projects/structure-aio.md)
|
||||
* [Platform JAR project structure](working-with-generated-projects/structure-platform.md)
|
||||
* [Share JAR project structure](working-with-generated-projects/structure-share.md)
|
||||
* [Setting up your development environment](setting-up-your-development-environment/README.md)
|
||||
* [Setting up your development environment using Eclipse](setting-up-your-development-environment/dev-env-eclipse.md)
|
||||
* [Setting up your development environment using Intellij IDEA](setting-up-your-development-environment/dev-env-intellij.md)
|
||||
* [Advanced topics](advanced-topics/README.md)
|
||||
* [Switching Alfresco Content Services and Share versions](advanced-topics/switching-versions.md)
|
||||
* [Working with Enterprise](advanced-topics/working-with-enterprise/README.md)
|
||||
* [How to configure private Alfresco Nexus repository](advanced-topics/working-with-enterprise/enterprise-mvn-repo.md)
|
||||
* [How to configure private Alfresco Docker registry](advanced-topics/working-with-enterprise/enterprise-docker-registry.md)
|
||||
* [How to set up Alfresco Transform Service](advanced-topics/working-with-enterprise/alfresco-transform-service.md)
|
||||
* [Working with AMPs](advanced-topics/amps.md)
|
||||
* [Debugging](advanced-topics/debugging/README.md)
|
||||
* [Remote debugging using Eclipse](advanced-topics/debugging/debug-eclipse.md)
|
||||
* [Remote debugging using IntelliJ](advanced-topics/debugging/debug-intellij.md)
|
||||
* [Integration testing](advanced-topics/integration-testing/README.md)
|
||||
* [How SDK's integration tests work](advanced-topics/integration-testing/it-working.md)
|
||||
* [How to run SDK's integration tests](advanced-topics/integration-testing/it-running.md)
|
||||
* [Hot reloading](advanced-topics/hot-reloading/README.md)
|
||||
* [How to configure and use JRebel](advanced-topics/hot-reloading/jrebel.md)
|
||||
* [How to configure and use Hotswap Agent](advanced-topics/hot-reloading/hotswap-agent.md)
|
||||
* [Switching Alfresco Content Services database](advanced-topics/switching-dbs.md)
|
||||
* [Troubleshooting](troubleshooting.md)
|
9
docs/advanced-topics/README.md
Normal file
9
docs/advanced-topics/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
Title: Advanced topics
|
||||
Added: v3.0.0
|
||||
Last reviewed: 2021-02-09
|
||||
---
|
||||
# Advanced topics
|
||||
|
||||
This information provides more advanced topics that you might come in contact with when you have been working with an SDK project for a while. We will have a
|
||||
look at how you can work with AMPs, remote debugging, hot reloading, enable transformations and more.
|
96
docs/advanced-topics/alfresco-transform-service.md
Normal file
96
docs/advanced-topics/alfresco-transform-service.md
Normal file
@@ -0,0 +1,96 @@
|
||||
---
|
||||
Title: How to set up Alfresco Transform Service (Community)
|
||||
Added: v4.0.0
|
||||
Last reviewed: 2019-10-18
|
||||
---
|
||||
# How to set up Alfresco Transform Service (Community)
|
||||
|
||||
By default, the _Alfresco Transform Service_ (from now ATS) is not included in the basic configuration of the projects generated making use of the Alfresco
|
||||
SDK archetypes.
|
||||
|
||||
ATS is now supported in ACS Community and it is distributed as a composition of Docker containers. The docker images required for ATS are available in the
|
||||
Alfresco account at [Docker Hub](https://hub.docker.com/u/alfresco/).
|
||||
|
||||
In order to properly configure ATS in a project generated using the Alfresco SDK archetypes it is required to execute 2 steps:
|
||||
1. Add the containers that conform ATS to the Docker compose file.
|
||||
2. Configure the properties that are required to properly set up ATS.
|
||||
|
||||
## Adding the new containers
|
||||
|
||||
* Locate the Docker compose file (usually at `PROJECT_ROOT_PATH/docker/docker-compose.yml`) and add the containers that conform ATS (`alfresco-pdf-renderer`,
|
||||
`imagemagick`, `libreoffice`, `tika`, `transform-misc` and `activemq`):
|
||||
|
||||
```
|
||||
services:
|
||||
...
|
||||
alfresco-pdf-renderer:
|
||||
image: alfresco/alfresco-pdf-renderer:2.1.0-RC3
|
||||
environment:
|
||||
JAVA_OPTS: " -Xms256m -Xmx512m"
|
||||
ports:
|
||||
- 8090:8090
|
||||
imagemagick:
|
||||
image: alfresco/alfresco-imagemagick:2.1.0-RC3
|
||||
environment:
|
||||
JAVA_OPTS: " -Xms256m -Xmx512m"
|
||||
ports:
|
||||
- 8091:8090
|
||||
libreoffice:
|
||||
image: alfresco/alfresco-libreoffice:2.1.0-RC3
|
||||
environment:
|
||||
JAVA_OPTS: " -Xms256m -Xmx512m"
|
||||
ports:
|
||||
- 8092:8090
|
||||
tika:
|
||||
image: alfresco/alfresco-tika:2.1.0-RC3
|
||||
environment:
|
||||
JAVA_OPTS: " -Xms256m -Xmx512m"
|
||||
ports:
|
||||
- 8093:8090
|
||||
transform-misc:
|
||||
image: alfresco/alfresco-transform-misc:2.1.0-RC3
|
||||
environment:
|
||||
JAVA_OPTS: " -Xms256m -Xmx512m"
|
||||
ports:
|
||||
- 8094:8090
|
||||
activemq:
|
||||
image: alfresco/alfresco-activemq:5.15.8
|
||||
ports:
|
||||
- 8161:8161 # Web Console
|
||||
- 5672:5672 # AMQP
|
||||
- 61616:61616 # OpenWire
|
||||
- 61613:61613 # STOMP
|
||||
...
|
||||
```
|
||||
|
||||
* Check that you haven't any port conflict with other services in the Docker compose file.
|
||||
|
||||
## Adding the required configuration
|
||||
|
||||
* Locate the _Alfresco global properties_ file for docker (usually at `PROJECT_ROOT_PATH/PROJECT_ARTIFACT_ID-platform-docker/src/main/docker/alfresco-global.properties`)
|
||||
and add the ATS configuration properties:
|
||||
|
||||
```
|
||||
# Alfresco Transform Service
|
||||
local.transform.service.enabled=true
|
||||
localTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
|
||||
localTransform.imagemagick.url=http://imagemagick:8090/
|
||||
localTransform.libreoffice.url=http://libreoffice:8090/
|
||||
localTransform.tika.url=http://tika:8090/
|
||||
localTransform.misc.url=http://transform-misc:8090/
|
||||
|
||||
legacy.transform.service.enabled=true
|
||||
alfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
|
||||
jodconverter.url=http://libreoffice:8090/
|
||||
img.url=http://imagemagick:8090/
|
||||
tika.url=http://tika:8090/
|
||||
transform.misc.url=http://transform-misc:8090/
|
||||
|
||||
messaging.broker.url=failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true
|
||||
```
|
||||
|
||||
* Remove the old value of the properties: `messaging.broker.url`, `transform.service.enabled`, `local.transform.service.enabled` and
|
||||
`legacy.transform.service.enabled` in the same `alfresco-global.properties` file.
|
||||
|
||||
Once these 2 modifications are done, rebuild and restart all the services (`run.sh/run.bat build_start`) and ACS will use ATS to execute remote transformations
|
||||
asynchronously whenever possible.
|
280
docs/advanced-topics/amps.md
Normal file
280
docs/advanced-topics/amps.md
Normal file
@@ -0,0 +1,280 @@
|
||||
---
|
||||
Title: Working with AMPs
|
||||
Added: v3.0.0
|
||||
Last reviewed: 2021-02-09
|
||||
---
|
||||
# Working with AMPs
|
||||
|
||||
Since the early days of the Alfresco SDK, the Alfresco Module Packages (AMP) have been the way customizations were packaged. In Alfresco SDK 4.2 everything
|
||||
is packaged as a JAR by default, while the AMPs are still available as an optional assembly. This gives you much more control over packaging, and simple
|
||||
modules can easily be deployed as JARs.
|
||||
|
||||
The [Maven Assembly Plugin](http://maven.apache.org/plugins/maven-assembly-plugin/) allows you to control the final artifacts that Maven builds. You add the
|
||||
plugin configuration and point it to an XML file that contains the full configuration on the artifact we want to produce.
|
||||
|
||||
## Building AMPs with Alfresco SDK 4
|
||||
|
||||
To build AMPs the SDK ships a default assembly XML file that will tell the assembly plugin how to produce an AMP file. You will find this file in
|
||||
`src/main/assembly/amp.xml` (in the case of All-In-One project you'll find one descriptor for the platform JAR module and another for the share JAR module).
|
||||
The plugin configuration is already present in your `pom.xml` file, as shown:
|
||||
|
||||
```
|
||||
<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>
|
||||
```
|
||||
|
||||
This section is commented out by default.
|
||||
|
||||
1. To produce both a JAR file and an AMP, remove the comments and run the `mvn package` command.
|
||||
|
||||
Now you have full control over how your AMPs are built. If you want to change the content of the AMP, you can change the assembly `amp.xml` and tailor it
|
||||
to your needs.
|
||||
|
||||
## Installing AMPs with the SDK
|
||||
|
||||
The projects created from the Alfresco SDK 4.2 archetypes are configured to deploy either JARs or AMPs to the ACS / Share docker container. The only thing to
|
||||
do is modify the `pom.xml` file of the corresponding docker module / project in order to properly configure the dependencies and the Maven dependency plugin.
|
||||
|
||||
### All-In-One project
|
||||
|
||||
1. Modify the platform JAR dependency from the file `PROJECT_ARTIFACT_ID-platform-docker/pom.xml` to set the type of dependency to `amp`:
|
||||
|
||||
```
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>sample-module-platform</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<type>amp</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
2. Add the `<includeTypes>amp</includeTypes>` to the `collect-extensions` execution in maven-dependency-plugin plugin build configuration in the same file:
|
||||
|
||||
```
|
||||
<!-- Collect extensions (JARs or AMPs) declared in this module do 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>
|
||||
<includeTypes>amp</includeTypes>
|
||||
</configuration>
|
||||
</execution>
|
||||
```
|
||||
|
||||
3. Repeat these steps for the share module in the file `PROJECT_ARTIFACT_ID-share-docker/pom.xml`.
|
||||
|
||||
### Platform / Share project
|
||||
|
||||
1. Modify the Maven Resource Plugin in the file `pom.xml` to set the platform / share JAR artifact to copy to `amp`:
|
||||
|
||||
```
|
||||
<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>${project.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
|
||||
install the packaged AMPs in ACS / Share.
|
||||
|
||||
## Installing 3rd party AMPs
|
||||
|
||||
Installing 3rd party AMPs to the projects is pretty simple. The only requirement is adding the dependency to the project. The default configuration installs
|
||||
any AMPs set as a maven dependency in the corresponding Docker image. It is important to remember that ACS and Share are separated containers, so you'll need
|
||||
to add the dependency in the corresponding docker module in case of an All-In-One project.
|
||||
|
||||
Here is an example of how to install Florian Maul's Javascript Console.
|
||||
|
||||
```
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>sample-module-platform-docker</artifactId>
|
||||
<name>Alfresco Platform/Repository Docker Module</name>
|
||||
<description>Platform/Repo Docker Module to generate the final Docker image</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>sample-module</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>sample-module-platform</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Javascript Console AMP -->
|
||||
<dependency>
|
||||
<groupId>de.fmaul</groupId>
|
||||
<artifactId>javascript-console-repo</artifactId>
|
||||
<version>0.6</version>
|
||||
<type>amp</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
...
|
||||
</project>
|
||||
```
|
||||
|
||||
Another option for installing 3rd party AMPs to the projects is to have the amps local to the project. In this approach the amp file, the amp local to the project will be copied and applied from the Docker file. To use local amp you need to:
|
||||
1. Modify the <project>-platform-docker/pom.xml
|
||||
2. Create directory: <project>-platform-docker/src/main/docker/extensions
|
||||
3. Copy the amp file into <project>-platform-docker/src/main/docker/extensions
|
||||
|
||||
The project Dockerfile contains directives to apply amp to Alfresco image
|
||||
|
||||
|
||||
in the build element of ./workshop-sdk4-platform-docker/pom.xml,
|
||||
exclude *.amp in the copy-and-filter-docker-resources execution step:
|
||||
```
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>true</filtering>
|
||||
<excludes>
|
||||
<exclude>**/*.jar</exclude>
|
||||
<exclude>**/*.so</exclude>
|
||||
<exclude>**/*.gz</exclude>
|
||||
<exclude>**/*.amp</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
```
|
||||
|
||||
include *.amp in the copy-and-filter-docker-resources-non-filtered
|
||||
|
||||
```
|
||||
<execution>
|
||||
<id>copy-and-filter-docker-resources-non-filtered</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/docker</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>**/*.jar</include>
|
||||
<include>**/*.so</include>
|
||||
<include>**/*.gz</include>
|
||||
<include>**/*.amp</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
```
|
||||
|
||||
|
||||
## Controlling the order AMPs are applied
|
||||
|
||||
Under some specific circumstances it is necessary to apply different AMPs in a development project in a precise order. The default configuration of the
|
||||
projects generated using the Alfresco SDK 4.2 archetypes doesn't specify any concrete order applying the AMPs to the ACS/Share installation.
|
||||
|
||||
Anyway, that order can be controlled modifying slightly the configuration of the custom Docker images in the project. For instance, let's say we have three
|
||||
third party AMPs that we want to apply in the next order `third-party-amp-01.amp -> third-party-amp-02.amp -> third-party-amp-03.amp`. In this example, we're
|
||||
going to consider we need to apply them to a platform JAR module (the process would be the same for a Share module, simply changing the path of the files).
|
||||
|
||||
1. Follow the steps described in the section [Installing 3rd party AMPs](#installing-3rd-party-amps) to include all the AMPs dependencies.
|
||||
|
||||
2. Locate the `Dockerfile` under the folder `src/main/docker`. In this file, there is a section that copies and applies the AMPs to the ACS installation.
|
||||
|
||||
```
|
||||
# Copy Dockerfile to avoid an error if no AMPs exist
|
||||
COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps/
|
||||
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
|
||||
$TOMCAT_DIR/amps $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force
|
||||
```
|
||||
|
||||
3. Replace the `RUN` command to execute one installation of AMP each time and copy it three times, ensuring the installation is executed in the required
|
||||
order:
|
||||
|
||||
```
|
||||
# Copy Dockerfile to avoid an error if no AMPs exist
|
||||
COPY Dockerfile extensions/*.amp $TOMCAT_DIR/amps/
|
||||
# Install third-party-amp-01
|
||||
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
|
||||
$TOMCAT_DIR/amps/third-party-amp-01.amp $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force
|
||||
# Install third-party-amp-02
|
||||
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
|
||||
$TOMCAT_DIR/amps/third-party-amp-02.amp $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force
|
||||
# Install third-party-amp-03
|
||||
RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
|
||||
$TOMCAT_DIR/amps/third-party-amp-03.amp $TOMCAT_DIR/webapps/alfresco -directory -nobackup -force
|
||||
```
|
||||
|
||||
4. Rebuild and restart the project (use `run.bat` instead in Windows):
|
||||
|
||||
```
|
||||
$ ./run.sh build_start
|
||||
```
|
||||
|
||||
At this point, you have configured your project to apply the AMPs in a specific order.
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user