Skip to content

Commit 3ebd750

Browse files
committed
Upgrade content-tutorial for SDK 4.2 and Alfresco 7.0
1 parent 29c9de0 commit 3ebd750

File tree

14 files changed

+133
-81
lines changed

14 files changed

+133
-81
lines changed

content/content-tutorial-cmis/pom.xml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
<sourceDirectory>src/main/java</sourceDirectory>
88
<plugins>
99
<plugin>
10-
<artifactId>maven-compiler-plugin</artifactId>
11-
<version>2.3.2</version>
10+
<groupId>org.apache.maven.plugins</groupId>
11+
<artifactId>maven-compiler-plugin</artifactId>
12+
<version>3.8.0</version>
1213
<configuration>
13-
<source>1.8</source>
14-
<target>1.8</target>
14+
<source>11</source>
15+
<target>11</target>
1516
</configuration>
1617
</plugin>
1718
</plugins>
@@ -27,12 +28,7 @@
2728
<dependency>
2829
<groupId>org.apache.chemistry.opencmis</groupId>
2930
<artifactId>chemistry-opencmis-client-impl</artifactId>
30-
<version>1.0.0</version>
31-
</dependency>
32-
<dependency>
33-
<groupId>org.alfresco.cmis.client</groupId>
34-
<artifactId>alfresco-opencmis-extension</artifactId>
35-
<version>1.0</version>
31+
<version>1.1.0</version>
3632
</dependency>
3733
<dependency>
3834
<groupId>com.someco</groupId>
@@ -43,17 +39,17 @@
4339
<dependency>
4440
<groupId>org.slf4j</groupId>
4541
<artifactId>slf4j-api</artifactId>
46-
<version>1.7.25</version>
42+
<version>1.7.31</version>
4743
</dependency>
4844
<dependency>
4945
<groupId>org.apache.logging.log4j</groupId>
5046
<artifactId>log4j-slf4j-impl</artifactId>
51-
<version>2.10.0</version>
47+
<version>2.14.1</version>
5248
</dependency>
5349
<dependency>
5450
<groupId>org.apache.logging.log4j</groupId>
5551
<artifactId>log4j-api</artifactId>
56-
<version>2.10.0</version>
52+
<version>2.14.1</version>
5753
</dependency>
5854
<dependency>
5955
<groupId>org.apache.logging.log4j</groupId>

content/content-tutorial/content-tutorial-integration-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>content-tutorial-integration-tests</artifactId>
66
<name>Integration Tests Module</name>
7-
<description>Integration Tests module for in-container integration testing - part of AIO - SDK 4.0</description>
7+
<description>Integration Tests module for in-container integration testing - part of AIO - SDK 4.2</description>
88
<packaging>jar</packaging> <!-- Note. this just runs Integration Tests, but it needs to be a JAR otherwise
99
nothing is compiled (i.e. you cannot set it to pom) -->
1010

content/content-tutorial/content-tutorial-platform/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<artifactId>content-tutorial-platform</artifactId>
55
<name>Alfresco Platform/Repository JAR Module</name>
6-
<description>Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 4.0
6+
<description>Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 4.2
77
</description>
88
<packaging>jar</packaging>
99

@@ -17,7 +17,6 @@
1717
</properties>
1818

1919
<dependencies>
20-
<!-- Add here any JAR or AMP dependency that needs to be deployed to ACS -->
2120
</dependencies>
2221

2322
<build>

content/content-tutorial/content-tutorial-platform/src/main/assembly/amp.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<assembly
2-
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
55

66
<!--
77
Note that the Module dependency specified in the configuration section for the Alfresco Maven Plugin
@@ -10,7 +10,7 @@
1010
<platformModules>
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-platform-jar</artifactId>
13+
<artifactId>some-platform</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>
@@ -35,6 +35,11 @@
3535
<source>src/main/assembly/file-mapping.properties</source>
3636
<filtered>false</filtered>
3737
</file>
38+
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
39+
<file>
40+
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
41+
<filtered>false</filtered>
42+
</file>
3843
</files>
3944

4045
<fileSets>
@@ -58,4 +63,4 @@
5863
</dependencySet>
5964
</dependencySets>
6065

61-
</assembly>
66+
</assembly>

content/content-tutorial/content-tutorial-platform/src/main/assembly/file-mapping.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ include.default=true
2424
# Map /web to / in AMP so we can override things like favicon.ico
2525
#
2626
/web=/
27+
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Web resources that should override out-of-the-box files
22

33
Put here any web resources that should override out-of-the-box
4-
web resources, such as favicon.ico. They will then end up in the
4+
web resources, such as favicon.ico. They will then end up in the
55
*/web* directory in the AMP, and applied to the WAR, and override
66
any existing web resources in the Alfresco.WAR.
77

@@ -10,11 +10,13 @@ any existing web resources in the Alfresco.WAR.
1010
`
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-platform-jar</artifactId>
13+
<artifactId>some-platform</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>
1717
`
18-
19-
**Important**. New web resources should not be located here, but instead
18+
19+
**Important**. New web resources should not be located here, but instead
2020
in the usual place in the *src/main/resources/META-INF/resources* directory.
21+
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module.
2+
## Define default values for all properties here.
3+
## System Administrators can override these values in environment specific configurations in
4+
## alfresco/tomcat/shared/classes/alfresco-global.properties.
5+
##

content/content-tutorial/content-tutorial-share/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>content-tutorial-share</artifactId>
66
<name>Alfresco Share JAR Module</name>
77
<packaging>jar</packaging>
8-
<description>Sample Share JAR Module (to be included in the share.war) - part of AIO - SDK 4.0</description>
8+
<description>Sample Share JAR Module (to be included in the share.war) - part of AIO - SDK 4.2</description>
99

1010
<parent>
1111
<groupId>com.someco</groupId>
@@ -25,7 +25,6 @@
2525
<artifactId>share</artifactId>
2626
<classifier>classes</classifier>
2727
</dependency>
28-
<!-- Add here any JAR or AMP dependency that needs to be deployed to share -->
2928
</dependencies>
3029

3130
<build>

content/content-tutorial/content-tutorial-share/src/main/assembly/amp.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<assembly
2-
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
55

66
<!--
77
Note that the Module dependency specified in the configuration section for the Alfresco Maven Plugin
@@ -10,7 +10,7 @@
1010
<shareModules>
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-share-jar</artifactId>
13+
<artifactId>some-share</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>
@@ -35,6 +35,11 @@
3535
<source>src/main/assembly/file-mapping.properties</source>
3636
<filtered>false</filtered>
3737
</file>
38+
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
39+
<file>
40+
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
41+
<filtered>false</filtered>
42+
</file>
3843
</files>
3944

4045
<fileSets>

content/content-tutorial/content-tutorial-share/src/main/assembly/web/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ any existing web resources in the Share.WAR.
1010
`
1111
<moduleDependency>
1212
<groupId>${project.groupId}</groupId>
13-
<artifactId>some-share-jar</artifactId>
13+
<artifactId>some-share</artifactId>
1414
<version>${project.version}</version>
1515
<type>amp</type>
1616
</moduleDependency>

content/content-tutorial/docker/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ services:
1818
dockerfile: ./Dockerfile
1919
context: ../../../content-tutorial-platform-docker/target
2020
environment:
21+
JAVA_TOOL_OPTIONS: "${keystore.settings}"
2122
CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
2223
ports:
2324
- "${acs.port}:8080"
@@ -56,4 +57,4 @@ volumes:
5657
content-tutorial-db-volume:
5758
external: true
5859
content-tutorial-ass-volume:
59-
external: true
60+
external: true

content/content-tutorial/pom.xml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,31 @@
1414

1515
<properties>
1616
<!-- Alfresco Maven Plugin version to use -->
17-
<alfresco.sdk.version>4.1.0</alfresco.sdk.version>
17+
<alfresco.sdk.version>4.2.0</alfresco.sdk.version>
1818

1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2020

2121
<!-- Properties used in dependency declarations, you don't need to change these -->
2222
<alfresco.groupId>org.alfresco</alfresco.groupId>
2323
<alfresco.bomDependencyArtifactId>acs-community-packaging</alfresco.bomDependencyArtifactId>
24-
<alfresco.platform.version>6.2.0-ea</alfresco.platform.version>
25-
<alfresco.share.version>6.2.0</alfresco.share.version>
24+
<alfresco.platform.version>7.0.0</alfresco.platform.version>
25+
<alfresco.share.version>7.0.0</alfresco.share.version>
2626

2727
<!-- Docker images -->
2828
<docker.acs.image>alfresco/alfresco-content-repository-community</docker.acs.image>
2929
<docker.share.image>alfresco/alfresco-share</docker.share.image>
3030

31+
<keystore.settings>-Dencryption.keystore.type=JCEKS
32+
-Dencryption.cipherAlgorithm=AES/CBC/PKCS5Padding
33+
-Dencryption.keyAlgorithm=AES
34+
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
35+
-Dmetadata-keystore.password=mp6yc0UD9e
36+
-Dmetadata-keystore.aliases=metadata
37+
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
38+
-Dmetadata-keystore.metadata.algorithm=AES</keystore.settings>
39+
40+
<activemq.version>5.16.1</activemq.version>
41+
3142
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
3243
<jrebel.version>1.1.8</jrebel.version>
3344

@@ -78,6 +89,14 @@
7889
<version>${alfresco.sdk.version}</version>
7990
<scope>test</scope>
8091
</dependency>
92+
93+
<dependency>
94+
<groupId>org.apache.activemq</groupId>
95+
<artifactId>activemq-all</artifactId>
96+
<version>${activemq.version}</version>
97+
<scope>test</scope>
98+
</dependency>
99+
81100
</dependencies>
82101

83102
<dependencyManagement>
@@ -443,11 +462,11 @@
443462
</snapshots>
444463
</pluginRepository>
445464
</pluginRepositories>
446-
<modules>
447-
<module>content-tutorial-platform</module>
448-
<module>content-tutorial-share</module>
449-
<module>content-tutorial-integration-tests</module>
450-
<module>content-tutorial-platform-docker</module>
451-
<module>content-tutorial-share-docker</module>
452-
</modules>
465+
<modules>
466+
<module>content-tutorial-platform</module>
467+
<module>content-tutorial-share</module>
468+
<module>content-tutorial-integration-tests</module>
469+
<module>content-tutorial-platform-docker</module>
470+
<module>content-tutorial-share-docker</module>
471+
</modules>
453472
</project>

content/content-tutorial/run.bat

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IF NOT [%M2_HOME%]==[] (
1111
)
1212

1313
IF [%1]==[] (
14-
echo "Usage: %0 {build_start|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
14+
echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
1515
GOTO END
1616
)
1717

@@ -22,6 +22,14 @@ IF %1==build_start (
2222
CALL :tail
2323
GOTO END
2424
)
25+
IF %1==build_start_it_supported (
26+
CALL :down
27+
CALL :build
28+
CALL :prepare-test
29+
CALL :start
30+
CALL :tail
31+
GOTO END
32+
)
2533
IF %1==start (
2634
CALL :start
2735
CALL :tail
@@ -55,6 +63,7 @@ IF %1==reload_acs (
5563
IF %1==build_test (
5664
CALL :down
5765
CALL :build
66+
CALL :prepare-test
5867
CALL :start
5968
CALL :test
6069
CALL :tail_all
@@ -82,36 +91,37 @@ EXIT /B 0
8291
docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d content-tutorial-acs
8392
EXIT /B 0
8493
:down
85-
docker-compose -f "%COMPOSE_FILE_PATH%" down
94+
if exist "%COMPOSE_FILE_PATH%" (
95+
docker-compose -f "%COMPOSE_FILE_PATH%" down
96+
)
8697
EXIT /B 0
8798
:build
88-
docker rmi alfresco-content-services-content-tutorial:development
89-
docker rmi alfresco-share-content-tutorial:development
90-
call %MVN_EXEC% clean install -DskipTests
99+
call %MVN_EXEC% clean package
91100
EXIT /B 0
92101
:build_share
93102
docker-compose -f "%COMPOSE_FILE_PATH%" kill content-tutorial-share
94103
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f content-tutorial-share
95-
docker rmi alfresco-share-content-tutorial:development
96-
call %MVN_EXEC% clean install -DskipTests -pl content-tutorial-share
104+
call %MVN_EXEC% clean package -pl content-tutorial-share,content-tutorial-share-docker
97105
EXIT /B 0
98106
:build_acs
99107
docker-compose -f "%COMPOSE_FILE_PATH%" kill content-tutorial-acs
100108
docker-compose -f "%COMPOSE_FILE_PATH%" rm -f content-tutorial-acs
101-
docker rmi alfresco-content-services-content-tutorial:development
102-
call %MVN_EXEC% clean install -DskipTests -pl content-tutorial-platform
109+
call %MVN_EXEC% clean package -pl content-tutorial-integration-tests,content-tutorial-platform,content-tutorial-platform-docker
103110
EXIT /B 0
104111
:tail
105112
docker-compose -f "%COMPOSE_FILE_PATH%" logs -f
106113
EXIT /B 0
107114
:tail_all
108115
docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all"
109116
EXIT /B 0
117+
:prepare-test
118+
call %MVN_EXEC% verify -DskipTests=true -pl content-tutorial-platform,content-tutorial-integration-tests,content-tutorial-platform-docker
119+
EXIT /B 0
110120
:test
111-
call %MVN_EXEC% verify -pl integration-tests
121+
call %MVN_EXEC% verify -pl content-tutorial-platform,content-tutorial-integration-tests
112122
EXIT /B 0
113123
:purge
114-
docker volume rm content-tutorial-acs-volume
115-
docker volume rm content-tutorial-db-volume
116-
docker volume rm content-tutorial-ass-volume
117-
EXIT /B 0
124+
docker volume rm -f content-tutorial-acs-volume
125+
docker volume rm -f content-tutorial-db-volume
126+
docker volume rm -f content-tutorial-ass-volume
127+
EXIT /B 0

0 commit comments

Comments
 (0)