You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Gary Kind <ga...@oracle.com> on 2007/02/05 19:43:13 UTC

How do I zip up a source directory in my pom.xml?

I need to zip up a source directory subtree within my pom.xml.  Probably 
the best place to do this for me would be in the compile phase or when 
using the surefire plugin to to mvn test.   How do I do this?  I tried 
the assembly plugin, but I could not control the root directory in my 
zip file.  No matter what I did, the assembly plugin inserted a root 
directory that I did not want. Please help.  This is blocking me at present.

I am not against running a simple zip OS command. I know there is a way 
of running an OS command (like 'rm' or delete) but I cannot find it on 
the web.  And I am NOT using Ant.  Thanks!!!!

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


Re: How do I zip up a source directory in my pom.xml?

Posted by Stephane Nicoll <st...@gmail.com>.
Hi,

On 2/5/07, Gary Kind <ga...@oracle.com> wrote:
> I need to zip up a source directory subtree within my pom.xml.  Probably
> the best place to do this for me would be in the compile phase or when
> using the surefire plugin to to mvn test.   How do I do this?  I tried
> the assembly plugin, but I could not control the root directory in my
> zip file.  No matter what I did, the assembly plugin inserted a root
> directory that I did not want. Please help.  This is blocking me at present.

includeBaseDirector[1] is an option in your descriptor that allows to
control this. Set it to false to *not* create that root directory.

HTH,
Stéphane

[1] http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html

>
> I am not against running a simple zip OS command. I know there is a way
> of running an OS command (like 'rm' or delete) but I cannot find it on
> the web.  And I am NOT using Ant.  Thanks!!!!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

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


Re: How do I zip up a source directory in my pom.xml?

Posted by drekka <de...@aegeon.com.au>.
Hi, 

I've been using the source:jar target in maven to jar up the source
directories. It may do what you are looking for.

ciao
Derek


Gary Kind wrote:
> 
> I need to zip up a source directory subtree within my pom.xml.  Probably 
> the best place to do this for me would be in the compile phase or when 
> using the surefire plugin to to mvn test.   How do I do this?  I tried 
> the assembly plugin, but I could not control the root directory in my 
> zip file.  No matter what I did, the assembly plugin inserted a root 
> directory that I did not want. Please help.  This is blocking me at
> present.
> 
> I am not against running a simple zip OS command. I know there is a way 
> of running an OS command (like 'rm' or delete) but I cannot find it on 
> the web.  And I am NOT using Ant.  Thanks!!!!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-do-I-zip-up-a-source-directory-in-my-pom.xml--tf3176160s177.html#a8817170
Sent from the Maven Developers mailing list archive at Nabble.com.


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


Re: How do I zip up a source directory in my pom.xml?

Posted by Jason van Zyl <ja...@maven.org>.
On 5 Feb 07, at 1:43 PM 5 Feb 07, Gary Kind wrote:

> I need to zip up a source directory subtree within my pom.xml.   
> Probably the best place to do this for me would be in the compile  
> phase or when using the surefire plugin to to mvn test.   How do I  
> do this?  I tried the assembly plugin, but I could not control the  
> root directory in my zip file.  No matter what I did, the assembly  
> plugin inserted a root directory that I did not want. Please help.   
> This is blocking me at present.

If you are trying to produce an archive of your sources I would  
highly suggest that you use what we typically use. Running

mvn source:jar

Will do the trick and it takes care of generating any sources before  
creating the JAR file.

Jason.

>
> I am not against running a simple zip OS command. I know there is a  
> way of running an OS command (like 'rm' or delete) but I cannot  
> find it on the web.  And I am NOT using Ant.  Thanks!!!!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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