You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christopher Cobb <ch...@wfinet.com> on 2005/12/20 19:33:54 UTC
overridding the output directory
I would occasionally like to put my jar file in a different directory. Is
there something along the lines of:
mvn -Dproject.build.outputDirectory=/tmp/outputDirectory package
that will allow me to do a one-off build without having to modify
configuration files? The line above does not do anything different than the
standard build.
-----------------------------------------
Attention:
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity. The information
contained in this message and or attachments is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged material. If you received this in error, please
contact the sender and delete the material from any system and destroy
any copies.
RE: overridding the output directory
Posted by Christopher Cobb <ch...@wfinet.com>.
Thank you. That looks pretty close to what I was looking for. (The perfect
solution would not involve modifying the pom and could therefore be used
with any arbitrary project. But this might be manageable. Thanks.)
-----Original Message-----
From: Lester Ecarma [mailto:lecarma@exist.com]
Sent: Wednesday, December 21, 2005 2:58 PM
To: Maven Users List
Subject: Re: overridding the output directory
Hi,
Try adding the ff: to your pom
<build>
<directory>${directory}</directory>
</build>
<properties>
<directory>target</directory>
</properties>
Then, you may issue something like
mvn -Ddirectory=tmp/outputDirectory package
This will spit out the jar file in the specified directory
(${basedir}/tmp/outputDirectory). If you want the compiled classes and
test classes to be placed in the same directory, you may extend the pom
fragment to
<build>
<directory>${directory}</directory>
<outputDirectory>${directory}/classes</outputDirectory>
<testOutputDirectory>${directory}/test-classes</testOutputDirectory>
</build>
<properties>
<directory>target</directory>
</properties>
To clean just issue something like
mvn -Ddirectory=tmp clean
Hope this works for you.
-Lester
Christopher Cobb wrote:
>I would occasionally like to put my jar file in a different directory. Is
>there something along the lines of:
>
>
>
>mvn -Dproject.build.outputDirectory=/tmp/outputDirectory package
>
>
>
>that will allow me to do a one-off build without having to modify
>configuration files? The line above does not do anything different than
the
>standard build.
>
>
>
>
>
>
>
>
>
>
>
>
>-----------------------------------------
>Attention:
>Any views expressed in this message are those of the individual sender,
>except where the message states otherwise and the sender is authorized
>to state them to be the views of any such entity. The information
>contained in this message and or attachments is intended only for the
>person or entity to which it is addressed and may contain confidential
>and/or privileged material. If you received this in error, please
>contact the sender and delete the material from any system and destroy
>any copies.
>
>
>
---------------------------------------------------------------------
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
Re: overridding the output directory
Posted by Lester Ecarma <le...@exist.com>.
Hi,
Try adding the ff: to your pom
<build>
<directory>${directory}</directory>
</build>
<properties>
<directory>target</directory>
</properties>
Then, you may issue something like
mvn -Ddirectory=tmp/outputDirectory package
This will spit out the jar file in the specified directory
(${basedir}/tmp/outputDirectory). If you want the compiled classes and
test classes to be placed in the same directory, you may extend the pom
fragment to
<build>
<directory>${directory}</directory>
<outputDirectory>${directory}/classes</outputDirectory>
<testOutputDirectory>${directory}/test-classes</testOutputDirectory>
</build>
<properties>
<directory>target</directory>
</properties>
To clean just issue something like
mvn -Ddirectory=tmp clean
Hope this works for you.
-Lester
Christopher Cobb wrote:
>I would occasionally like to put my jar file in a different directory. Is
>there something along the lines of:
>
>
>
>mvn -Dproject.build.outputDirectory=/tmp/outputDirectory package
>
>
>
>that will allow me to do a one-off build without having to modify
>configuration files? The line above does not do anything different than the
>standard build.
>
>
>
>
>
>
>
>
>
>
>
>
>-----------------------------------------
>Attention:
>Any views expressed in this message are those of the individual sender,
>except where the message states otherwise and the sender is authorized
>to state them to be the views of any such entity. The information
>contained in this message and or attachments is intended only for the
>person or entity to which it is addressed and may contain confidential
>and/or privileged material. If you received this in error, please
>contact the sender and delete the material from any system and destroy
>any copies.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: overridding the output directory
Posted by Allan Ramirez <ar...@exist.com>.
Hi Christopher,
You may use another pom for it, let's say pom2.xml. Configure the pom
with the
<build>
<outputDirectory>tmp/outputDirectory</outputDirectory>
...
</build>
and execute the mvn command "mvn install -f pom2.xml"
-allan
Christopher Cobb wrote:
>I would occasionally like to put my jar file in a different directory. Is
>there something along the lines of:
>
>
>
>mvn -Dproject.build.outputDirectory=/tmp/outputDirectory package
>
>
>
>that will allow me to do a one-off build without having to modify
>configuration files? The line above does not do anything different than the
>standard build.
>
>
>
>
>
>
>
>
>
>
>
>
>-----------------------------------------
>Attention:
>Any views expressed in this message are those of the individual sender,
>except where the message states otherwise and the sender is authorized
>to state them to be the views of any such entity. The information
>contained in this message and or attachments is intended only for the
>person or entity to which it is addressed and may contain confidential
>and/or privileged material. If you received this in error, please
>contact the sender and delete the material from any system and destroy
>any copies.
>
>
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 12/16/2005
>
>