Quick tips for migrating SDK3 projects to ACS 6

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick tips for migrating SDK3 projects to ACS 6

angelborroy
Expert
9 12 2,347

This article is about modules for the ACS repository and does not cover Share. Share modules from previous Alfresco versions can be deployed to ACS 6 without modifications.

This article describes how to migrate Alfresco SDK 3 based projects alfresco-platform-jar-archetype to Alfresco SDK 3 projects including the new dependencies from ACS 6. However, as a third party developer, it might be a lot easier for you to wait for the next version of the official Alfresco SDK.

Step 1: Upgrade Alfresco and Share versions

Find following properties in your original pom.xml file...

<alfresco.platform.version>5.2.f</alfresco.platform.version>
<alfresco.share.version>5.2.e</alfresco.share.version>

... and replace the values with the following numbers...

<alfresco.platform.version>6.0.7-ga</alfresco.platform.version>
<alfresco.share.version>6.0.b</alfresco.share.version>

Step 2: Change Alfresco distribution dependency name

Identify Alfresco distribution dependency in your original pom.xml file...

<dependency>
    <groupId>${alfresco.groupId}</groupId>
    <artifactId>alfresco-platform-distribution</artifactId>
    <version>${alfresco.platform.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

...and replace the name by using the following entry...

<dependency>
    <groupId>${alfresco.groupId}</groupId>
    <artifactId>alfresco-content-services-community-distribution</artifactId>
    <version>${alfresco.platform.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

From this point you can compile and package your addon for ACS 6. 

Step 3: Refactor your code where required

Updates that might affect your custom code are (among others):

  • Spring
  • Quartz
  • POI
  • Jackson
  • multiple commons-* libraries

Removed libraries:

  • Hibernate

ACS 6 Migration Guide wiki page collects useful information about updating Java code to work with the ACS6 repository.

Conclusion

These simple instructions can be applied to upgrade your repository addons to ACS 6, but Alfresco will release a detailed guide for migration procedures in the future. 

About the Author
Angel Borroy was technical lead architect at keensoft. Over the last 15 years, he has been working as a software architect on Java, BPM, document management and electronic signatures. He has been working with Alfresco during the last years to customize several implementations in large organizations and to provide add-ons to the Community based on Record Management and Electronic Signature. He writes (sometimes) on his personal blog http://angelborroy.wordpress.com. He is (proud) member of the Order of the Bee. Angel Borroy is Engineer at Alfresco.
12 Comments
willemdrew
Member II

Do you have the instructions for Enterprise Alfresco v6?

angelborroy
Expert

No, but I guess that it has to be similar to this.

josh_barrett
Active Member II

I was able to get it to build the platform jar and share jar module in the All in one type by setting alfresco.platform.version to 6.0.0 and the alfresco.share.version to 6.0 but it fails on integration tests when I try to run mvn install.

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] AIO - SDK 3.0 1.0-SNAPSHOT ......................... SUCCESS [  0.529 s]

[INFO] Alfresco Platform/Repository JAR Module ............ SUCCESS [  2.233 s]

[INFO] Alfresco Share JAR Module .......................... SUCCESS [ 54.550 s]

[INFO] Integration Tests Module 1.0-SNAPSHOT .............. FAILURE [  5.770 s]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 01:03 min

[INFO] Finished at: 2018-07-20T15:39:10-04:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.alfresco.maven.plugin:alfresco-maven-plugin:3.0.1:it (start-alfresco) on project integration-tests: Unable to execute mojo: Unable to resolve artifact. Could not transfer artifact org.alfresco:alfresco-solr4:zip:config:6.0.0

I looked all over and can't find any reference to alfresco-solr4 in the pom files.   Any ideas?

yreg
Active Member II

The reason behind that is probably that solr setup for the SDK is broken for ACS 6.

You can check this PoC I have been working on few months back, it has a workaround for fixing your build and even running Alfresco in dev mode locally from the SDK (With solr6 on board) ;-) GitHub - yregaieg/acs6-sdk3-poc: PoC for using SDK 3.0.1 from Alfresco in conjunction with ACS 6.0 

kaposto
Member II

Younes REGAIEG

I am also about to upgrade our project to ACS 6. The github repository you recommend has solr disabled ;-) . I am facing exactly the same issue as Josh Barrett‌ actually. Any progress made on that? 

yreg
Active Member II

I disabled solr from the SDK on that PoC project because solr was broken, and there were missing assets to make it work from within the SDK. I figured then I should be using docker to spin up Alfresco Search Services container (Solr 6) and hook it into my dev environment (nice solr upgrade, since now I can even benefit from the nice solr6 features in my dev environment as well, and I get to customize solr configuration without having the SDK revering it on every run!

Note that the magic hostname : host.docker.internal here would point to your host for tracking.

Having gone through commit history now, I do realize I forgot to adjust solr properties here to default to the right subsystem (solr6) and use the correct port (8983)

tduci29
Member II

Issue we are facing with enterprise (I actually did try exactly as you have listed) is pulling in the war file, I continues to fail looking for a 6.0 version of the war file

yreg
Active Member II

Tony Bernarduci‌ can you confirm that the pulled in war was installed into your local m2 repo?

tduci29
Member II

[ERROR] Failed to execute goal org.alfresco.maven.plugin:alfresco-maven-plugin:3.0.1:run (default-cli) on project paychex-alfresco: Unable to execute mojo: Unable to find artifact. Could not find artifact org.alfresco:alfresco-platform-enterprise:war:6.0.0.3 in alfresco-private-repository

<alfresco.platform.version>6.0.0.3</alfresco.platform.version>
<maven.alfresco.edition>enterprise</maven.alfresco.edition>
<dependency>
    <groupId>${alfresco.groupId}</groupId>
    <artifactId>alfresco-content-services-distribution</artifactId>
    <version>${alfresco.platform.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

It isn't pulling in the war.
We have enablePlatorm set to true.
yreg
Active Member II

You will need to download the war manually and install it manually to your local maven repo /company nexus... check the instructions on my github project

tduci29
Member II

I would if that version of the war existed.  Are you proposing I use a different version and manually download that?

yreg
Active Member II

The whole reason behind the manual download thing is that Alfresco has renamed the artifact (again) and the SDK has the artifact ID hardcoded in 3.0.0 and 3.0.1.

You can grab the war here : https://artifacts.alfresco.com/nexus/service/local/repo_groups/private/content/org/alfresco/content-...  or download it from support portal distribution package ;-)