Hi Christian, If you want to depend on another artifact you must define the artifact in the depencencies section in the pom of the project that needs the dependecy, not its parent. You can have a dependency management section in a project's parent pom where you declare the version number, so that when you declare the dependency in the child(ren) project, you don't have to declare the versionn, and if there are multiple children they all get the same version. I suggest you read chapter 3 of Better Builds with Maven, you can download it at http://www.devzuz.com/web/guest/products/resources.
Good luck, Nicole On 14/11/2007, Christian Andersson <[EMAIL PROTECTED]> wrote: > > anyone, this completely stops me from going to maven 2 > > Christian Andersson skrev: > > OK, I have successfully created a pom.xm (with a parent pom.xml) and > > built my first maven2 project (minus some stuff described in earlier > mails) > > > > but when I tried to create my second maven2 project that depends on the > > first one, I got into problems... > > > > the second project depends on the first project and the version is > > defined in the parent pom. > > > > when I try to do a mvn install I get the following error.. > > > > error: error reading > > /home/user/.m2/repository/mygroup/myproject/1.0.0/myproject-1.0.0.jar; > > invalid header field > > > > from using amny different zip tools I cannot see that there is any > > problems with the .jar file so it is probably something about the > content... > > > > > > running with -e shows this.. (which I don't understand a thing about) > > > > [INFO] > > ------------------------------------------------------------------------ > > [INFO] Trace > > org.apache.maven.BuildFailureException: Compilation failure > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( > DefaultLifecycleExecutor.java:560) > > at > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle > (DefaultLifecycleExecutor.java:480) > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal( > DefaultLifecycleExecutor.java:459) > > at > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures > (DefaultLifecycleExecutor.java:311) > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( > DefaultLifecycleExecutor.java:278) > > 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:280) > > 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.plugin.CompilationFailureException: > > Compilation failure > > at > > org.apache.maven.plugin.AbstractCompilerMojo.execute( > AbstractCompilerMojo.java:505) > > at > > org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:111) > > at > > org.apache.maven.plugin.DefaultPluginManager.executeMojo( > DefaultPluginManager.java:443) > > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( > DefaultLifecycleExecutor.java:539) > > ... 16 more > > > > > > > > ------------------------------------------------------------------------ > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > -- > Christian Andersson - [EMAIL PROTECTED] > > Configuration and Collaboration for OpenOffice.org > Open Framework Systems AS http://www.ofs.no > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
