Some questions remaining:
Webapps usually gather all their dependencies in WEB-INF/lib. Is there
any easy way to ask maven to copy somewhere all needed jars, or at least
give their location in maven cache? Otherwise, this should also be
documented.
By the way, in which config file can one change the version number of a
dependancy?
In the tools subprojects, we had very handy "start.showcase.webapp" and
"stop.showcase.webapp" that would start/stop the showcase webapp using
Jetty on the configured port. Is there any way to do it using maven?
Claude
On 09/09/2010 23:31, Nathan Bubna wrote:
ant -p is needed because targets are always custom. Maven goals are
standardized, so users are expected to know the basics :
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
mvn install is usually where i begin.
maven has dependency management at the core. getting dependencies is
the first thing it tries to do. if it can't find them, then it stops.
one very useful part of moving to maven is that we can have a master
pom that saves us from repeating common project info in all of our
projects. of course, that means all projects have the master pom as a
dependency. so, until we publicly release a velocity master pom, you
will have to locally install it before you can build any of these
refactored projects. the master pom project is at:
https://svn.apache.org/repos/asf/velocity/sandbox/maven-reorg/maven/trunk/pom
check that out and do a "mvn install" there, then go try the engine
project again.
of course, all of this will need to be documented once it moves into
our active dev branches/trunks.
On Thu, Sep 9, 2010 at 1:28 PM, Claude Brissonwrote:
To unsubscribe, e-mail:dev-unsubscribe@velocity.apache.org
For additional commands, e-mail:dev-help@velocity.apache.org
ant -p is needed because targets are always custom. Maven goals are
standardized, so users are expected to know the basics :
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
mvn install is usually where i begin.
maven has dependency management at the core. getting dependencies is
the first thing it tries to do. if it can't find them, then it stops.
one very useful part of moving to maven is that we can have a master
pom that saves us from repeating common project info in all of our
projects. of course, that means all projects have the master pom as a
dependency. so, until we publicly release a velocity master pom, you
will have to locally install it before you can build any of these
refactored projects. the master pom project is at:
https://svn.apache.org/repos/asf/velocity/sandbox/maven-reorg/maven/trunk/pom
check that out and do a "mvn install" there, then go try the engine
project again.
of course, all of this will need to be documented once it moves into
our active dev branches/trunks.
On Thu, Sep 9, 2010 at 1:28 PM, Claude Brissonwrote:
I checked out the sandbox and changed directory to
sandbox/maven-reorg/engine/trunk. Once there, I look into the Readme.txt.
Bad luck, it still does reference "ant".
Ok. I recall something about invoking maven with an "mvn" command...
I first try a mvn --help ; nothing in the given options tells me how to
obtain a list of valid build goals/phases (like the standardized and very
handy "ant -p").
Ok, I tried "mvn" without any argument, and got:
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
Reason: Cannot find parent: org.apache.velocity:velocity-master for
project:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT for
project org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find
parent: org.apache.velocity:velocity-master for project:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT for
project org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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:597)
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.project.ProjectBuildingException: Cannot
find parent: org.apache.velocity:velocity-master for project:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT for
project org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
at
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM
'org.apache.velocity:velocity-master' not found in repository:
Unable to download the artifact from any repository
org.apache.velocity:velocity-master:pom:1-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.apache.velocity:velocity-master
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:603)
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
... 17 more
Caused by:
org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable
to download the artifact from any repository
org.apache.velocity:velocity-master:pom:1-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:556)
... 18 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:331)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
... 20 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time:< 1 second
[INFO] Finished at: Thu Sep 09 22:13:32 CEST 2010
[INFO] Final Memory: 1M/50M
[INFO]
------------------------------------------------------------------------
Same result with the tools subproject.
So I guess the maven build does not yet work out-of-the-box...
Also, I would like to understand why it was needed to split the source-tree
in so many sub-modules. Can't the build system figure out which sources are
needed for such or such target?
Claude
---------------------------------------------------------------------sandbox/maven-reorg/engine/trunk. Once there, I look into the Readme.txt.
Bad luck, it still does reference "ant".
Ok. I recall something about invoking maven with an "mvn" command...
I first try a mvn --help ; nothing in the given options tells me how to
obtain a list of valid build goals/phases (like the standardized and very
handy "ant -p").
Ok, I tried "mvn" without any argument, and got:
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
Reason: Cannot find parent: org.apache.velocity:velocity-master for
project:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT for
project org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find
parent: org.apache.velocity:velocity-master for project:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT for
project org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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:597)
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.project.ProjectBuildingException: Cannot
find parent: org.apache.velocity:velocity-master for project:
org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT for
project org.apache.velocity:velocity-engine-parent:pom:2.0.0-SNAPSHOT
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
at
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM
'org.apache.velocity:velocity-master' not found in repository:
Unable to download the artifact from any repository
org.apache.velocity:velocity-master:pom:1-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.apache.velocity:velocity-master
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:603)
at
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
... 17 more
Caused by:
org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable
to download the artifact from any repository
org.apache.velocity:velocity-master:pom:1-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:556)
... 18 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:331)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
... 20 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time:< 1 second
[INFO] Finished at: Thu Sep 09 22:13:32 CEST 2010
[INFO] Final Memory: 1M/50M
[INFO]
------------------------------------------------------------------------
Same result with the tools subproject.
So I guess the maven build does not yet work out-of-the-box...
Also, I would like to understand why it was needed to split the source-tree
in so many sub-modules. Can't the build system figure out which sources are
needed for such or such target?
Claude
To unsubscribe, e-mail:dev-unsubscribe@velocity.apache.org
For additional commands, e-mail:dev-help@velocity.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
