Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Tutorial to configure a nuxeo project and start developing on it

License

Notifications You must be signed in to change notification settings

epicprojects/nuxeo-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Develop With Nuxeo (Tutorial)

Do you want to develop Nuxeo Platform with you favorite IDE IntelliJ?

I’d like to share with you the IntelliJ configuration for Nuxeo. After reading this, you’ll understand how to:

  1. Getting the Nuxeo Source Code
  2. Import Nuxeo Source Code into IntelliJ
  3. Configure Nuxeo Code Style
  4. Compiling and Building Nuxeo Server with IntelliJ
  5. Installing Web UI bundle to Nuxeo Server

Prerequisite

Before getting started, you need to ensure your computer has installed the following software:

  1. IntelliJ IDEA CE (Latest)
  2. JDK 8 (Oracle's JDK or OpenJDK recommended)
  3. Apache Maven 3.1.1+ (3.2+ recommended)
  4. Apache Ant 1.7.1+
  5. Git
  6. NodeJS 0.10.32 and (npm, yo, grunt, grunt-cli, gulp, bower) don't forget to install these are very important
  7. Python 2.7

1. Getting the Nuxeo Source Code

Clone the Nuxeo 'master' branch to some folder using git GUI or Command line

https://github.com/nuxeo/nuxeo.git

In the cloned source code folder find 'clone.py' and execute following command

python clone.py master -a

2. Import Nuxeo Source Code into IntelliJ

Before importing Nuxeo source code, you need to configure the VM options for importer to increase the importation capacity. Open IntelliJ, a welcome menu will be shown. On the right bottom of menu, click Configure > Preferences. Then search VM options for importer in Build Toold > Maven > Importing and set it to:
-Xmx4g -Xms1g

Now import Nuxeo source code as Maven project. In the default welcome menu, choose Import Project, then find the Nuxeo root folder and select the POM file in $NX_HOME/pom.xml. Afterwards, set up the Maven import options as the following screenshot:

Later, you will need to:

  1. Choose Maven profiles: default
  2. Choose Project SDK: use JDK 8 (in next steps)
  3. Edit name to create a new IntelliJ project: default (or anything you like) (in next steps)

When the configuration is finished. IntelliJ will create a project for you, the entire process (Maven import) will take a some minutes, You have to be patient about that. And final view will be something like this:

3. Configure Nuxeo Code Style

Get the Eclipse code formatter plugin (https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter) from Preferences > Plugins > Install JetBrains Plugin > Search "Eclipse code formatter" and install it. It will improve the performance of IntelliJ. You can customize the VM options by Click Help > Edit Custom VM Options…. If there’s no existing configuration file, IntelliJ will help you to create one. Then edit the content with your preferred values:

-Xmx4g -Xms1g

4. Compiling and Building Nuxeo Server with IntelliJ

To compile and run nuxeo project you need to create a configration. In my case of Mac OS you can use (https://plugins.jetbrains.com/plugin/4230-bashsupport) and in case of Windows you can use (https://plugins.jetbrains.com/plugin/265-batch-scripts-support). You can install the required plugin from Preferences > Plugins > Install JetBrains Plugin > Search plugin name .

You can create a run.sh/run.bat (bash or batch script) in $NX_HOME/Scripts and add following command to it.

For Mac OS

/YOUR_PATH_TO_NUXEO/nuxeo/nuxeo-distribution/nuxeo-server-tomcat/target/nuxeo-server-tomcat-9.2-SNAPSHOT/bin/Start\ Nuxeo.command

For Windows

"C:\YOUR_PATH_TO_NUXEO\nuxeo\nuxeo-distribution\nuxeo-server-tomcat\target\nuxeo-server-tomcat-9.2-SNAPSHOT\bin\Start Nuxeo.bat"

After that you have to create a run configuration which should look like this:

In before launch section you need to add "Make" (Which will compile all the sources) and also create a "Run Maven Goal" with following parameters:

clean -DskipTests=true install -Paddons,distrib

*Most common mistake is either not having right Maven (I am using 3.3.9) version installed or not having all required NPM components (npm, yo, grunt, grunt-cli, gulp, bower) or missing any other prerequisites

and run the project after making configrations and if everything goes well you should see the Nuxeo Server GUI:

if you go to browser and open following link you should see that nuxeo server is up and running.

http://localhost:8080/nuxeo

5. Installing Web UI bundle to Nuxeo Server

!!! IMPORTANT !!! Before installing component you need to stop the Nuxeo Server!

Nuxeo Web UI component can be downloaded from following link https://connect.nuxeo.com/nuxeo/site/marketplace/package/nuxeo-web-ui Now using following command install Nuxeo Web UI Comoponent

/YOUR_PATH_TO_NUXEO/nuxeo/nuxeo-distribution/nuxeo-server-tomcat/target/nuxeo-server-tomcat-9.2-SNAPSHOT/bin/nuxeoctl mp-install <download-path>/nuxeo-web-ui-0.10.0.zip

If while installing the component it askes you to "Do you want to relax the constraint (yes/no)?" Answer with Yes

Now start the server using following command or run your 'run.bat/run.sh' script.

For Mac OS

/YOUR_PATH_TO_NUXEO/nuxeo/nuxeo-distribution/nuxeo-server-tomcat/target/nuxeo-server-tomcat-9.2-SNAPSHOT/bin/Start\ Nuxeo.command

For Windows

"C:\YOUR_PATH_TO_NUXEO\nuxeo\nuxeo-distribution\nuxeo-server-tomcat\target\nuxeo-server-tomcat-9.2-SNAPSHOT\bin\Start Nuxeo.bat"

and if everything works fine you should see fully functional nuxeo server with a UI interface on http://localhost:8080/nuxeo. You can login to the dashboard using following credentials.

Username: Administrator Password: Administrator