Thursday, 10 November 2016

Importing individual maven alfresco 5 SDK 2.2.0 / 2.2.1 projects in eclipse as all-in-one project

While importing some existing projects or applications (which are created / built previously as individual repo or share amp projects) can cause problems setting up and running into your eclipse as we might be using local SDK (all-in-one) and the existing project might be built with repo/share individually and having local Alfresco installed (with alfresco installer/setup).

These projects have been setup using individual Repo and Share SDKs. We would need those projects to run as AIO into our local, to overcome individual servers start up issues.

So, here are the steps you need to follow if you come across such projects.

1.
Uncomment all required modules defined in main project's pom.xml file. Uncomment repo, share, solr-config, runner, etc modules.
E.g.

<modules>
    <module>projectone-repo-amp</module>
    <module>projectone-share-amp</module>
    <module>repo</module>
    <module>solr-config</module>
    <module>share</module>
    <module>runner</module> 
</modules>

2. Now, Import all these modules again into your eclipse.
File -> Import -> Maven Project -> (Select same project which you have imported)

3. Navigate to repo project's pom.xml file and change artifactId in dependency and overlay tag having 'repo-amp' value. Change this value to artifactId defined into your repo-amp project's pom.xml file.
E.g.
 <dependency>
           
<groupId>${project.groupId}</groupId>
           
<artifactId>projectone-repo-amp</artifactId>
           
<version>${project.version}</version>
           
<type>amp</type>
       
</dependency>

<overlay>
<groupId>${project.groupId}</groupId>
<artifactId>projectone-repo-amp</artifactId>
<type>amp</type>
</overlay>

4. Perform above step #3 for share project's pom.xml file.

5. Clean and build your whole project, remove dependency related errors if any.

6. Execute below command by selecting main project and monitor logs.
$ mvn clean install -Prun -D skipTests=true

Your application should be up and running after performing these steps.

No comments:

Post a Comment