Error: ArtifactRepository cannot be instantiated

1,139 views
Skip to first unread message

Nicolas Raoul

unread,
Jan 25, 2010, 7:38:48 AM1/25/10
to Maven Alfresco Lifecycle Discussion Group
Hello all,

Newbie question: I am trying to deploy an AMP. I did not write any
code of mine yet, but I already get an error.
Here is what I did:

1) As per the wiki I ran the following:
mvn archetype:generate -DarchetypeGroupId=com.sourcesense.alfresco -
DarchetypeArtifactId=maven-alfresco-amp-archetype -
DarchetypeVersion=1.9.1 -DgroupId=com.mycompany -DartifactId=myamp -
Dversion=1.0-SNAPSHOT -DarchetypeRepository=http://maven.alfresco.com/
nexus/content/repositories/releases -DinteractiveMode=false

2) I edited pom.xml to set the project's version to 0.1 instead of 0.1-
SNAPSHOT

3) I ran mvn install, it worked.

4) I ran mvn deploy, and the following error appeared:

[ERROR] BUILD ERROR
[INFO] Failed to configure plugin parameters for:
org.apache.maven.plugins:maven-deploy-plugin:2.4
check that the following section of the pom.xml is present and
correct:
<distributionManagement>
<!-- use the following if you're not using a snapshot version. -->
<repository>
<id>repo</id>
<name>Repository Name</name>
<url>scp://host/path/to/repo</url>
</repository>
<!-- use the following if you ARE using a snapshot version. -->
<snapshotRepository>
<id>repo</id>
<name>Repository Name</name>
<url>scp://host/path/to/repo</url>
</snapshotRepository>
</distributionManagement>
Cause: Class 'org.apache.maven.artifact.repository.ArtifactRepository'
cannot be instantiated

Is it normal?
Are the wiki instructions up-to-date?
http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven
Did I miss something?

Thanks a lot!
Nicolas Raoul

Carlo Sciolla

unread,
Jan 26, 2010, 7:47:24 AM1/26/10
to maven-a...@googlegroups.com
Hi Nicolas,

On Mon, Jan 25, 2010 at 1:38 PM, Nicolas Raoul <nicola...@gmail.com> wrote:
Newbie question: I am trying to deploy an AMP.
What do you actually mean with "deploy"? If you're trying to *install* the AMP into an Alfresco instance, than you either

* create a repository extension project[1] with a <dependency> set in its POM pointing to your AMP
* use the MMT[2] to install the .amp file created under the target folder of your AMP project into a pre-existing Alfresco instance

If, OTOH, you want to make your maven artifact available to others, than you should follow the error description and update your POM. But I don't think that this is your case, correct me if I'm wrong.

The `mvn deploy` command is used to upload the maven artifact created by your project to a (remote) maven repository, like `mvn install` copies it into your local maven repository, while the "maven" way the AMP are installed into Alfresco instances is by the means of a maven dependency.

Hope this helps,
c.

[1] http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven#How_to_manage_Alfresco_Repository_Extensions_.28alfresco.2Fextension_Spring_based_WAR_builds.29
--
Carlo Sciolla
Sourcesense NL

Mobile: +31 (0)6 21205911
em@il: c.sc...@sourcesense.com

--==(A)==--
Linux User #372086
My personal blog: http://www.skuro.tk
Follow me on Twitter: http://twitter.com/skuro
--==(A)==--

Sourcesense - Making sense of open Source (http://www.sourcesense.com)

Gabriele Columbro

unread,
Jan 26, 2010, 7:49:45 AM1/26/10
to maven-a...@googlegroups.com
Ciao Nicolas,
and welcome to the Maven Alfresco community!
Check my answers below:

On Mon, Jan 25, 2010 at 1:38 PM, Nicolas Raoul <nicola...@gmail.com> wrote:


Well, did you configure a remote repository to deploy to? Be aware that in Maven "deploy" means "distribute the product of the build to a remote Maven repository", which must be configured in the pom.xml exaclty as the error message shows [1]. My archetypes of course do not include a repository declaration in <distributionManagement> because that's really specific to the environment you're working in (e.g. your company, your organization, etc.).

 
Are the wiki instructions up-to-date?
http://wiki.alfresco.com/wiki/Managing_Alfresco_Lifecyle_with_Maven
Did I miss something?


Instructions are definitely up to date, so I guess that if you miss something is around Maven :)

Hope I was clear, LMK if you need more info.

Ciao!
Gab


[1] http://maven.apache.org/pom.html#Distribution_Management
 
Thanks a lot!
Nicolas Raoul

--
You received this message because you are subscribed to the Google Groups "Maven Alfresco Lifecycle Discussion Group" group.
To post to this group, send email to maven-a...@googlegroups.com.
To unsubscribe from this group, send email to maven-alfresc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-alfresco?hl=en.




--
Eng. Gabriele Columbro
Open source and ECM Architect
Alfresco Ltd. - http://www.alfresco.com
-----------------------------------------
work: gabriele...@alfresco.com
private: colu...@gmail.com
work:      (0031)   627 565 103
mobile:  (0039)    320 161 2846

yahoo: g.columbro
gtalk: colu...@gmail.com
AIM:   gabrielecolumbro

-----------------------------------------
"Keyboard not found.
Press F1 to continue"
-----------------------------------------
Reply all
Reply to author
Forward
0 new messages