AnsweredAssumed Answered

Alfresco Maven Setup

Question asked by alfsender on Jan 1, 2014
Hi All,

Hi,

I am new to Maven and I am trying to setup Maven-Alfresco env for community edition. But i am not able to make it work, I am giving you steps i have followed, let me know where i am wrong.

I have followed steps given at this location
http://docs.alfresco.com/4.2/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Fdev-extensions-maven-tutorials-amp-archetype.html

This created project structure mentioned in above url as well, with groupId:MyFirstMvnAlf.
Now in my project I have below directories and pom.xml. 
MyFirstMvnAlf/alfresco
MyFirstMvnAlf/share
MyFirstMvnAlf/amp
MyFirstMvnAlf/runner
MyFirstMvnAlf/solr
pom.xml

But if i go inside MyFirstMvnAlf/alfresco folder there also I see pom.xml, so does each sub-folders like MyFirstMvnAlf/share, MyFirstMvnAlf/amp etc.

As per my understanding I have to put my alfresco files/code (content model etc …) to MyFirstMvnAlf/alfresco & share related code to MyFirstMvnAlf/share.

Questions :
1)To deploy this code on which pom.xml I have to execute mvn package/mvn install command, and how it will come to know where my alfresco.war file is. As I have my alfresco installed in C:\Alfresco4.2.c. I don't see a place where I need to mentioned this path neither in pom.xml or property file.

2)I tried to execute mvn install in MyFirstMvnAlf/amp, I got Build Successful message and it generated amp file (location:C:\Users\welcome\.m2\repository\com\MyFirstMvnAlf\amp\1.0-SNAPSHOT\amp-1.0-SNAPSHOT.amp) also with my custom model file which I have placed under MyFirstMvnAlf/amp/src/main/amp/config/alfresco/extension, but when I try to run mvn install -Prun it gives Build Successfull, but when I hit http://localhost:8080/alfresco in browser its not opening anything there.

3) I tried to put my code under MyFirstMvnAlf/alfresco/src/main/resources/alfresco/extension, but when I tried to execute mvn package command from MyFirstMvnAlf/alfresco I got below error.
[ERROR] Failed to execute goal on project alfresco: Could not resolve dependencies for project com.MyFirstMvnAlf:alfresco:war:1.0-SNAPSHOT: Failed to collect dependencies at com.MyFirstMvnAlf:amp:amp:1.0-SNAPSHOT: Failed to read artifact descriptor for com.MyFirstMvnAlf:amp:amp:1.0-SNAPSHOT: Could not find artifact com.MyFirstMvnAlf:MyFirstMvnAlf:pom:1.0-SNAPSHOT
in alfresco-public (https://artifacts.alfresco.com/nexus/content/groups/public) -> [Help 1]

Request you to send you valuable feedback for above questions, that will really help me.

Outcomes