You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by samwun <le...@gmail.com> on 2011/06/22 04:06:52 UTC

how to clean up all generated files under "target" directory

Hello,

Every time when I build a maven project, I need to manually remove all
generated files under the "target" directory.

How can I use maven remove all these files before starting the build?
maven command I used is:

mvn compile war:war

With this command, ff I don't remove all files in the "target" directory,
maven won't update the file for me.

Your suggestion is much appreciated.

Thanks
Sam 

--
View this message in context: http://maven.40175.n5.nabble.com/how-to-clean-up-all-generated-files-under-target-directory-tp4512637p4512637.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


RE: how to clean up all generated files under "target" directory

Posted by Diego Lin <di...@synnex.com>.
Only run "mvn clean". 

-----Original Message-----
From: Sascha Vogt [mailto:sascha.vogt@gmail.com] 
Sent: Wednesday, 22 June 2011 15:31
To: users@maven.apache.org
Subject: Re: how to clean up all generated files under "target"
directory

Hi all,

Am 22.06.2011 04:18, schrieb Barrie Treloar:
> 
> I recommend reading some of the books 
> http://maven.apache.org/articles.html
> 
> If you are doing anything besides just building a plain old jar file, 
> then you need to up skill a bit to make sure you do things right. 
> There is too much complexity in your build to read a of couple pages 
> and hack away and get a correctly working build.

I'm new to maven. Is there any Maven3 documentation out yet?
Specifically I need to create a few new packaging types and I didn't
find good resources on how to do that with Maven3 (I read somewhere that
one can now use Java annotations instead of Javadoc ones.

Any pointer would be really appreciated (even pointers to source code, I
already looked into maven-jar, maven-ear and maven-war but they are all
using the "old?" Javadoc annotations

Greetings
-Sascha-

---------------------------------------------------------------------
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: how to clean up all generated files under "target" directory

Posted by Barrie Treloar <ba...@gmail.com>.
On Wed, Jun 22, 2011 at 5:00 PM, Sascha Vogt <sa...@gmail.com> wrote:
> I'm new to maven. Is there any Maven3 documentation out yet?
> Specifically I need to create a few new packaging types and I didn't
> find good resources on how to do that with Maven3 (I read somewhere that
> one can now use Java annotations instead of Javadoc ones.
>
> Any pointer would be really appreciated (even pointers to source code, I
> already looked into maven-jar, maven-ear and maven-war but they are all
> using the "old?" Javadoc annotations

Start a new thread, as this is different than the original post.

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


Re: how to clean up all generated files under "target" directory

Posted by Sascha Vogt <sa...@gmail.com>.
Hi all,

Am 22.06.2011 04:18, schrieb Barrie Treloar:
> 
> I recommend reading some of the books 
> http://maven.apache.org/articles.html
> 
> If you are doing anything besides just building a plain old jar
> file, then you need to up skill a bit to make sure you do things
> right. There is too much complexity in your build to read a of couple
> pages and hack away and get a correctly working build.

I'm new to maven. Is there any Maven3 documentation out yet?
Specifically I need to create a few new packaging types and I didn't
find good resources on how to do that with Maven3 (I read somewhere that
one can now use Java annotations instead of Javadoc ones.

Any pointer would be really appreciated (even pointers to source code, I
already looked into maven-jar, maven-ear and maven-war but they are all
using the "old?" Javadoc annotations

Greetings
-Sascha-

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


Re: how to clean up all generated files under "target" directory

Posted by Barrie Treloar <ba...@gmail.com>.
On Wed, Jun 22, 2011 at 11:40 AM, Wendy Smoak <ws...@gmail.com> wrote:
> On Tue, Jun 21, 2011 at 10:06 PM, samwun <le...@gmail.com> wrote:
>
>> Every time when I build a maven project, I need to manually remove all
>> generated files under the "target" directory.
>>
>> How can I use maven remove all these files before starting the build?
>> maven command I used is:
>>
>> mvn compile war:war
>
> "mvn clean" will remove the target directory and everything in it.
>
> Try just "mvn clean install" -- not sure why you're having to run the
> war plugin separately.  Is this a webapp project?

I recommend reading some of the books
  http://maven.apache.org/articles.html

If you are doing anything besides just building a plain old jar file,
then you need to up skill a bit to make sure you do things right.
There is too much complexity in your build to read a of couple pages
and hack away and get a correctly working build.

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


Re: how to clean up all generated files under "target" directory

Posted by Wendy Smoak <ws...@gmail.com>.
On Tue, Jun 21, 2011 at 10:06 PM, samwun <le...@gmail.com> wrote:

> Every time when I build a maven project, I need to manually remove all
> generated files under the "target" directory.
>
> How can I use maven remove all these files before starting the build?
> maven command I used is:
>
> mvn compile war:war

"mvn clean" will remove the target directory and everything in it.

Try just "mvn clean install" -- not sure why you're having to run the
war plugin separately.  Is this a webapp project?

-- 
Wendy

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


Resolved Re: how to clean up all generated files under "target" directory

Posted by samwun <le...@gmail.com>.
I just found out.
should use "mvn clean" will do the job.



--
View this message in context: http://maven.40175.n5.nabble.com/how-to-clean-up-all-generated-files-under-target-directory-tp4512637p4512655.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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