Skip to content

Commit 1a9ced6

Browse files
committed
Upgrade maven-sdk tutorial to SDK 4.2 and Alfresco 6.2.
1 parent 1740023 commit 1a9ced6

File tree

5 files changed

+37
-32
lines changed

5 files changed

+37
-32
lines changed

maven-sdk/maven-sdk-tutorial/maven-sdk-tutorial-platform-docker/src/main/docker/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM ${docker.acs.image}:${alfresco.platform.version}
22

33
ARG TOMCAT_DIR=/usr/local/tomcat
44

5+
USER root
6+
57
# Copy Dockerfile to avoid an error if no JARs exist
68
COPY Dockerfile extensions/*.jar $TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/
79

@@ -15,4 +17,6 @@ COPY dev-log4j.properties $TOMCAT_DIR/shared/classes/alfresco/extension
1517
COPY disable-webscript-caching-context.xml $TOMCAT_DIR/shared/classes/alfresco/extension
1618

1719
# Copy Dockerfile to avoid an error if no license file exists
18-
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
20+
COPY Dockerfile license/*.* $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes/alfresco/extension/license/
21+
22+
USER ${USERNAME}

maven-sdk/maven-sdk-tutorial/maven-sdk-tutorial-platform-docker/src/main/docker/alfresco-global.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,9 @@ ftp.enabled=false
7676
csrf.filter.enabled=false
7777

7878
# Embedded broker without persistence
79-
messaging.broker.url=vm://localhost?broker.persistent=false
79+
messaging.broker.url=vm://localhost?broker.persistent=false
80+
81+
# Disable ATS
82+
transform.service.enabled=false
83+
local.transform.service.enabled=false
84+
legacy.transform.service.enabled=false

maven-sdk/maven-sdk-tutorial/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
<properties>
1616
<!-- Alfresco Maven Plugin version to use -->
17-
<alfresco.sdk.version>4.0.0</alfresco.sdk.version>
17+
<alfresco.sdk.version>4.1.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.1.2-ga</alfresco.platform.version>
25-
<alfresco.share.version>6.1.0-RC3</alfresco.share.version>
24+
<alfresco.platform.version>6.2.0-ea</alfresco.platform.version>
25+
<alfresco.share.version>6.2.0</alfresco.share.version>
2626

2727
<!-- Docker images -->
2828
<docker.acs.image>alfresco/alfresco-content-repository-community</docker.acs.image>
@@ -452,4 +452,4 @@
452452
<module>maven-sdk-tutorial-platform-docker</module>
453453
<module>maven-sdk-tutorial-share-docker</module>
454454
</modules>
455-
</project>
455+
</project>

maven-sdk/tutorial/tutorial.html

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ <h3 class="date">February, 2019</h3>
6161
<h1 id="license">License</h1>
6262
<div class="figure">
6363
<img src="./images/cc-by-sa-88x31.png" />
64-
6564
</div>
6665
<p>This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.</p>
6766
<h1 id="introduction">Introduction</h1>
@@ -83,17 +82,18 @@ <h2 id="alfresco-module-package-amp">Alfresco Module Package (AMP)</h2>
8382
<h2 id="alfresco-maven-sdk">Alfresco Maven SDK</h2>
8483
<p>The goal of the Maven-based SDK is to make it extremely easy for you to get started with Alfresco development. It consists of a project template (an &quot;archetype&quot; in Maven parlance) and some built-in smarts that make Maven understand how to create AMPs and deploy them to Alfresco.</p>
8584
<p>If you are writing your own custom application that is separate from the Alfresco and Share WARs you don't need the Alfresco Maven SDK. But if you intend to write code that runs within either of those web applications, the Alfresco Maven SDK is where you need to start.</p>
86-
<p>A quick word about versions. This tutorial assumes you are using Alfresco Maven SDK 4.0 which works with Alfresco 6.0.1 and higher. If you are using a version of Alfresco older than 6.0.1 but greater than or equal to 4.2.7, you can use version 3.0.1 of the SDK. The biggest difference between 4.0 and 3.0.1 is the use of Docker instead of an embedded Tomcat and in-memory database.</p>
85+
<p>A quick word about versions. This tutorial assumes you are using Alfresco Maven SDK 4.1 which works with Alfresco 6.2 and higher. If you are using a version of Alfresco older than 6.2 but greater than or equal to 6.0.1, you can use version 4.0 of the SDK. If you are using a version of Alfresco older than 6.0.1 but greater than or equal to 4.2.7, you can use version 3.0.1 of the SDK. The biggest difference between 4.0 and 3.0.1 is the use of Docker instead of an embedded Tomcat and in-memory database.</p>
8786
<p>If you are using a version of Alfresco newer than 4.0 but older than 4.2.7 you can use version 2.x of the SDK. You can use the 2.x version of the SDK with this and other tutorials if you must, but you'll almost surely be affected by some differences. If you are using a version of Alfresco older than 4.x you'll have to use the old Ant-based SDK. The rest of this document won't apply to you.</p>
8887
<p>Now you have a high-level understanding of Apache Maven, AMPs, and the Alfresco Maven SDK. It's time to see them in action.</p>
8988
<h1 id="your-first-project">Your First Project</h1>
9089
<p>Let me show you how easy it can be to get started with Alfresco development using the Alfresco Maven SDK. Before I start I'm going to assume you have the following installed:</p>
9190
<ul>
92-
<li>Java 1.8.0_201</li>
93-
<li>Apache Maven 3.3.9</li>
94-
<li>Alfresco Maven SDK 4.0 (No download necessary)</li>
95-
<li>Docker 18.09.2</li>
96-
<li>Docker Compose 1.23.2</li>
91+
<li>MacOS 10.15.4</li>
92+
<li>Java OpenJDK 11.0.2</li>
93+
<li>Apache Maven 3.6.3</li>
94+
<li>Alfresco Maven SDK 4.1 (No download necessary)</li>
95+
<li>Docker 19.03.8</li>
96+
<li>Docker Compose 1.25.4</li>
9797
</ul>
9898
<p>You don't need to download anything else. Seriously. Not even Alfresco.</p>
9999
<p>Here are the steps:</p>
@@ -167,7 +167,7 @@ <h2 id="other-commands-for-invoking-the-build">Other Commands for Invoking the B
167167
<h2 id="unit-integration-tests">Unit &amp; Integration Tests</h2>
168168
<p>You may have noticed that the default project includes a simple unit test in the platform module and some integration tests in the integration-tests module. By default, Maven will automatically run the unit tests and integration tests in your project unless you include <code>-DskipTests</code>.</p>
169169
<p>It's a good practice to make sure that your project always includes unit tests and to run them every time you build. Many organizations run CI (Continuous Integration) tools that depend on this being the case. Running <code>mvn test</code> will compile and run the project's unit tests.</p>
170-
<p>To run integration tests using SDK 4.0, first start up the server using <code>run.sh build_start</code>. Once it is running, do <code>run.sh test</code> to run the integration tests. You'll see something like:</p>
170+
<p>To run integration tests using the SDK, first start up the server using <code>run.sh build_start</code>. Once it is running, do <code>run.sh test</code> to run the integration tests. You'll see something like:</p>
171171
<pre><code>-------------------------------------------------------
172172
T E S T S
173173
-------------------------------------------------------
@@ -201,12 +201,10 @@ <h2 id="working-with-your-project-in-an-ide">Working With Your Project in an IDE
201201
<li><p>Select File, Import, Maven, Existing Maven Projects. Click Next.</p>
202202
<div class="figure">
203203
<img src="./images/import-maven-project.png" />
204-
205204
</div></li>
206205
<li><p>Specify the directory that contains the maven-sdk-tutorial folder. Eclipse will inspect that folder and show your project in the projects list. Make sure the checkbox next to the project name is checked, then click Next.</p>
207206
<div class="figure">
208207
<img src="./images/select-maven-project.png" />
209-
210208
</div></li>
211209
</ol>
212210
<p>After clicking Finish, the project is imported into your Eclipse workspace.</p>
@@ -253,30 +251,25 @@ <h1 id="creating-projects-from-within-eclipse">Creating Projects from Within Ecl
253251
<li><p>Specify $TUTORIAL_HOME, then click next.</p>
254252
<div class="figure">
255253
<img src="./images/new-maven-project.png" />
256-
257254
</div></li>
258255
<li><p>Click Configure so we can add Alfresco's catalog to the list.</p>
259256
<div class="figure">
260257
<img src="./images/select-an-archetype.png" />
261-
262258
</div></li>
263259
<li>Click Add Remote Catalog</li>
264260
<li><p>Specify &quot;https://nexus.alfresco.com/nexus/content/groups/public/archetype-catalog.xml&quot; as the Catalog File. Specify &quot;Alfresco Archetypes&quot; as the description. Then, click OK and OK again to close the Preferences panel.</p>
265261
<div class="figure">
266262
<img src="./images/add-archetype-catalog.png" />
267-
268263
</div></li>
269264
<li>Now select &quot;Alfresco Archetypes&quot; in the catalog and you'll see a bunch of archetypes show up in the list.</li>
270265
<li>Specify &quot;org.alfresco.maven.archetype&quot; in the filter and you'll see the same archetypes that were presented to you as options on the command line at the start of the tutorial.</li>
271266
<li><p>Select the alfresco-share-jar-archetype and click Next.</p>
272267
<div class="figure">
273268
<img src="./images/select-amp-archetype.png" />
274-
275269
</div></li>
276270
<li><p>Specify &quot;com.someco&quot; for the groupId and &quot;maven-sdk-tutorial-share&quot; as the artifactId, then click Finish.</p>
277271
<div class="figure">
278272
<img src="./images/specify-archetype-params.png" />
279-
280273
</div></li>
281274
</ol>
282275
<p>Now your new customization project is in your workspace. The next time you create a project using the archetype, it will be a few less steps because you won't have to add the catalog.</p>
@@ -289,7 +282,7 @@ <h1 id="other-topics-to-explore-on-your-own">Other Topics to Explore on Your Own
289282
</ul>
290283
<h1 id="where-to-find-more-information">Where to Find More Information</h1>
291284
<ul>
292-
<li>The <a href="https://docs.alfresco.com/5.2/concepts/sdk-intro.html">official documentation</a> on the Alfresco Maven SDK is on <a href="https://docs.alfresco.com" class="uri">https://docs.alfresco.com</a>.</li>
285+
<li>The <a href="https://docs.alfresco.com/5.2/concepts/sdk-intro.html">official documentation</a> on the Alfresco Maven SDK is on <a href="https://docs.alfresco.com">https://docs.alfresco.com</a>.</li>
293286
<li>The <a href="https://ecmarchitect.com/alfresco-developer-series">Alfresco Developer Series</a> on <a href="https://ecmarchitect.com">ECM Architect</a> has free tutorials on custom content models, actions, behaviors, workflows, and web scripts.</li>
294287
</ul>
295288
</div><!-- .entry-content -->

maven-sdk/tutorial/tutorial.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ to write code that runs within either of those web applications, the Alfresco
7171
Maven SDK is where you need to start.
7272

7373
A quick word about versions. This tutorial assumes you are using Alfresco Maven
74-
SDK 4.0 which works with Alfresco 6.0.1 and higher. If you are using a version
75-
of Alfresco older than 6.0.1 but greater than or equal to 4.2.7, you can use
76-
version 3.0.1 of the SDK. The biggest difference between 4.0 and 3.0.1 is the
77-
use of Docker instead of an embedded Tomcat and in-memory database.
74+
SDK 4.1 which works with Alfresco 6.2 and higher. If you are using a version of
75+
Alfresco older than 6.2 but greater than or equal to 6.0.1, you can use version
76+
4.0 of the SDK. If you are using a version of Alfresco older than 6.0.1 but
77+
greater than or equal to 4.2.7, you can use version 3.0.1 of the SDK. The
78+
biggest difference between 4.0 and 3.0.1 is the use of Docker instead of an
79+
embedded Tomcat and in-memory database.
7880

7981
If you are using a version of Alfresco newer than 4.0 but older than 4.2.7 you
8082
can use version 2.x of the SDK. You can use the 2.x version of the SDK with this
@@ -91,11 +93,12 @@ Let me show you how easy it can be to get started with Alfresco development
9193
using the Alfresco Maven SDK. Before I start I'm going to assume you have the
9294
following installed:
9395

94-
* Java 1.8.0_201
95-
* Apache Maven 3.3.9
96-
* Alfresco Maven SDK 4.0 (No download necessary)
97-
* Docker 18.09.2
98-
* Docker Compose 1.23.2
96+
* MacOS 10.15.4
97+
* Java OpenJDK 11.0.2
98+
* Apache Maven 3.6.3
99+
* Alfresco Maven SDK 4.1 (No download necessary)
100+
* Docker 19.03.8
101+
* Docker Compose 1.25.4
99102

100103
You don't need to download anything else. Seriously. Not even Alfresco.
101104

@@ -297,7 +300,7 @@ and to run them every time you build. Many organizations run CI (Continuous
297300
Integration) tools that depend on this being the case. Running `mvn test` will
298301
compile and run the project's unit tests.
299302

300-
To run integration tests using SDK 4.0, first start up the server using
303+
To run integration tests using the SDK, first start up the server using
301304
`run.sh build_start`. Once it is running, do `run.sh test` to run the
302305
integration tests. You'll see something like:
303306

0 commit comments

Comments
 (0)