You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Phillip Hellewell <ss...@gmail.com> on 2010/10/08 00:46:54 UTC

Clean up unpacked dependencies...

I have a dumb question.  If I unpack dependencies to a deps subfolder,
should mvn clean be cleaning those up automatically?  Or should I
attach a goal to the clean phase to do it?  Or should I not be
worrying about this at all because unpack-dependencies already knows
how to replace files when newer.

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 8, 2010 at 1:23 PM, Stephen Connolly
<st...@gmail.com> wrote:
> plugins attach artifacts they generate to the reactor.
>
> you can also use build-helper-maven-plugin@mojo to attach artifacts if
> you are hacking about off the maven way (which you seem unnaturally
> prone to do)

Thanks.  That wasn't really what I was getting at, but it is good to
know in case I need it someday.

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Stephen Connolly <st...@gmail.com>.
plugins attach artifacts they generate to the reactor.

you can also use build-helper-maven-plugin@mojo to attach artifacts if
you are hacking about off the maven way (which you seem unnaturally
prone to do)

-Stephen

On 8 October 2010 18:51, Phillip Hellewell <ss...@gmail.com> wrote:
> On Fri, Oct 8, 2010 at 11:47 AM, Jon Paynter <ki...@gmail.com> wrote:
>>
>> Well based on what ive seen -- "binary artifacts" ie, jar, war, ear and pom
>> files are all generated, so they get installed.
>> Then any assemblies that you have marked as attached will also get
>> installed.
>
> Just for fun I did a test and created a bunch of files in my target
> dir named artifact-version.zip, artifact-version.jar, etc.  But it
> only installed the one that was actually generated by the package
> step.
>
> So I don't know how it could possible know, unless it somehow asks the
> plugin whose goals are bound to the package phase what it generated.
>
> Phillip
>
> ---------------------------------------------------------------------
> 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: Clean up unpacked dependencies...

Posted by Brian Fox <br...@infinity.nu>.
The plugins are responsible for registering their artifacts into the
model. The build-helper-maven plugin has a goal that will let you
attach files from the pom


On Oct 8, 2010, at 1:51 PM, Phillip Hellewell <ss...@gmail.com> wrote:

> On Fri, Oct 8, 2010 at 11:47 AM, Jon Paynter <ki...@gmail.com> wrote:
>>
>> Well based on what ive seen -- "binary artifacts" ie, jar, war, ear and pom
>> files are all generated, so they get installed.
>> Then any assemblies that you have marked as attached will also get
>> installed.
>
> Just for fun I did a test and created a bunch of files in my target
> dir named artifact-version.zip, artifact-version.jar, etc.  But it
> only installed the one that was actually generated by the package
> step.
>
> So I don't know how it could possible know, unless it somehow asks the
> plugin whose goals are bound to the package phase what it generated.
>
> Phillip
>
> ---------------------------------------------------------------------
> 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: Clean up unpacked dependencies...

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 8, 2010 at 11:47 AM, Jon Paynter <ki...@gmail.com> wrote:
>
> Well based on what ive seen -- "binary artifacts" ie, jar, war, ear and pom
> files are all generated, so they get installed.
> Then any assemblies that you have marked as attached will also get
> installed.

Just for fun I did a test and created a bunch of files in my target
dir named artifact-version.zip, artifact-version.jar, etc.  But it
only installed the one that was actually generated by the package
step.

So I don't know how it could possible know, unless it somehow asks the
plugin whose goals are bound to the package phase what it generated.

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Jon Paynter <ki...@gmail.com>.
On Fri, Oct 8, 2010 at 10:39 AM, Phillip Hellewell <ss...@gmail.com> wrote:

> On Fri, Oct 8, 2010 at 11:35 AM, Jon Paynter <ki...@gmail.com> wrote:
> > The 'install' goal just puts the generated/attached artifacts into your
> > repository.
>
> This is just out of pure curiosity.  How does it know which ones were
>  generated/attached?


Well based on what ive seen -- "binary artifacts" ie, jar, war, ear and pom
files are all generated, so they get installed.
Then any assemblies that you have marked as attached will also get
installed.

there may be other criteria - but thats what ive gatherd from observation.

Re: Clean up unpacked dependencies...

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 8, 2010 at 11:39 AM, Phillip Hellewell <ss...@gmail.com> wrote:
> On Fri, Oct 8, 2010 at 11:35 AM, Jon Paynter <ki...@gmail.com> wrote:
>> The 'install' goal just puts the generated/attached artifacts into your
>> repository.
>
> This is just out of pure curiosity.  How does it know which ones were
> generated/attached?

Does it somehow ask the goals bound to the package phase or something?

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 8, 2010 at 11:35 AM, Jon Paynter <ki...@gmail.com> wrote:
> The 'install' goal just puts the generated/attached artifacts into your
> repository.

This is just out of pure curiosity.  How does it know which ones were
generated/attached?

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Jon Paynter <ki...@gmail.com>.
The 'install' goal just puts the generated/attached artifacts into your
repository.

deploy I havent used (yet) so I cant say.

On Fri, Oct 8, 2010 at 10:28 AM, Phillip Hellewell <ss...@gmail.com> wrote:

> On Fri, Oct 8, 2010 at 10:58 AM, Jörg Schaible <jo...@gmx.de>
> wrote:
> >
> > As a rule of thumb: Put anything that is somehow generated, downloaded,
> > unpacked, ... into a subfolder of target.
>
> Thanks.  Sounds like a good practice to me.
>
> I just have one question.  How does Maven know which files/folders
> inside of "target/" to upload when doing an install/deploy?  Earlier I
> was kinda under the impression that anything that got put into the
> target/ directory was what would get uploaded.
>
> Phillip
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Clean up unpacked dependencies...

Posted by Phillip Hellewell <ss...@gmail.com>.
On Fri, Oct 8, 2010 at 10:58 AM, Jörg Schaible <jo...@gmx.de> wrote:
>
> As a rule of thumb: Put anything that is somehow generated, downloaded,
> unpacked, ... into a subfolder of target.

Thanks.  Sounds like a good practice to me.

I just have one question.  How does Maven know which files/folders
inside of "target/" to upload when doing an install/deploy?  Earlier I
was kinda under the impression that anything that got put into the
target/ directory was what would get uploaded.

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Jörg Schaible <jo...@gmx.de>.
Phillip Hellewell wrote:

> On Thu, Oct 7, 2010 at 5:40 PM, Stephen Connolly
> <st...@gmail.com> wrote:
>> they will be being extracted into a sub-folder of ${basedir}/target if
>> you are following the "Maven way"... given some of your mail threads I
>> will not assume that you are following the "Maven way" ;-)
>>
>> If you follow the "Maven way" then clean will tidy up as by default
>> clean removes the target folder and all its contents
> 
> Thanks!  For some reason I hadn't even tried it without an
> outputDirectory before, but knowing this pretty much convinces me to
> use the default.
> 
> Although you have to admit "deps" is a lot shorter to type than
> "target\dependency" :)

As a rule of thumb: Put anything that is somehow generated, downloaded, 
unpacked, ... into a subfolder of target.

- Jörg


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


Re: Clean up unpacked dependencies...

Posted by Phillip Hellewell <ss...@gmail.com>.
On Thu, Oct 7, 2010 at 5:40 PM, Stephen Connolly
<st...@gmail.com> wrote:
> they will be being extracted into a sub-folder of ${basedir}/target if
> you are following the "Maven way"... given some of your mail threads I
> will not assume that you are following the "Maven way" ;-)
>
> If you follow the "Maven way" then clean will tidy up as by default
> clean removes the target folder and all its contents

Thanks!  For some reason I hadn't even tried it without an
outputDirectory before, but knowing this pretty much convinces me to
use the default.

Although you have to admit "deps" is a lot shorter to type than
"target\dependency" :)

Phillip

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


Re: Clean up unpacked dependencies...

Posted by Stephen Connolly <st...@gmail.com>.
they will be being extracted into a sub-folder of ${basedir}/target if
you are following the "Maven way"... given some of your mail threads I
will not assume that you are following the "Maven way" ;-)

If you follow the "Maven way" then clean will tidy up as by default
clean removes the target folder and all its contents

-Stephen

On 7 October 2010 23:46, Phillip Hellewell <ss...@gmail.com> wrote:
> I have a dumb question.  If I unpack dependencies to a deps subfolder,
> should mvn clean be cleaning those up automatically?  Or should I
> attach a goal to the clean phase to do it?  Or should I not be
> worrying about this at all because unpack-dependencies already knows
> how to replace files when newer.
>
> Phillip
>
> ---------------------------------------------------------------------
> 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