You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christian Andersson <ca...@ofs.no> on 2007/11/13 16:13:51 UTC

maven2 compilation problem

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

-- 
Christian Andersson - ca@ofs.no

Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no


Re: maven2 compilation problem

Posted by Stuart McCulloch <st...@jayway.net>.
On 14/11/2007, Christian Andersson <ca...@ofs.no> wrote:
>
> Thank you that was the problem, I had a written multiline <description>
> tag in the pom.xml for the first project.
>
> the best would be if either maven2 complained about this when creating
> my first project OR convert "illegal" characters to something legal.


definitely, it should really handle this for you - you might want to add a
comment to:

   http://jira.codehaus.org/browse/MJAR-50

to let them know that it's still an open issue... (mention which version of
maven you used)

Stuart McCulloch skrev:
> > On 14/11/2007, Christian Andersson <ca...@ofs.no> wrote:
> >> I have defined it in my second project, otherwise it would not had
> tried
> >> to load it. since the only plac eI have it in the parent project is in
> >> the dependencymanegment so that I get the same version number for all
> my
> >> projects..
> >>
> >> my problem seems to be that maven has created a jar file for my first
> >> project that my second project cannot read (which I think is strange)
> >
> >
> > "invalid header field" usually means the manifest contains some bogus
> values
> > (ie. some attributes have extra line-feeds or tabs where they're not
> > expected)
> >
> > this is why you can unzip the jarfile using basic (un)zip tools, but it
> > can't be read
> > with the Java (un)archiver which checks for and expects a valid manifest
> > file.
> >
> > you might want to check your POM to see if there are any entries that
> might
> > have extra line-feeds or tabs. There appear to be a couple of bugs
> reported
> > relating to this, but they suggest this is already fixed in Plexus
> > (PLX-185)...
> >
> >    http://jira.codehaus.org/browse/MJAR-50
> >
> > or do you add your own customized manifest to the jar?
> >
> > what I have done is the following..
> >> cd projecta
> >> mvn clean install
> >> cd ../projectb
> >> mvn clean install
> >>
> >> so it should be able to read it..
> >>
> >> Nicole Lacoste skrev:
> >>> 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 <ca...@ofs.no> 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: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>> --
> >>>> Christian Andersson - ca@ofs.no
> >>>>
> >>>> Configuration and Collaboration for OpenOffice.org
> >>>> Open Framework Systems AS http://www.ofs.no
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >> --
> >> Christian Andersson - ca@ofs.no
> >>
> >> Configuration and Collaboration for OpenOffice.org
> >> Open Framework Systems AS http://www.ofs.no
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >
> >
> >
>
> --
> Christian Andersson - ca@ofs.no
>
> Configuration and Collaboration for OpenOffice.org
> Open Framework Systems AS http://www.ofs.no
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Cheers, Stuart

Re: maven2 compilation problem

Posted by Christian Andersson <ca...@ofs.no>.
Thank you that was the problem, I had a written multiline <description>
tag in the pom.xml for the first project.

the best would be if either maven2 complained about this when creating
my first project OR convert "illegal" characters to something legal.


Stuart McCulloch skrev:
> On 14/11/2007, Christian Andersson <ca...@ofs.no> wrote:
>> I have defined it in my second project, otherwise it would not had tried
>> to load it. since the only plac eI have it in the parent project is in
>> the dependencymanegment so that I get the same version number for all my
>> projects..
>>
>> my problem seems to be that maven has created a jar file for my first
>> project that my second project cannot read (which I think is strange)
> 
> 
> "invalid header field" usually means the manifest contains some bogus values
> (ie. some attributes have extra line-feeds or tabs where they're not
> expected)
> 
> this is why you can unzip the jarfile using basic (un)zip tools, but it
> can't be read
> with the Java (un)archiver which checks for and expects a valid manifest
> file.
> 
> you might want to check your POM to see if there are any entries that might
> have extra line-feeds or tabs. There appear to be a couple of bugs reported
> relating to this, but they suggest this is already fixed in Plexus
> (PLX-185)...
> 
>    http://jira.codehaus.org/browse/MJAR-50
> 
> or do you add your own customized manifest to the jar?
> 
> what I have done is the following..
>> cd projecta
>> mvn clean install
>> cd ../projectb
>> mvn clean install
>>
>> so it should be able to read it..
>>
>> Nicole Lacoste skrev:
>>> 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 <ca...@ofs.no> 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: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> --
>>>> Christian Andersson - ca@ofs.no
>>>>
>>>> Configuration and Collaboration for OpenOffice.org
>>>> Open Framework Systems AS http://www.ofs.no
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>> --
>> Christian Andersson - ca@ofs.no
>>
>> Configuration and Collaboration for OpenOffice.org
>> Open Framework Systems AS http://www.ofs.no
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> 
> 
> 

-- 
Christian Andersson - ca@ofs.no

Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no


Re: maven2 compilation problem

Posted by Stuart McCulloch <st...@jayway.net>.
On 14/11/2007, Christian Andersson <ca...@ofs.no> wrote:
>
> I have defined it in my second project, otherwise it would not had tried
> to load it. since the only plac eI have it in the parent project is in
> the dependencymanegment so that I get the same version number for all my
> projects..
>
> my problem seems to be that maven has created a jar file for my first
> project that my second project cannot read (which I think is strange)


"invalid header field" usually means the manifest contains some bogus values
(ie. some attributes have extra line-feeds or tabs where they're not
expected)

this is why you can unzip the jarfile using basic (un)zip tools, but it
can't be read
with the Java (un)archiver which checks for and expects a valid manifest
file.

you might want to check your POM to see if there are any entries that might
have extra line-feeds or tabs. There appear to be a couple of bugs reported
relating to this, but they suggest this is already fixed in Plexus
(PLX-185)...

   http://jira.codehaus.org/browse/MJAR-50

or do you add your own customized manifest to the jar?

what I have done is the following..
>
> cd projecta
> mvn clean install
> cd ../projectb
> mvn clean install
>
> so it should be able to read it..
>
> Nicole Lacoste skrev:
> > 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 <ca...@ofs.no> 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: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >> --
> >> Christian Andersson - ca@ofs.no
> >>
> >> Configuration and Collaboration for OpenOffice.org
> >> Open Framework Systems AS http://www.ofs.no
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >
>
> --
> Christian Andersson - ca@ofs.no
>
> Configuration and Collaboration for OpenOffice.org
> Open Framework Systems AS http://www.ofs.no
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Cheers, Stuart

Re: maven2 compilation problem

Posted by Christian Andersson <ca...@ofs.no>.
I have defined it in my second project, otherwise it would not had tried
to load it. since the only plac eI have it in the parent project is in
the dependencymanegment so that I get the same version number for all my
projects..

my problem seems to be that maven has created a jar file for my first
project that my second project cannot read (which I think is strange)

what I have done is the following..

cd projecta
mvn clean install
cd ../projectb
mvn clean install

so it should be able to read it..

Nicole Lacoste skrev:
> 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 <ca...@ofs.no> 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: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>> --
>> Christian Andersson - ca@ofs.no
>>
>> Configuration and Collaboration for OpenOffice.org
>> Open Framework Systems AS http://www.ofs.no
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> 

-- 
Christian Andersson - ca@ofs.no

Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no


Re: maven2 compilation problem

Posted by Nicole Lacoste <ni...@gmail.com>.
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 <ca...@ofs.no> 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: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
>
> --
> Christian Andersson - ca@ofs.no
>
> Configuration and Collaboration for OpenOffice.org
> Open Framework Systems AS http://www.ofs.no
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Re: maven2 compilation problem

Posted by Christian Andersson <ca...@ofs.no>.
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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

-- 
Christian Andersson - ca@ofs.no

Configuration and Collaboration for OpenOffice.org
Open Framework Systems AS http://www.ofs.no