Erik,
Apparently, this is an issue with Maven (cfr.
http://jira.codehaus.org/browse/ARCHETYPE-76) if you execute the
archetype in a directory that isn't a Maven project (doesn't have a
pom.xml file in there).
If you have a look at
http://incubator.apache.org/servicemix/orchestration-with-jsr181.html,
it shows you how you can first create the parent project (a project
directory with a very simple pom.xml) before you start using the
archetypes. An additional benefit of this approach is that you can omit
the groupId on the mvn archetype:create; it will take the groupId of the
parent pom by default.
Gert
Erik Allais wrote:
i use maven2.0.6 and i can browse to web repository
/hello-world-smx$ mvn archetype:create
-DarchetypeGroupId=org.apache.servicemix.tooling
-DarchetypeArtifactId=servicemix-service-assembly
-DarchetypeVersion=3.1-incubating
-DgroupId=org.apache.servicemix.samples.helloworld
-DartifactId=hello-world-sa -X
+ Error stacktraces are turned on.
Maven version: 2.0.6
[DEBUG] Building Maven user-level plugin registry from:
'/home/erik/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from:
'/usr/local/maven-2.0.6/conf/plugin-registry.xml'
...
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error creating from
archetype
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:224)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating
from archetype
at
org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:193)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.maven.archetype.ArchetypeNotFoundException: Archetype
does not exist: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.servicemix.tooling
-DartifactId=servicemix-service-assembly \
-Dversion=3.1-incubating -Dpackaging=jar -Dfile=/path/to/file
org.apache.servicemix.tooling:servicemix-service-assembly:jar:3.1-incubating
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at
org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:123)
at
org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:188)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.servicemix.tooling
-DartifactId=servicemix-service-assembly \
-Dversion=3.1-incubating -Dpackaging=jar -Dfile=/path/to/file
org.apache.servicemix.tooling:servicemix-service-assembly:jar:3.1-incubating
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:197)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:73)
at
org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:115)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
download the artifact from any repository
at
org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:324)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:185)
... 21 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Fri Jun 22 12:11:20 GMT+01:00 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
Gert Vanthienen wrote:
Erik,
For me this command works:
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling
-DarchetypeArtifactId=servicemix-service-assembly
-DarchetypeVersion=3.1-incubating
-DgroupId=org.apache.servicemix.samples.helloworld
-DartifactId=hello-world-sa
So now you're seeing this error message:
[INFO] Failed to resolve artifact.
GroupId: org.apache.servicemix.tooling
ArtifactId: servicemix-service-assembly
Version: 3.1-incubating
Reason: Unable to download the artifact from any repository
What version of Maven are you using? Can try to browse to the URL for
this dependency from your workstation
(http://people.apache.org/repo/m2-incubating-repository -> org -> apache
-> servicemix -> tooling -> ...)? If this works out, can you try
running maven with the -X for more information?
Gert
Erik Allais wrote:
still the same error...
i change my setting.xml and put this information inside
<settings>
<profiles>
<profile>
<id>incubating</id>
<repositories>
<repository>
<id>apache-incubating</id>
<url>http://people.apache.org/repo/m2-incubating-repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>apache-incubating</id>
<url>http://people.apache.org/repo/m2-incubating-repository</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>incubating</activeProfile>
</activeProfiles>
</settings>
and esecute the good command but always the same error
Erik
Gert Vanthienen wrote:
Erik,
The released version number doesn't have the -SNAPSHOT.
Try using 3.1-incubating instead of 3.1-incubating-SNAPSHOT.
Gert
Erik Allais wrote:
yes, i also changed the version
$ mvn archetype:create
-DarchetypeGroupId=org.apache.servicemix.tooling
-DarchetypeArtifactId=servicemix-service-assembly
-DarchetypeVersion=3.1-incubating-SNAPSHOT
-DgroupId=org.apache.servicemix.samples.helloworld
-DartifactId=hello-world-sa
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:create] (aggregator-style)
[INFO]
----------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource
'VM_global_library.vm'
in
any resource loader.
[INFO] Velocimacro : error using VM library template
VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in
templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline
may
NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will
be
global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID:
org.apache.servicemix.samples.helloworld
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.apache.servicemix.tooling
ArtifactId: servicemix-service-assembly
Version: 3.1-incubating-SNAPSHOT
Reason: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.apache.servicemix.tooling
-DartifactId=servicemix-service-assembly \
-Dversion=3.1-incubating-SNAPSHOT -Dpackaging=jar
-Dfile=/path/to/file
org.apache.servicemix.tooling:servicemix-service-assembly:jar:3.1-incubating-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Jun 22 11:21:14 GMT+01:00 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
Gert Vanthienen wrote:
Erik,
Have you also changed the archetypeVersion in your command? To use
the
released version, it should say -DarchetypeVersion=3.1-incubating?
Gert
Erik Allais wrote:
i follow instruction to change maven configuration but i still have
the
same
error
dont understand why example on website dont work...
all the step before the generation of SU are OK
Gert Vanthienen wrote:
Erik,
The Maven archetypes are not available in the public repository at
http://repo1.maven.org/maven2.
If you want to use the latest released version (3.1-incubating) of
the
archetypes, you can look at
http://incubator.apache.org/servicemix/4-examples.html for more
information on how to configure the additional repository for that.
Maven output says you are using the development version
(3.2-incubating-SNAPSHOT). You can only use this version after you
have
build ServiceMix from the latest sources on your machine first.
Look
at
http://incubator.apache.org/servicemix/building.html for
instructions.
Gert
Erik Allais wrote:
i try to generate the Service unit but i have this error
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]
----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:create] (aggregator-style)
[INFO]
----------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO]
**************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource
'VM_global_library.vm'
in
any resource loader.
[INFO] Velocimacro : error using VM library template
VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to
find
resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration
complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline
in
templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined
inline
may
NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline
will
be
global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID:
org.apache.servicemix.samples.helloworld
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: org.apache.servicemix.tooling
ArtifactId: servicemix-service-assembly
Version: 3.2-incubating-SNAPSHOT
Reason: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file
-DgroupId=org.apache.servicemix.tooling
-DartifactId=servicemix-service-assembly \
-Dversion=3.2-incubating-SNAPSHOT -Dpackaging=jar
-Dfile=/path/to/file
org.apache.servicemix.tooling:servicemix-service-assembly:jar:3.2-incubating-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Jun 22 09:55:16 GMT+01:00 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
could u explain me why?
thanks
Erik