cancel
Showing results for 
Search instead for 
Did you mean: 

maven-alfresco-amp-archetype question

m_scapoli
Champ in-the-making
Champ in-the-making
Hello there! I'm a student and I'm developing an Alfresco plug-in for my academic degree thesis.

this is my configuration:
GNU/Linux Ubuntu 11.10 x86_64
Eclipse Java EE Development Tools Version: 3.3.1

other information from mvn -version command output:
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /usr/local/apache-maven-3.0.3
Java version: 1.7.0_147-icedtea, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: it_IT, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-14-generic", arch: "amd64", family: "unix"
my problem is in launching the one line command for managing AMP lifecycle with Maven like is written here: http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven#How_to_manage_Alfresco_AMPs_.28a...

in previous tests that I made with the Alfresco 3.4 Community version on a 32 bit system I've made some changes to the line for resolve many issues from the amp-archetype maven manage; the new command line figure like that: (and work fine for the previous configuration..)
mvn archetype:generate -DarchetypeGroupId=com.sourcesense.alfresco -DarchetypeArtifactId=maven-alfresco-amp-archetype -DarchetypeVersion=1.9.1 -DgroupId=com.mycompany \-DartifactId=myamp -Dversion=1.0 -DarchetypeRepository=http://maven.alfresco.com/nexus/content -DinteractiveMode=false
now the command line (run with the -e switch to see the full stack trace of the errors) return me this error and I don't find a way to manage that:

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects…
[INFO]                                                                        
[INFO] ————————————————————————
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ————————————————————————
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] — maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom —
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
Downloading: http://maven.alfresco.com/nexus/content/com/sourcesense/alfresco/maven-alfresco-amp-archetype/1.9.1/...
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 4.459s
[INFO] Finished at: Wed Jan 18 11:44:12 CET 2012
[INFO] Final Memory: 13M/309M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.sourcesense.alfresco:maven-alfresco-amp-archetype:1.9.1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.sourcesense.alfresco:maven-alfresco-amp-archetype:1.9.1)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired archetype does not exist (com.sourcesense.alfresco:maven-alfresco-amp-archetype:1.9.1)
   at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:221)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
   … 19 more
Caused by: org.apache.maven.archetype.exception.UnknownArchetype: The desired archetype does not exist (com.sourcesense.alfresco:maven-alfresco-amp-archetype:1.9.1)
   at org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype(DefaultArchetypeGenerationConfigurator.java:117)
   at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:205)
   … 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

if anyone have a nice idea of what it's happened I'm very glad to him/her..

sorry for the "spaghetti english", I'll do better next time, promise  Smiley Very Happy
5 REPLIES 5

vbreivik
Champ in-the-making
Champ in-the-making
Hi.

I'm not sure I ever got the maven archetype from maven.alfresco.com working. The server was down and a lot of problems ensued. I think I ended up checking out the archetype from the google code project and did a release to a local nexus.

The problem you are getting is that there is no maven-alfresco-amp-archetype-1.9.1.jar, and if you paste the URL in your browser you will get a HTTP 404. I've lost some confidence in Alfresco or any partners interest in hosting a maven repository or supporting builds by maven. But from what they said at Devcon last year it seems to be a renewed interest. On http://code.google.com/p/maven-alfresco-archetypes/ there is a new version of the archetype, version 3.9.0, so I guess there is hope.

Best advice is to check out the source from code.google.com and build it yourself.


Best regards and good luck Smiley Happy

m_scapoli
Champ in-the-making
Champ in-the-making
Thanks a lot vbreivik, now the situation it's a little bit much clear  :wink: I'll go this way! Regards

m_scapoli
Champ in-the-making
Champ in-the-making
UPDATE NEWS:

still working on my project, I stumbled upon this revelation from http://www.open-source-ecm.com/Maven + Alfresco : SDK, Dependencies, Inheritance:
1. Integrating Alfresco SDK locally

As you know, Alfresco SDK includes all dependencies needed to run an Alfresco and to use it.

Problem : How can we add this dependency into our Maven repository ?
Via a small project written in Java and compiled using Maven (if you want to make Maven as well do it anywhere ^^ ).

Principle?
List all dependencies present in AlfrescoEmbedded SDK and integrate them into our repository via a script (. Bat or. Sh)



If you want to resolve this problem, you have multiple choice.

1. First, identify one by one each dependency (and repository). Next, create files… if you have time to spend…

2. Second, you have to wait that Alfresco will add all dependency in his official repository or create a pom.xml with them.
Third, it's a mix between all of preceding solutions.

is this still true?

Identify one by one each dependency and add them to the pom by hand?

Thanks for the help in advance

m_scapoli
Champ in-the-making
Champ in-the-making
OK I've found!

The answer is: “Yes, you have to identify one by one each dependency and add them to the pom by hand”

This is the How To (mainly for Linux users):

copy that scripts line and update the top variables of the script to fit your situation (mainly the ALFRESCO_SDK_VERSION; ALFRESCO_SDK_CLASSIFIER and SDK_DIR)

#!/bin/sh

# This script will upload the Alfresco SDK artifacts to a local Maven repository.

#main fields to update at your situation expetially for Version and Classifier
ALFRESCO_SDK_VERSION=4.0.c
ALFRESCO_SDK_CLASSIFIER=community
ALFRESCO_SDK_PACKAGING=jar

#not used
MAVEN_REPOSITORY_DIR=.m2/repository
MAVEN_REPOSITORY_ID=alfresco-sdk

#needs the already extracted SDK path
SDK_DIR=/home/godtaxidriver/workspace/alfresco-community-SDK-4.0

mvn install:install-file -Dfile=$SDK_DIR/lib/server/alfresco-core-4.0.c.jar -DgroupId=org.alfresco.sdk -DartifactId=alfresco-core -Dversion=4.0.c -Dclassifier=$ALFRESCO_SDK_CLASSIFIER -Dpackaging=$ALFRESCO_SDK_PACKAGING
mvn install:install-file -Dfile=$SDK_DIR/lib/server/alfresco-remote-api-4.0.c.jar -DgroupId=org.alfresco.sdk -DartifactId=alfresco-remote-api -Dversion=$ALFRESCO_SDK_VERSION -Dclassifier=$ALFRESCO_SDK_CLASSIFIER -Dpackaging=$ALFRESCO_SDK_PACKAGING
mvn install:install-file -Dfile=$SDK_DIR/lib/server/alfresco-repository-4.0.c.jar -DgroupId=org.alfresco.sdk -DartifactId=alfresco-repository -Dversion=$ALFRESCO_SDK_VERSION -Dclassifier=$ALFRESCO_SDK_CLASSIFIER -Dpackaging=$ALFRESCO_SDK_PACKAGING
mvn install:install-file -Dfile=$SDK_DIR/lib/server/alfresco-web-client-4.0.c.jar -DgroupId=org.alfresco.sdk -DartifactId=alfresco-web-client -Dversion=$ALFRESCO_SDK_VERSION -Dclassifier=$ALFRESCO_SDK_CLASSIFIER -Dpackaging=$ALFRESCO_SDK_PACKAGING
mvn install:install-file -Dfile=$SDK_DIR/lib/server/alfresco-data-model-4.0.c.jar -DgroupId=org.alfresco.sdk -DartifactId=alfresco-data-model -Dversion=$ALFRESCO_SDK_VERSION -Dclassifier=$ALFRESCO_SDK_CLASSIFIER -Dpackaging=$ALFRESCO_SDK_PACKAGING

exit 0

then update your POM file with the following <dependency>s:

        <!– Alfresco SDK extra dependencies –>

        <dependency>
            <groupId>org.alfresco.sdk</groupId>
            <artifactId>alfresco-core</artifactId>
            <version>${alfresco.version}</version>
            <scope>provided</scope>
            <classifier>community</classifier>
        </dependency>
        <dependency>
            <groupId>org.alfresco.sdk</groupId>
            <artifactId>alfresco-remote-api</artifactId>
            <version>${alfresco.version}</version>
            <scope>provided</scope>
            <classifier>community</classifier>
        </dependency>
        <dependency>
            <groupId>org.alfresco.sdk</groupId>
            <artifactId>alfresco-repository</artifactId>
            <version>${alfresco.version}</version>
            <scope>provided</scope>
            <classifier>community</classifier>
        </dependency>
        <dependency>
            <groupId>org.alfresco.sdk</groupId>
            <artifactId>alfresco-web-client</artifactId>
            <version>${alfresco.version}</version>
            <scope>provided</scope>
            <classifier>community</classifier>
        </dependency>
        <dependency>
            <groupId>org.alfresco.sdk</groupId>
            <artifactId>alfresco-data-model</artifactId>
            <version>${alfresco.version}</version>
            <scope>provided</scope>
            <classifier>community</classifier>
        </dependency>

in my example I have added the alfresco-core; alfresco-remote-api; alfresco-repository; alfresco-web-client that are the mainly, and the most used I think, and the alfresco-data-model that is for my purposes

I hope that helps!

stalinlouis
Champ in-the-making
Champ in-the-making
how to plug in records management in Maven Alfresco SDK