Hi,
I've created an XWiki plugin, which uses a whole lot of frameworks to
do it's job, including
WebObjects, ProjectWonder and some of our own frameworks. It's running
fine in Eclipse.
When I package the resulting webapp from the workspace's server area
(.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/xe-
debug-web)
into a war file, I can deploy the result in a webserver.
Now I would like to be able to package the xe-debug-web from the
command line
or Eclipse into a .war. However: When I invoke mvn clean package (or
any other
mvn command for that matter) inside the xe-debug-web project
directory, i get the
following error message:
mvn package :
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: xe-debug-web:xe-debug-web
Reason: Parent: null:xwiki-web-standard:war:null of project: xe-debug-
web:xe-debug-web has wrong packaging: war. Must be 'pom'. for project
xe-debug-web:xe-debug-web
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Parent: null:xwiki-
web-standard:war:null of project: xe-debug-web:xe-debug-web has wrong
packaging: war. Must be 'pom'. for project xe-debug-web:xe-debug-web
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: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.project.ProjectBuildingException: Parent:
null:xwiki-web-standard:war:null of project: xe-debug-web:xe-debug-web
has wrong packaging: war. Must be 'pom'. for project xe-debug-web:xe-
debug-web
at
org
.apache
.maven
.project
.DefaultMavenProjectBuilder
.assembleLineage(DefaultMavenProjectBuilder.java:1377)
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
[INFO]
------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Dec 03 18:41:14 CET 2008
[INFO] Final Memory: 1M/2M
[INFO]
------------------------------------------------------------------------
I don't know what to do about this message. So my thought was to
create a Maven goal
in Eclipse from the run configurations. However, the 'war' goal seems
to be quite fussy
about the layout, and the xe-debug-web project layout does not to be
satisfactory:
...
[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[xe-debug-web] in [/Users/simon/Projects/
Kontrast/MavenWorkspace/xe-debug-web/target/xe-debug-web-1.6.1]
[INFO] Processing war project
[INFO] Copy webapp webResources[/Users/simon/Projects/Kontrast/
MavenWorkspace/xe-debug-web/target/maven-shared-archive-resources] to[/
Users/simon/Projects/Kontrast/MavenWorkspace/xe-debug-web/target/xe-
debug-web-1.6.1]
[INFO] Copy webapp webResources[/Users/simon/Projects/Kontrast/
MavenWorkspace/xe-debug-web/target/maven-shared-archive-resources/META-
INF] to[/Users/simon/Projects/Kontrast/MavenWorkspace/xe-debug-web/
target/xe-debug-web-1.6.1]
[INFO] Copy webapp webResources[/Users/simon/Projects/Kontrast/
MavenWorkspace/xe-debug-web/src/main/webInfResources] to[/Users/simon/
Projects/Kontrast/MavenWorkspace/xe-debug-web/target/xe-debug-web-1.6.1]
Exception in thread "main" java.lang.IllegalStateException: basedir /
Users/simon/Projects/Kontrast/MavenWorkspace/xe-debug-web/src/main/
webInfResources does not exist
at
org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:
550)
...
Since both approaches failed, I need some advice on how to package the
xe-debug-web into
a proper WAR file again.
All pointers much appreciated,
J.L.Simon