You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Trevor Harmon <tr...@vocaro.com> on 2010/08/17 02:03:59 UTC

Attaching platform-specific executables as secondary artifacts

Hi,

My project is a Java GUI app, and when I deploy it, its JAR artifact  
is uploaded to the repository. I also use a couple of plugins to  
generate platform-specific executables for the app: launch4j [1] and  
osxappbundle [2]. I'd like to deploy these executables to the  
repository too, so that there's a fixed URL from which they can be  
downloaded. (In fact, I can't think of a reason to deploy the JAR  
artifact at all; only the executables need to be published.)

My understanding is that this can be accomplished by attaching the  
executables to my project as "secondary artifacts". But how is that  
done? The plugins themselves don't appear to have any specific support  
for this. They simply dump the executable into my project's target  
directory. Would I use the Assembly plugin? Or something else? I just  
can't seem to find any documentation or discussion of this issue.

Thanks,

Trevor

[1] http://alakai.org/reference/plugins/launch4j-plugin-usage.html
[2] http://mojo.codehaus.org/osxappbundle-maven-plugin/


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


Re: Attaching platform-specific executables as secondary artifacts

Posted by Stephen Connolly <st...@gmail.com>.
On 17 August 2010 16:33, Trevor Harmon <tr...@vocaro.com> wrote:
> On Aug 16, 2010, at 5:19 PM, Trevor Harmon wrote:
>
>> On Aug 16, 2010, at 5:04 PM, Justin Edelson wrote:
>>
>>> http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html
>>
>> Thanks, that looks like just what I need.
>
> I experimented some more with this issue, and it turns out I don't need build-helper at all. If I bind the osxappbundle and launch4j plugins to the package phase, they're automatically deployed to my repository when doing "mvn deploy" (or "mvn release:perform"). Strangely, this doesn't happen if I bind them to the deploy phase instead.
>

the order of execution within a phase is loosely defined, but in
general it is lifecycle first, so that deploy:deploy will run before
your goals if you bind them to the deploy phase

> I'm not sure what's going on behind the scenes. I assume there's some code inside the two plugins that knows what to do for the deploy phase. Is this common behavior for these types of plugins?
>
> Anyway, I've decided to keep the plugins attached to my package phase, despite the increase in build time. Things are simpler that way, and the delta is a lot less than the last time I tested these plugins -- no more than 10 seconds or so. (This new SSD drive I got is da bomb...)
>
> Trevor
>
>
> ---------------------------------------------------------------------
> 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: Attaching platform-specific executables as secondary artifacts

Posted by Trevor Harmon <tr...@vocaro.com>.
On Aug 16, 2010, at 5:19 PM, Trevor Harmon wrote:

> On Aug 16, 2010, at 5:04 PM, Justin Edelson wrote:
> 
>> http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html
> 
> Thanks, that looks like just what I need.

I experimented some more with this issue, and it turns out I don't need build-helper at all. If I bind the osxappbundle and launch4j plugins to the package phase, they're automatically deployed to my repository when doing "mvn deploy" (or "mvn release:perform"). Strangely, this doesn't happen if I bind them to the deploy phase instead. 

I'm not sure what's going on behind the scenes. I assume there's some code inside the two plugins that knows what to do for the deploy phase. Is this common behavior for these types of plugins?

Anyway, I've decided to keep the plugins attached to my package phase, despite the increase in build time. Things are simpler that way, and the delta is a lot less than the last time I tested these plugins -- no more than 10 seconds or so. (This new SSD drive I got is da bomb...)

Trevor


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


Re: Attaching platform-specific executables as secondary artifacts

Posted by Trevor Harmon <tr...@vocaro.com>.
On Aug 16, 2010, at 5:24 PM, Justin Edelson wrote:

>> Can you think of any potential
>> problems in binding build-helper to the deploy phase instead? Thanks,
> Well, that would mean the artifacts never end up in your local
> repository, which seems weird.

Good point, but in this case the artifacts will never have anything depending on them, so I don't see a need to have them in the local repository. And if I do need to generate the executables without deploying them (e.g. for testing), both plugins have goals that can be run on an as-needed basis.

Trevor


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


Re: Attaching platform-specific executables as secondary artifacts

Posted by Justin Edelson <ju...@gmail.com>.
On 8/16/10 8:19 PM, Trevor Harmon wrote:
> On Aug 16, 2010, at 5:04 PM, Justin Edelson wrote:
> 
>> http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html
>>
> 
> Thanks, that looks like just what I need.
> 
> The only problem is that it binds by default to the package phase, which
> would require binding the launch4j and osxappbundle goals to the package
> phase as well. This would greatly increase build times -- the
> executables take awhile to generate -- even when I'm in normal
> development mode, not yet deploying. Can you think of any potential
> problems in binding build-helper to the deploy phase instead? Thanks,
Well, that would mean the artifacts never end up in your local
repository, which seems weird.

This sounds like something you might want to put in a profile.

But it's really up to you. Definitely can't hurt to try it out several ways.

Justin


> 
> Trevor
> 
> 
> ---------------------------------------------------------------------
> 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: Attaching platform-specific executables as secondary artifacts

Posted by Trevor Harmon <tr...@vocaro.com>.
On Aug 16, 2010, at 5:04 PM, Justin Edelson wrote:

> http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html

Thanks, that looks like just what I need.

The only problem is that it binds by default to the package phase,  
which would require binding the launch4j and osxappbundle goals to the  
package phase as well. This would greatly increase build times -- the  
executables take awhile to generate -- even when I'm in normal  
development mode, not yet deploying. Can you think of any potential  
problems in binding build-helper to the deploy phase instead? Thanks,

Trevor


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


Re: Attaching platform-specific executables as secondary artifacts

Posted by Justin Edelson <ju...@gmail.com>.
http://mojo.codehaus.org/build-helper-maven-plugin/attach-artifact-mojo.html

On 8/16/10 8:03 PM, Trevor Harmon wrote:
> Hi,
> 
> My project is a Java GUI app, and when I deploy it, its JAR artifact is
> uploaded to the repository. I also use a couple of plugins to generate
> platform-specific executables for the app: launch4j [1] and osxappbundle
> [2]. I'd like to deploy these executables to the repository too, so that
> there's a fixed URL from which they can be downloaded. (In fact, I can't
> think of a reason to deploy the JAR artifact at all; only the
> executables need to be published.)
> 
> My understanding is that this can be accomplished by attaching the
> executables to my project as "secondary artifacts". But how is that
> done? The plugins themselves don't appear to have any specific support
> for this. They simply dump the executable into my project's target
> directory. Would I use the Assembly plugin? Or something else? I just
> can't seem to find any documentation or discussion of this issue.
> 
> Thanks,
> 
> Trevor
> 
> [1] http://alakai.org/reference/plugins/launch4j-plugin-usage.html
> [2] http://mojo.codehaus.org/osxappbundle-maven-plugin/
> 
> 
> ---------------------------------------------------------------------
> 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