How to configure the development environment with Eclipse.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

How to configure the development environment with Eclipse.

Jump to solution

Hi

I want to start developing custom modules in Alfresco. For this I have installed the following.

* Eclipse IDE for Java Developers version 2020-03 (4.15.0).

* Java (javac 14.0.1).

* Maven (Apache Maven 3.6.3.).

* JDK 14.0.1.

* Windows 10 64BIT

I followed these steps

https://docs.alfresco.com/sdk2.1/concepts/alfresco-sdk-installing-prerequisite-software.html

https://docs.alfresco.com/5.2/tasks/sdk-develop-eclipse.html

eclipse-workspace - Eclipse IDE 2020-05-28 16.18.23.png

I want to do the following.

https://hub.alfresco.com/t5/alfresco-content-services-forum/i-want-to-do-a-post-method-when-creating...

 

My question is. How do I start doing this from everything I have.

How do I access from the browser?

How can I start developing what I want?

Thank you

1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator

Re: How to configure the development environment with Eclipse.

Jump to solution

@carloshc95  looking at your error it seems you are using windows and i assume you have already installed Docker Desktop for windows (https://docs.docker.com/docker-for-windows/release-notes/

Latest version can be downloaded from here just in case: https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe

Open poweshell and check following:

docker --version

docker-compose -version

Both should return version successfuly, which idicates installation was proper.

 

Have you created user account on docker hub? 

You must create a user account on docker hub and when you start Docker Desktop, you must login using the credentials you created. It will allow downloading alfresco/share and other images from docker hub (for community versions). 

Go to: https://hub.docker.com/signup?next=%2F%3Foverlay%3Donboarding to create an account.

To login, use powersehll or docker desktop signin option after user account creation. Posweshell login command shown below.

PS: docker login
		Authenticating with existing credentials...
		Stored credentials invalid or expired
		Username (xyz@gmail.com): xyz
		Password:
		Login Succeeded

https://docs.docker.com/engine/reference/commandline/login/

Using docker desktop: https://www.docker.com/blog/using-docker-desktop-and-docker-hub-together-part-1/

Before starting with SDK4.x and docker based project, Installation of docker engine on your development environment and user account creation is pre-requisite. 

Understand the concept:
https://docs.alfresco.com/6.2/concepts/deploy-concepts.html

Visit here for more details: https://docs.alfresco.com/6.2/concepts/deploy-prereqs.html

If problem stil persists, then create a separate thread with the logs and steps you have followed.

Note that, java11 is mandatory to run the sdk based projects. See details on deploy-prereqs shared above.

 

View solution in original post

14 Replies
Moderator
Moderator

Re: How to configure the development environment with Eclipse.

Jump to solution

@viperboys which version of ACS you are using? 5.2.x or 6.x ?

For 6.x version see the steps here: 

https://hub.alfresco.com/t5/alfresco-content-services-forum/problem-when-creating-an-all-in-one-proj...

Planning to start with 6.x, see this post: https://hub.alfresco.com/t5/alfresco-content-services-forum/get-started-with-alfresco-6-and-alfresco...

Debug in eclipse: https://github.com/Alfresco/alfresco-sdk/blob/master/docs/advanced-topics/debugging/debug-eclipse.md

If using 5.2.x, see the instructions to get basic project:

Generate the new project by following these steps:

1- Open commond prompt and execute following maven command:

For windows cmd:
mvn archetype:generate -Dfilter=org.alfresco:

For windows powershell:
mvn archetype:generate -Dfilter="org.alfresco:"

For mac/linux terminals, either can be used.

2- You will be asked to choose the archetype. SELECT '2'

Choose archetype:
1: remote -> org.alfresco.maven.archetype:activiti-jar-archetype (DEPRECATED - UNSUPPORTED - EXPERIMENTAL)
2: remote -> org.alfresco.maven.archetype:alfresco-allinone-archetype (Sample multi-module project for All-in-One development on the Alfresco platform. Includes modules for Platform/Repository JAR and Share JAR)
3: remote -> org.alfresco.maven.archetype:alfresco-amp-archetype (Sample project with full support for lifecycle and rapid development of Repository AMPs (Alfresco Module Packages))
4: remote -> org.alfresco.maven.archetype:alfresco-platform-jar-archetype (Sample project with full support for lifecycle and rapid development of Platform/Repository JARs and AMPs (Alfresco Module Packages))
5: remote -> org.alfresco.maven.archetype:alfresco-share-jar-archetype (Share project with full support for lifecycle and rapid development of JARs and AMPs (Alfresco Module
        Packages))
6: remote -> org.alfresco.maven.archetype:share-amp-archetype (Share project with full support for lifecycle and rapid development of AMPs (Alfresco Module
        Packages))

3- Select '11' for the SDK version as 3.1.0

Choose org.alfresco.maven.archetype:alfresco-allinone-archetype version:
1: 2.0.0-beta-1
2: 2.0.0-beta-2
3: 2.0.0-beta-3
4: 2.0.0-beta-4
5: 2.0.0
6: 2.1.0
7: 2.1.1
8: 2.2.0
9: 3.0.0
10: 3.0.1
11: 3.1.0
12: 4.0.0-beta-1
13: 4.0.0
14: 4.1.0
Choose a number: 14:11

4- Provide 'groupId'

Define value for property 'groupId':

e.g. com.demo.aio.sdk3

5- Provide the 'artifactId' (name of your project)

Define value for property 'artifactId':

e.g.: sdk3-aio-project

6- Provide package:

Define value for property 'package' com.demo.aio.sdk3: :

Keep as is. Press enter.

7- You will be asked to confirm the properties:

Confirm properties configuration:
groupId: com.demo.aio.sdk3
artifactId: sdk3-aio-project
version: 1.0-SNAPSHOT
package: com.demo.aio.sdk3
 Y: :

Press 'Y', if everything looks good. A sample project will be generated. 

8- Import them in eclipse and get started.

Note: JDK 1.8 is recommended for SDK3.1.0

To debug in eclipse (SDK3.1.0): http://javaworld-abhinav.blogspot.com/2015/07/debugging-alfresco-and-share-in-eclipse.html

Highlighted
Active Member II

Re: How to configure the development environment with Eclipse.

Jump to solution

Hi @abhinavmishra14 

I have followed all your steps and it worked well and without issue.

Now from Eclipse how can I start with something silly? Develop simple things. Where they explain step by step how to do anything with an eclipse. My goal is to get to this point. https://hub.alfresco.com/t5/alfresco-content-services-forum/i-want-to-do-a-post-method-when-creating... Because I am already in Eclipse but I could not do anything Haha. I think doing a practical exercise with Eclipse would help me a lot.

Thank you.

 

Highlighted
Moderator
Moderator

Re: How to configure the development environment with Eclipse.

Jump to solution

If you have generated projects and able to start via docker, the next step would be to either add customizations in repo module or share module. In your case, you want to add a java based behavior. So you can go to repo module and add your custom behavior and then start the containers to test it. 

For reference, clone this repository: https://github.com/jpotts/alfresco-developer-series.git

git clone https://github.com/jpotts/alfresco-developer-series.git

and Import this project in eclipse: https://github.com/jpotts/alfresco-developer-series/tree/master/behaviors/behavior-tutorial

Taking the reference from this tutorial add custom behavior in your project.

Highlighted
Active Member II

Re: How to configure the development environment with Eclipse.

Jump to solution

Hi!

Following the steps indicated in this post that I created my project, but I get the following error in the pom.xml file.

Plugin execution not covered by lifecycle configuration: org.zeroturnaround:jrebel-maven-plugin:1.1.8:generate (execution: generate-rebel-xml, phase: process-resources)

Captura.PNG

could you help me with this error? Thank you!

Highlighted
Moderator
Moderator

Re: How to configure the development environment with Eclipse.

Jump to solution

You can ignore that warning. Try to run the project if using SDK3.x

1- Right click the pom file of the project which you want to debug.
2- Select Run > Debug Configuration from main menu.
3- Click the New Launch Configuration icon on the top left of the dialog.
4- Give the Debug Configuration a suitable name.
5- For Goals enter- goal as "alfresco:run"
6- On the JRE tab add the following VM arguments: 
-Xms1024m -Xmx4096m -XX:PermSize=1024m
 to avoid PermGenexceptions.
7- Click apply and then click debug.
 

http://javaworld-abhinav.blogspot.com/2015/07/debugging-alfresco-and-share-in-eclipse.html

For SDK 4.X  use the run.bat/run.sh. Look at the README file available in the generated project

Highlighted
Active Member II

Re: How to configure the development environment with Eclipse.

Jump to solution

Hi @abhinavmishra14 

I managed to install the repository from an official tutorial on the Alfresco page.


Alfresco » Reglas de carpeta - Google Chrome 2020-05-13 12.08.28.png

Now how do I start to study all this? Why is this so difficult? Hahaha

Highlighted
Moderator
Moderator

Re: How to configure the development environment with Eclipse.

Jump to solution

Its not as difficult as you are thinking. Follow the steps by step process as explained in the tutorials. 

Have a look at the README file. Since your current project structure is as per SDK4.1.0, you need to make sure that you have docker installed on your environment. 

Highlighted
Active Member II

Re: How to configure the development environment with Eclipse.

Jump to solution

Hello! I have created my outdoor project (SDK 4.x) following the indicated steps and when I run "run.bat build_start" from my cmd I get the following error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose\cli\main.py", line 72, in main
File "compose\cli\main.py", line 128, in perform_command
File "compose\cli\main.py", line 1077, in up
File "compose\cli\main.py", line 1073, in up
File "compose\project.py", line 548, in up
File "compose\service.py", line 351, in ensure_image_exists
File "compose\service.py", line 1106, in build
File "site-packages\docker\api\build.py", line 261, in build
File "site-packages\docker\api\build.py", line 308, in _set_auth_headers
File "site-packages\docker\auth.py", line 302, in get_all_credentials
File "site-packages\docker\credentials\store.py", line 71, in list
File "site-packages\docker\credentials\store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "error listing credentials - err: exit status 1, out: `No se ha encontrado el elemento.`".
[9680] Failed to execute script docker-compose
Attaching to

Why does this error occur? How can I solve it?

And another question, What would be the url with which I can access the outdoor shared resource of this project?

Thank you very much in advance for your reply, as I can't find much information about alfresco 6.x and sdk 4.x Smiley Happy

Highlighted
Community Manager
Community Manager

Re: How to configure the development environment with Eclipse.

Jump to solution

Hi @carloshc95,

What's your dev environment? It might be a permissions issue on your machine - see this thread - or other authentication issues if you're trying with Enterprise

HTH,

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