PDA

View Full Version : Tough time with Maven for building Echo Spring-ws



xgr3
Dec 16th, 2006, 09:21 PM
I was trying to run the ECHO Spring-WS sample shipped in spring-ws-1.0-m2. But, due to lack of experience of maven I am not able to build the project. If, spring team would have used simple Ant build then life could have been very easy.

Below, is the error that I am getting. I did google and tried to find on maven site but could not found any info to fix this. Do, I need to do special config when running Maven first time. Any help would be appreciated.

C:\spring-ws-1.0-m2\samples\echo>mvn -e package
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: unknown

Reason: Could not find the model file 'C:\spring-ws-1.0-m2\samples\echo\echo\pom.xml'.


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the model file 'C:\spring-ws-1.0-m2\samples\echo\echo\pom.xml'.
at org.apache.maven.DefaultMaven.getProjects(DefaultM aven.java:365)
at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:278)
at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:2 56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.codehaus.classworlds.Launcher.launchEnhanced(L auncher.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.ja va:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Could not find the model file 'C:\spring-ws-1.0-m2\samples\echo\echo\pom.xml'.
at org.apache.maven.project.DefaultMavenProjectBuilde r.readModel(DefaultMavenProjectBuilder.java:1274)
at org.apache.maven.project.DefaultMavenProjectBuilde r.buildFromSourceFileInternal(DefaultMavenProjectB uilder.java:414)
at org.apache.maven.project.DefaultMavenProjectBuilde r.build(DefaultMavenProjectBuilder.java:192)
at org.apache.maven.DefaultMaven.getProject(DefaultMa ven.java:515)
at org.apache.maven.DefaultMaven.collectProjects(Defa ultMaven.java:447)
at org.apache.maven.DefaultMaven.collectProjects(Defa ultMaven.java:491)
at org.apache.maven.DefaultMaven.getProjects(DefaultM aven.java:351)
... 11 more
Caused by: java.io.FileNotFoundException: C:\spring-ws-1.0-m2\samples\echo\echo\pom.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:103)
at java.io.FileReader.<init>(FileReader.java:55)
at org.apache.maven.project.DefaultMavenProjectBuilde r.readModel(DefaultMavenProjectBuilder.java:1269)
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Dec 16 22:06:33 EST 2006
[INFO] Final Memory: 1M/3M
[INFO] ------------------------------------------------------------------------

C:\spring-ws-1.0-m2\samples\echo>

And, when I am running from "C:\spring-ws-1.0-m2\samples\" it is giving following error

C:\spring-ws-1.0-m2\samples\echo>cd ..

C:\spring-ws-1.0-m2\samples>mvn -e package
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [package]
[INFO] ----------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is n
ng one.
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoals(DefaultLifecycleExecutor.java:559)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoalWithLifecycle(DefaultLifecycleExecuto r.java:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoalAndHandleFailures(DefaultLifecycleExe cutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeTaskSegments(DefaultLifecycleExecutor.jav a:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:2 56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.codehaus.classworlds.Launcher.launchEnhanced(L auncher.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.ja va:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build i
using one.
at org.apache.maven.plugin.DefaultPluginManager.execu teMojo(DefaultPluginManager.java:339)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoals(DefaultLifecycleExecutor.java:534)
... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sat Dec 16 22:14:35 EST 2006
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------

C:\spring-ws-1.0-m2\samples>

I followed the instruction as per the maven

Installing Maven 2
==================

The following instructions show how to install Maven 2:

1) Unpack the archive where you would like to store the binaries, eg:
tar zxvf maven-2.0.tar.gz
or
unzip maven-2.0.zip

2) A directory called "maven-2.0" will be created.

3) Add the bin directory to your PATH, eg:
export PATH=/usr/local/maven-2.0/bin:$PATH
or
set PATH="c:\program files\maven-2.0\bin";%PATH%

4) Make sure JAVA_HOME is set to the location of your JDK

5) Run "mvn --version" to verify that it is correctly installed.

For more information, please see http://maven.apache.org

xgr3
Dec 16th, 2006, 09:25 PM
As per Arjen, I am using the POM from https://svn.sourceforge.net/svnroot/springframework/spring-ws/tags/spring-ws-1.0-m2/spring-ws-samples/pom.xml

I updated pom.xml into my "C:\spring-ws-1.0-m2\samples\echo" folder.