You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andy Pols <an...@pols.co.uk> on 2003/04/28 03:03:27 UTC

FW: Weird behaviour if I overload the java:jar goal

Hi Guys

I have discovered a big Sun's Java Web Start such that it refuses to load
maven generated jars!  The reason is that maven adds custom entries to the
manifest and Java WebStart does not like this.

To get around this we created a custom version of the java:jar goal in our
maven.xml file and noticed some weird maven behaviour:

If I use the following maxen.xml...

<project default="java:jar"
   xmlns:j="jelly:core"
    xmlns:m="maven"
    xmlns:reactor="reactor"
    xmlns:deploy="deploy"
    xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary">

    <goal name="custom-build"
        prereqs="java:jar">

        <echo>executing custom build....</echo>

    </goal>

    <goal name="java:jar"
        description="custom jar...">

        <echo>executing custom jar</echo>
        <jar destfile="target/customjar.jar">
            ...
        </jar>
    </goal>
</project>


If I then run "maven custom-build" I get what I expect...


java:jar:
    [echo] executing custom jar
    [jar] Building jar: /Users/andy/projects/staticMesh/target/customjar.jar

custom-build:
    [echo] executing custom build....
BUILD SUCCESSFUL




However, if I then run "maven test custom-build" it runs the tests and the
original java:jar...

java:prepare-filesystem:

java:compile:

java:jar-resources:

test:prepare-filesystem:

test:test-resources:

test:compile:
    normal compiler output...

test:test:
    junit test output...

java:jar:
    [jar] Building jar: /Users/andy/projects/test/target/original-1.0.4.jar


I looked at submitting a patch, but could not work out what was going on...
Cheers
Andy
_________________________________
Pols Consulting Limited
5 The Granary House
Hope Wharf
London, UK
SE164JX

t:+44 (0)207 2375280
f:+44 (0)207 2375280
m:+44 (0)776 9904930
e:andy@pols.co.uk

www.pols.co.uk
www.pols.co.uk/usecasezone

Contributor to ³Patterns for Effective Use Cases² by Addision-Wesley
ISBN 0201721848

------ End of Forwarded Message


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: FW: Weird behaviour if I overload the java:jar goal

Posted by Ben Walding <be...@walding.com>.
It is caused by a faulty manifest ExtensionList entry.

It's been fixed in CVS, but still affects 1.0beta9

Andy Pols wrote:

>Hi Guys
>
>I have discovered a big Sun's Java Web Start such that it refuses to load
>maven generated jars!  The reason is that maven adds custom entries to the
>manifest and Java WebStart does not like this.
>
>To get around this we created a custom version of the java:jar goal in our
>maven.xml file and noticed some weird maven behaviour:
>
>If I use the following maxen.xml...
>
><project default="java:jar"
>   xmlns:j="jelly:core"
>    xmlns:m="maven"
>    xmlns:reactor="reactor"
>    xmlns:deploy="deploy"
>    xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary">
>
>    <goal name="custom-build"
>        prereqs="java:jar">
>
>        <echo>executing custom build....</echo>
>
>    </goal>
>
>    <goal name="java:jar"
>        description="custom jar...">
>
>        <echo>executing custom jar</echo>
>        <jar destfile="target/customjar.jar">
>            ...
>        </jar>
>    </goal>
></project>
>
>
>If I then run "maven custom-build" I get what I expect...
>
>
>java:jar:
>    [echo] executing custom jar
>    [jar] Building jar: /Users/andy/projects/staticMesh/target/customjar.jar
>
>custom-build:
>    [echo] executing custom build....
>BUILD SUCCESSFUL
>
>
>
>
>However, if I then run "maven test custom-build" it runs the tests and the
>original java:jar...
>
>java:prepare-filesystem:
>
>java:compile:
>
>java:jar-resources:
>
>test:prepare-filesystem:
>
>test:test-resources:
>
>test:compile:
>    normal compiler output...
>
>test:test:
>    junit test output...
>
>java:jar:
>    [jar] Building jar: /Users/andy/projects/test/target/original-1.0.4.jar
>
>
>I looked at submitting a patch, but could not work out what was going on...
>Cheers
>Andy
>_________________________________
>Pols Consulting Limited
>5 The Granary House
>Hope Wharf
>London, UK
>SE164JX
>
>t:+44 (0)207 2375280
>f:+44 (0)207 2375280
>m:+44 (0)776 9904930
>e:andy@pols.co.uk
>
>www.pols.co.uk
>www.pols.co.uk/usecasezone
>
>Contributor to ³Patterns for Effective Use Cases² by Addision-Wesley
>ISBN 0201721848
>
>------ End of Forwarded Message
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org