I am a newbie user to maven and learn how to get it work in eclipse WTP. The example I found is from IBM developer works: http://www-128.ibm.com/developerworks/edu/j-dw-java-mavenv2.html
My problem is - I can not build and package maven project successfully in Eclipse, whilst everything works directly go through command line. At first I compile and package project directly through command line (A) from top level folder (inside example2 folder), everything works fine. That means I can see the classes compiled and jar files generated. However, if first I create a Java project through Eclipse, then import completed project (example2) to Eclipse workspace. Then using external build tool (Run>External Tools>External Tools....) to build and package the entire project from top level. It always issues build successfully, but nothing happened. I can not see any classes (.class) and jar files generated. If I change to directory OpsImp, then `compile' through eclipse external tool will work. Sadly it issues error if I try to package OpsImp through external tool (erros message is as B). Next, if I change to directory NumOps, then `compile' through eclipse external tool will issue error due to dependency (it is dependent on OpsImp). So it definitively fails whilst doing package. What should I do in order to get this project worked in Eclipse tool? I sincerely appreciate any suggestion. Thank you very much. env: Debian sarge 3.x / JDK 1.5.0_09-b01 / Eclipse 3.21 / Maven-Eclipse-plugin 0.0.9 A.) mvn compile mvn package B.) [ERROR] mojo-execute : jar:jar Diagnosis: Error assembling JAR FATAL ERROR: Error executing Maven for a project [ERROR] project-execute : com.ibm.devworks:OpsImp:jar:1.0-SNAPSHOT ( task-segment: [package] ) Diagnosis: Error assembling JAR FATAL ERROR: Error executing Maven for a project org.apache.maven.lifecycle.LifecycleExecutionException: Error assembling JAR at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140) at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:441) at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:382) at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68) Caused by: org.apache.maven.plugin.MojoExecutionException: Error assembling JAR at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:162) at org.apache.maven.plugin.jar.AbstractJarMojo.execute(AbstractJarMojo.java:174) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534) ... 8 more Caused by: java.lang.NullPointerException at org.apache.maven.artifact.ArtifactUtils.copyArtifact(ArtifactUtils.java:109) at org.apache.maven.project.MavenProject.<init>(MavenProject.java:251) at org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:284) at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:155) ... 11 more 您的生活即時通- 溝通、娛樂、生活、工作一次搞定!