You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Jefferson K. French" <je...@frenches.org> on 2003/12/07 12:57:06 UTC

Unable to override a subproject's maven.final.name

I have a jar:jar preGoal in my master maven.xml file that sets the
maven.final.name property as such:

  <j:set var="maven.final.name"
         value="${pom.artifactId}-${mdbRelease}"/>

I then run install-snapshot using multiproject, and echo the value of
maven.final.name immediately after setting it. It is correct. But when
I echo it from within the jar:jar goal, maven.final.name contains the
name set by jar:snapshot.

Should I be able to override maven.final.name this way? If so, any
ideas what I could be doing wrong? Since jar:snapshot attains the
jar:jar goal after setting maven.final.name, I figured my preGoal
would override that setting.

Thanks.

    Jeff

-- 
mailto:jeff@frenches.org



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


Re: Unable to override a subproject's maven.final.name

Posted by "Jefferson K. French" <je...@frenches.org>.
Thanks, Peter. If I set maven.final.name in project.properties, how do
I selectively override it? My example left out the conditional logic
in an attempt to illustrate my problem, but what I'm trying to do is
this:

  o Developers use jar:install-snapshot to install new snapshots in
    their local repository. This will create jars with the usual
    timestamp-based name.

  o Our official, automated build uses a goal in maven.xml that
    changes the final jar name to one that is based on a build number,
    then invokes jar:deploy-snapshot to deploy the build to our
    company repository. 

So I only want to change maven.final.name for a specific goal. What's
confusing me is that when I do change the property in maven.xml, it
looks OK in the pre and post goals, but not the main jar:jar goal
itself.

Is there a better way to accomplish what I'm trying to do?

  Jeff

On Mon, 8 Dec 2003, at 07:32:23 [GMT +0000] gps@roe.ac.uk wrote:

> Hi Jeff,

> On Sun, Dec 07, 2003 at 10:51:14PM -0600, Jefferson K. French wrote:
>> When I set the value of maven.final.name in a jar:jar preGoal, it has
>> the correct value there and in the jar:jar postGoal. But for some
>> reason it contains an earlier value in the jar:jar goal.
>> 
>> I've put echo tags in a few pre/post goals, as well as a couple in the
>> jar plugin's plugin.jelly file to show the value of maven.final.name
>> at various points. I set the property in maven.xml like this:
>> 
>>   <preGoal name="jar:jar">
>>     <j:set var="maven.final.name" value="${pom.artifactId}-${mdbRelease}"/>
>>     <echo>jar:jar preGoal: maven.final.name=${maven.final.name}</echo>
>>   </preGoal>
>> 
>> Any idea what I could be doing wrong?

> You need to set maven.final.name in the project.properties file (as you know, at the same directory level as your current project.xml).

> Peter

-- 
mailto:jeff@frenches.org



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


Re: Unable to override a subproject's maven.final.name

Posted by gp...@roe.ac.uk.
Hi Jeff,

On Sun, Dec 07, 2003 at 10:51:14PM -0600, Jefferson K. French wrote:
> When I set the value of maven.final.name in a jar:jar preGoal, it has
> the correct value there and in the jar:jar postGoal. But for some
> reason it contains an earlier value in the jar:jar goal.
> 
> I've put echo tags in a few pre/post goals, as well as a couple in the
> jar plugin's plugin.jelly file to show the value of maven.final.name
> at various points. I set the property in maven.xml like this:
> 
>   <preGoal name="jar:jar">
>     <j:set var="maven.final.name" value="${pom.artifactId}-${mdbRelease}"/>
>     <echo>jar:jar preGoal: maven.final.name=${maven.final.name}</echo>
>   </preGoal>
> 
> Any idea what I could be doing wrong?

You need to set maven.final.name in the project.properties file (as you know, at the same directory level as your current project.xml).

Peter
-- 
Peter Shillan  AstroGrid Java Developer
gps@roe.ac.uk  (UK)-(0)131-668-8282

Institute for Astronomy, Blackford Hill, Edinburgh, EH9 3HJ.

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


Re: Unable to override a subproject's maven.final.name

Posted by "Jefferson K. French" <je...@frenches.org>.
When I set the value of maven.final.name in a jar:jar preGoal, it has
the correct value there and in the jar:jar postGoal. But for some
reason it contains an earlier value in the jar:jar goal.

I've put echo tags in a few pre/post goals, as well as a couple in the
jar plugin's plugin.jelly file to show the value of maven.final.name
at various points. I set the property in maven.xml like this:

  <preGoal name="jar:jar">
    <j:set var="maven.final.name" value="${pom.artifactId}-${mdbRelease}"/>
    <echo>jar:jar preGoal: maven.final.name=${maven.final.name}</echo>
  </preGoal>

Any idea what I could be doing wrong?

--- Begin install-snapshot output ---

$ maven -DmdbRelease=0.1.5 jar:install-snapshot
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc2-SNAPSHOT

jar:snapshot:
    [echo] jar:snapshot preGoal: maven.final.name=mdb-util-SNAPSHOT
    [echo] jar:snapshot goal: maven.final.name=mdb-util-SNAPSHOT
    [echo] Building snapshot JAR: mdb-util-20031208.012744
java:prepare-filesystem:

java:compile:
    [echo] Compiling to /home/jeff/work/mdb/common/mdb-util/target/classes
    [javac] Compiling 2 source files to /home/jeff/work/mdb/common/mdb-util/target/classes

java:jar-resources:

test:prepare-filesystem:

test:test-resources:

test:compile:
    [echo] No test source files to compile.

test:test:
    [echo] No tests to run.

jar:jar:
    [echo] jar:jar preGoal: maven.final.name=mdb-util-0.1.5
    [echo] jar:jar goal: maven.final.name=mdb-util-20031208.012744
    [jar] Building jar: /home/jeff/work/mdb/common/mdb-util/target/mdb-util-20031208.012744.jar
    [echo] jar:jar postGoal: maven.final.name=mdb-util-0.1.5
aspectj:init:


    [echo] jar:snapshot postGoal: maven.final.name=mdb-util-0.1.5

jar:install-snapshot:
    [echo] jar:install-snapshot preGoal: maven.final.name=mdb-util-0.1.5
    [copy] Copying 1 file to /home/jeff/.maven/repository/mdb/jars
    [copy] Copying /home/jeff/work/mdb/common/mdb-util/target/mdb-util-20031208.012744.jar to /home/jeff/.maven/repository/mdb/jars/mdb-util-SNAPSHOT.jar
    [copy] Copying 1 file to /home/jeff/.maven/repository/mdb/jars
    [copy] Copying /home/jeff/work/mdb/common/mdb-util/target/mdb-util-20031208.012744.jar to /home/jeff/.maven/repository/mdb/jars/mdb-util-20031208.012744.jar
    [echo] jar:install-snapshot postGoal: maven.final.name=mdb-util-0.1.5
BUILD SUCCESSFUL
Total time: 25 seconds
Finished at: Sun Dec 07 19:27:51 CST 2003

--- End install-snapshot output ---

On Sun, 7 Dec 2003, at 05:57:06 [GMT -0600] Jefferson K. French wrote:

> I have a jar:jar preGoal in my master maven.xml file that sets the
> maven.final.name property as such:

>   <j:set var="maven.final.name"
>          value="${pom.artifactId}-${mdbRelease}"/>

> I then run install-snapshot using multiproject, and echo the value of
> maven.final.name immediately after setting it. It is correct. But when
> I echo it from within the jar:jar goal, maven.final.name contains the
> name set by jar:snapshot.

> Should I be able to override maven.final.name this way? If so, any
> ideas what I could be doing wrong? Since jar:snapshot attains the
> jar:jar goal after setting maven.final.name, I figured my preGoal
> would override that setting.

> Thanks.

>     Jeff


-- 
mailto:jeff@frenches.org



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