cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco SDK 4.0 build issue on Open JDK 11

nikhilesh_s1vak
Confirmed Champ
Confirmed Champ

I have been trying to set up the development environment in Alfresco SDK 4.0 with Open JDK 11. I have downloaded the all in one project as mentioned in the documentation and even referred jeff pott's material (https://ecmarchitect.com/alfresco-developer-series-tutorials/maven-sdk/tutorial/tutorial.html#alfres...).

I have applied enterprise license and able to start and test the application. But when i put my customized code in the project structure i faced lot of compilation issues which i have fixed eventaully. But there are few stubborn issues which are related Java modules are giving me a tough time. 

Below issues are failing the build. 

The package com.xxxx.xxxx.entities is accessible from more than one module: <unnamed>, xxxx.alfresco ( In imports declaration)

The package com.com.xxxx.xxxx.entities conflicts with a package accessible from another module: xxxx.alfresco (In Package declration)

I have understood that this issue is related to JDK modules and fixed it by excluding the unnecessary jar in the pom.xm (for 3rd party jars such as xml and w3c). But the above problems arises when i try to build my customized code. 

Below is my development environment i have used:

  • Alfresco/SDK Version: 6.2 Enterprise/ SDK 4.0
  • Eclipse Version : 4.18
  • Java Version : Open JDK 11.0.1
  • Maven Version : Apache Maven 3.6.3
1 ACCEPTED ANSWER

Hi @nikhilesh_s1vak,
let's take a step back and try as follows (all from the CLI):

  • java -version > output.txt
  • mvn -version >> output.txt
  • git clone https://github.com/Alfresco/alfresco-sdk.git sdk-4.2
    or (if you want to use SSH instead of HTTPS):
    git clone git@github.com:Alfresco/alfresco-sdk.git sdk-4.2
  • cd sdk-4.2
    mvn clean install -Pmaven.test.skip=true
    mvn archetype:generate -Dfilter=org.alfresco:
  • Answer to the questions (eg. "2" - All-In-One Archetype, "15" - SDK 4.2.0, and then proper groupId and artifactId), apply the license properly, etc.
  • Do what's described in the Working with Enterprise guide, hence turn your generated project's pom.xml into:

    <alfresco.bomDependencyArtifactId>acs-packaging</alfresco.bomDependencyArtifactId>
    
    <docker.acs.image>quay.io/alfresco/alfresco-content-repository</docker.acs.image>
    
    <alfresco.platform.version>6.2.2.10</alfresco.platform.version>
    <alfresco.share.version>6.2.2.2</alfresco.share.version> 
    
    <keystore.settings></keystore.settings>
  • Add your custom code, then run it by appending:
    >> output.txt
    at the end of the command.

If the problem is still there at this point, please post here the output.txt file so we can have a look at it.

If instead the problem is gone, then the culprit was likely a dirty cache or the fact that the right version of the SDK to use today is 4.1 or 4.2.

Hope that helps

View answer in original post

24 REPLIES 24

Hi @andrealigios,

Thanks for the response and clear explanation. It seems SDK 4.1 working for me with my customized code as the most of the earlier errors are gone. It allowed me to focus on the upgrade changes (Alfresco 5.2 to  6.2) rather than struggling to solve the JPMS issues. I am still working on the upgrade changes on the custom code and will keeo you posted on this. 

Great!

Meanwhile, I've released the SDK 4.2, and I've also updated the documentation in the previous post: https://hub.alfresco.com/t5/alfresco-content-services-forum/alfresco-sdk-4-0-build-issue-on-open-jdk...

Feel free to use that from now on, @nikhilesh_s1vak

Sure @andrealigios. Thanks for your valuable response. It really helped me in finding out the right issue. 

Hi @nikhilesh_s1vak 

Great news that you've got things working. Can you acept this as a solution to help other users?

Thanks,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!