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 <ct...@apache.org> on 2016/08/19 01:36:46 UTC

Create test jar during build without attaching

Hi Maven Users list,

What's the best way to create a jar during a build without attaching it?

Currently, our pom is configured to use the maven-jar-plugin to create it,
but that plugin attaches an artifact, which gets deployed. We don't want
that. That doesn't seem to be configurable.

We could create a mini project and use maven-invoker-plugin to package it,
but that's a lot of overhead (configuration and processing time) for a very
small test jar containing a single file (used to test a classloader).

We've also considered just using maven-exec-plugin to execute the jar
command-line tool, but that's tricky to get right, accounting for
JAVA_HOME, toolchains, etc.

Any suggestions, or is maven-invoker-plugin the best option?

I think the maven-assembly-plugin might be able to do it, and it has an
<attach>false</attach> option, but I've never used it like this before. If
that's the best option, does anybody have any examples of that kind of
thing?

Thanks.

Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
Thanks. That sounds perfect. Thanks, all, for your help.

On Fri, Aug 19, 2016, 20:07 Guillaume Boué <gu...@orange.fr> wrote:

> Hi,
>
> It sounds like the simplest answer would be to use the
> maven-assembly-plugin and generate the JAR in the
> generate-test-resources phase. You can configure the plugin not to
> attach the artifact with <attach>false</false>.
>
> Then, still in the generate-test-resources phase, you bind an execution
> of build-helper-maven-plugin:add-test-resource and configure it to add
> the generated JAR as a test resource:
>
> http://www.mojohaus.org/build-helper-maven-plugin/usage.html#Add_more_resource_directories_to_your_project
>
>
> Le 19/08/2016 à 23:37, Curtis Rueden a écrit :
> > Generate it during generateSources using a groovy script via gmaven? Or
> in
> > Java within the test code itself?
> >
> > On Aug 19, 2016 4:21 PM, "Christopher" <ct...@apache.org> wrote:
> >
> >> We're not going to add the jar to SCM.... there's many reasons, and I
> could
> >> go into depth about all of them (I've tried to enumerate some already),
> but
> >> again... that's not the question. We're not going to do that. and I've
> >> already stated that. I appreciate the advice... really, I do... but
> we're
> >> not going to do that. Responding with that suggestion does not help
> answer
> >> the question asked.
> >>
> >> The purpose of this thread is to figure out the best way to create a jar
> >> during the build without attaching. That's the requirement. That's the
> >> goal.
> >>
> >> On Fri, Aug 19, 2016 at 5:09 PM Curtis Rueden <ct...@wisc.edu>
> wrote:
> >>
> >>> Hi Christopher,
> >>>
> >>> The point of this JAR is for use in a unit test, right?
> >>>
> >>> So if it's in src/test/resources, it will only end up lumped into the
> >> test
> >>> JAR, not the main JAR. Do you guys deploy your test JAR for downstream
> >>> consumption? If so, do you actually need all the unit tests to pass
> _when
> >>> run from the test JAR outside the project_? Or only during the actual
> >> Maven
> >>> build? Because if you don't need that, then you could just put the JAR
> >>> resource outside of src/test/resources (in, say,
> >> ${basedir}/src/test/extra
> >>> or some such) and just access it from that relative path during the
> unit
> >>> tests. You get your unit test, your test JAR does not get bloated by
> this
> >>> nested JAR resource, and life goes on.
> >>>
> >>> That said, I agree with the others that naively, it does not seem bad
> to
> >>> have this tiny test JAR embedded in your deployed test JAR. It is a
> >> binary
> >>> test resource, very similar to an image file.
> >>>
> >>> Regards,
> >>> Curtis
> >>>
> >>> --
> >>> Curtis Rueden
> >>> LOCI software architect - http://loci.wisc.edu/software
> >>> ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
> >>> Did you know ImageJ has a forum? http://forum.imagej.net/
> >>>
> >>>
> >>> On Fri, Aug 19, 2016 at 1:46 PM, Christopher <ct...@apache.org>
> >> wrote:
> >>>> We don't want to skip deployment of all the artifacts, just one jar
> >> built
> >>>> in one module for one test, which is not intended to be one of the
> >>>> artifact's modules. *maybe* we could move it to a separate module, and
> >>> skip
> >>>> deploy, but we've already got a lot of module bloat, and I'd prefer
> not
> >>> to
> >>>> make it worse.
> >>>>
> >>>> On Fri, Aug 19, 2016 at 2:34 PM Gordon Cody <go...@zafin.com>
> >>> wrote:
> >>>>> Perhaps I don't understand what is meant by "not attaching" but if
> >> all
> >>>> you
> >>>>> want to do is skip deployment, the maven-deploy-plugin has this
> >>> feature:
> >>>>>                  <configuration>
> >>>>>                      <skip>true</skip>
> >>>>>                  </configuration>
> >>>>> which can be added to the module you do not wish to deploy. We use
> >> this
> >>>> in
> >>>>> order to not deploy .ear files to our artifactory.
> >>>>>
> >>>>> Regards, Gord Cody
> >>>>>
> >>>>> On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <
> >>> khmarbaise@gmx.de>
> >>>>> wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> On 19/08/16 03:36, Christopher wrote:
> >>>>>>
> >>>>>>> Hi Maven Users list,
> >>>>>>>
> >>>>>>> What's the best way to create a jar during a build without
> >> attaching
> >>>> it?
> >>>>>>> Currently, our pom is configured to use the maven-jar-plugin to
> >>> create
> >>>>> it,
> >>>>>>> but that plugin attaches an artifact, which gets deployed. We
> >> don't
> >>>> want
> >>>>>>> that. That doesn't seem to be configurable.
> >>>>>>>
> >>>>>> Can you describe why you would like to create a jar which shouldn't
> >>> be
> >>>>>> deployed ? May be we can enhance maven-jar-plugin to support such a
> >>> use
> >>>>>> case?
> >>>>>>
> >>>>>>
> >>>>>> Kind regards
> >>>>>> Karl Heinz Marbaise
> >>>>>>
> >>>>>>
> >>>>>> ------------------------------------------------------------
> >> ---------
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>
> >>>>>>
> >>>>>
> >>>>> --
> >>>>> Best Regards, Gord Cody
> >>>>>
> >>>>> Release Manager  Zafin Labs Americas Inc.
> >>>>> 179 Colonnade Road-Suite 100, Ottawa ON, Canada
> >>>>> Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1
> >>>> 613-601-2734
> >>>>> Web: http://zafin.com  Email: gordon.cody@zafin.com
> >>>>>
> >>>>> --
> >>>>> Zafin - Canada
> >>>>>
> >>>>> --
> >>>>> http://zafin.com
> >>>>>
> >>>>> <http://zafin.com/>
> >>>>>
> >>>>> ------------------------------
> >>>>>
> >>>>> Connect with us
> >>>>>
> >>>>> <http://www.youtube.com/user/ZafinGlobal>
> >>>>> <http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>
> >>>>>
> >>>>> News and Events
> >>>>>
> >>>>> Zafin announces 100 person Center of Excellence in Toronto
> >>>>> <
> >>>>> http://zafin.com/press-releases/zafin-announces-new-
> >>>> 100-person-centre-excellence-toronto/
> >>>>> For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and
> >>>> Fast
> >>>>> 500 rankings
> >>>>> <
> >>>>> http://zafin.com/press-releases/zafin-named-deloitte-
> >>>> technology-fast-50-fast-500-lists/
> >>>>> <
> >>>>> http://zafin.com/press-releases/zafin-ranks-16th-on-
> >>>> the-2014-deloitte-technology-fast-50-list/
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Create test jar during build without attaching

Posted by Guillaume Boué <gu...@orange.fr>.
Hi,

It sounds like the simplest answer would be to use the 
maven-assembly-plugin and generate the JAR in the 
generate-test-resources phase. You can configure the plugin not to 
attach the artifact with <attach>false</false>.

Then, still in the generate-test-resources phase, you bind an execution 
of build-helper-maven-plugin:add-test-resource and configure it to add 
the generated JAR as a test resource: 
http://www.mojohaus.org/build-helper-maven-plugin/usage.html#Add_more_resource_directories_to_your_project


Le 19/08/2016 � 23:37, Curtis Rueden a �crit :
> Generate it during generateSources using a groovy script via gmaven? Or in
> Java within the test code itself?
>
> On Aug 19, 2016 4:21 PM, "Christopher" <ct...@apache.org> wrote:
>
>> We're not going to add the jar to SCM.... there's many reasons, and I could
>> go into depth about all of them (I've tried to enumerate some already), but
>> again... that's not the question. We're not going to do that. and I've
>> already stated that. I appreciate the advice... really, I do... but we're
>> not going to do that. Responding with that suggestion does not help answer
>> the question asked.
>>
>> The purpose of this thread is to figure out the best way to create a jar
>> during the build without attaching. That's the requirement. That's the
>> goal.
>>
>> On Fri, Aug 19, 2016 at 5:09 PM Curtis Rueden <ct...@wisc.edu> wrote:
>>
>>> Hi Christopher,
>>>
>>> The point of this JAR is for use in a unit test, right?
>>>
>>> So if it's in src/test/resources, it will only end up lumped into the
>> test
>>> JAR, not the main JAR. Do you guys deploy your test JAR for downstream
>>> consumption? If so, do you actually need all the unit tests to pass _when
>>> run from the test JAR outside the project_? Or only during the actual
>> Maven
>>> build? Because if you don't need that, then you could just put the JAR
>>> resource outside of src/test/resources (in, say,
>> ${basedir}/src/test/extra
>>> or some such) and just access it from that relative path during the unit
>>> tests. You get your unit test, your test JAR does not get bloated by this
>>> nested JAR resource, and life goes on.
>>>
>>> That said, I agree with the others that naively, it does not seem bad to
>>> have this tiny test JAR embedded in your deployed test JAR. It is a
>> binary
>>> test resource, very similar to an image file.
>>>
>>> Regards,
>>> Curtis
>>>
>>> --
>>> Curtis Rueden
>>> LOCI software architect - http://loci.wisc.edu/software
>>> ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
>>> Did you know ImageJ has a forum? http://forum.imagej.net/
>>>
>>>
>>> On Fri, Aug 19, 2016 at 1:46 PM, Christopher <ct...@apache.org>
>> wrote:
>>>> We don't want to skip deployment of all the artifacts, just one jar
>> built
>>>> in one module for one test, which is not intended to be one of the
>>>> artifact's modules. *maybe* we could move it to a separate module, and
>>> skip
>>>> deploy, but we've already got a lot of module bloat, and I'd prefer not
>>> to
>>>> make it worse.
>>>>
>>>> On Fri, Aug 19, 2016 at 2:34 PM Gordon Cody <go...@zafin.com>
>>> wrote:
>>>>> Perhaps I don't understand what is meant by "not attaching" but if
>> all
>>>> you
>>>>> want to do is skip deployment, the maven-deploy-plugin has this
>>> feature:
>>>>>                  <configuration>
>>>>>                      <skip>true</skip>
>>>>>                  </configuration>
>>>>> which can be added to the module you do not wish to deploy. We use
>> this
>>>> in
>>>>> order to not deploy .ear files to our artifactory.
>>>>>
>>>>> Regards, Gord Cody
>>>>>
>>>>> On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <
>>> khmarbaise@gmx.de>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> On 19/08/16 03:36, Christopher wrote:
>>>>>>
>>>>>>> Hi Maven Users list,
>>>>>>>
>>>>>>> What's the best way to create a jar during a build without
>> attaching
>>>> it?
>>>>>>> Currently, our pom is configured to use the maven-jar-plugin to
>>> create
>>>>> it,
>>>>>>> but that plugin attaches an artifact, which gets deployed. We
>> don't
>>>> want
>>>>>>> that. That doesn't seem to be configurable.
>>>>>>>
>>>>>> Can you describe why you would like to create a jar which shouldn't
>>> be
>>>>>> deployed ? May be we can enhance maven-jar-plugin to support such a
>>> use
>>>>>> case?
>>>>>>
>>>>>>
>>>>>> Kind regards
>>>>>> Karl Heinz Marbaise
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------
>> ---------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Best Regards, Gord Cody
>>>>>
>>>>> Release Manager  Zafin Labs Americas Inc.
>>>>> 179 Colonnade Road-Suite 100, Ottawa ON, Canada
>>>>> Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1
>>>> 613-601-2734
>>>>> Web: http://zafin.com  Email: gordon.cody@zafin.com
>>>>>
>>>>> --
>>>>> Zafin - Canada
>>>>>
>>>>> --
>>>>> http://zafin.com
>>>>>
>>>>> <http://zafin.com/>
>>>>>
>>>>> ------------------------------
>>>>>
>>>>> Connect with us
>>>>>
>>>>> <http://www.youtube.com/user/ZafinGlobal>
>>>>> <http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>
>>>>>
>>>>> News and Events
>>>>>
>>>>> Zafin announces 100 person Center of Excellence in Toronto
>>>>> <
>>>>> http://zafin.com/press-releases/zafin-announces-new-
>>>> 100-person-centre-excellence-toronto/
>>>>> For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and
>>>> Fast
>>>>> 500 rankings
>>>>> <
>>>>> http://zafin.com/press-releases/zafin-named-deloitte-
>>>> technology-fast-50-fast-500-lists/
>>>>> <
>>>>> http://zafin.com/press-releases/zafin-ranks-16th-on-
>>>> the-2014-deloitte-technology-fast-50-list/


---
L'absence de virus dans ce courrier �lectronique a �t� v�rifi�e par le logiciel antivirus Avast.
https://www.avast.com/antivirus


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


Re: Create test jar during build without attaching

Posted by Curtis Rueden <ct...@wisc.edu>.
Generate it during generateSources using a groovy script via gmaven? Or in
Java within the test code itself?

On Aug 19, 2016 4:21 PM, "Christopher" <ct...@apache.org> wrote:

> We're not going to add the jar to SCM.... there's many reasons, and I could
> go into depth about all of them (I've tried to enumerate some already), but
> again... that's not the question. We're not going to do that. and I've
> already stated that. I appreciate the advice... really, I do... but we're
> not going to do that. Responding with that suggestion does not help answer
> the question asked.
>
> The purpose of this thread is to figure out the best way to create a jar
> during the build without attaching. That's the requirement. That's the
> goal.
>
> On Fri, Aug 19, 2016 at 5:09 PM Curtis Rueden <ct...@wisc.edu> wrote:
>
> > Hi Christopher,
> >
> > The point of this JAR is for use in a unit test, right?
> >
> > So if it's in src/test/resources, it will only end up lumped into the
> test
> > JAR, not the main JAR. Do you guys deploy your test JAR for downstream
> > consumption? If so, do you actually need all the unit tests to pass _when
> > run from the test JAR outside the project_? Or only during the actual
> Maven
> > build? Because if you don't need that, then you could just put the JAR
> > resource outside of src/test/resources (in, say,
> ${basedir}/src/test/extra
> > or some such) and just access it from that relative path during the unit
> > tests. You get your unit test, your test JAR does not get bloated by this
> > nested JAR resource, and life goes on.
> >
> > That said, I agree with the others that naively, it does not seem bad to
> > have this tiny test JAR embedded in your deployed test JAR. It is a
> binary
> > test resource, very similar to an image file.
> >
> > Regards,
> > Curtis
> >
> > --
> > Curtis Rueden
> > LOCI software architect - http://loci.wisc.edu/software
> > ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
> > Did you know ImageJ has a forum? http://forum.imagej.net/
> >
> >
> > On Fri, Aug 19, 2016 at 1:46 PM, Christopher <ct...@apache.org>
> wrote:
> >
> > > We don't want to skip deployment of all the artifacts, just one jar
> built
> > > in one module for one test, which is not intended to be one of the
> > > artifact's modules. *maybe* we could move it to a separate module, and
> > skip
> > > deploy, but we've already got a lot of module bloat, and I'd prefer not
> > to
> > > make it worse.
> > >
> > > On Fri, Aug 19, 2016 at 2:34 PM Gordon Cody <go...@zafin.com>
> > wrote:
> > >
> > > > Perhaps I don't understand what is meant by "not attaching" but if
> all
> > > you
> > > > want to do is skip deployment, the maven-deploy-plugin has this
> > feature:
> > > >                 <configuration>
> > > >                     <skip>true</skip>
> > > >                 </configuration>
> > > > which can be added to the module you do not wish to deploy. We use
> this
> > > in
> > > > order to not deploy .ear files to our artifactory.
> > > >
> > > > Regards, Gord Cody
> > > >
> > > > On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <
> > khmarbaise@gmx.de>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > On 19/08/16 03:36, Christopher wrote:
> > > > >
> > > > >> Hi Maven Users list,
> > > > >>
> > > > >> What's the best way to create a jar during a build without
> attaching
> > > it?
> > > > >>
> > > > >> Currently, our pom is configured to use the maven-jar-plugin to
> > create
> > > > it,
> > > > >> but that plugin attaches an artifact, which gets deployed. We
> don't
> > > want
> > > > >> that. That doesn't seem to be configurable.
> > > > >>
> > > > >
> > > > > Can you describe why you would like to create a jar which shouldn't
> > be
> > > > > deployed ? May be we can enhance maven-jar-plugin to support such a
> > use
> > > > > case?
> > > > >
> > > > >
> > > > > Kind regards
> > > > > Karl Heinz Marbaise
> > > > >
> > > > >
> > > > > ------------------------------------------------------------
> ---------
> > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Best Regards, Gord Cody
> > > >
> > > > Release Manager  Zafin Labs Americas Inc.
> > > > 179 Colonnade Road-Suite 100, Ottawa ON, Canada
> > > > Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1
> > > 613-601-2734
> > > > Web: http://zafin.com  Email: gordon.cody@zafin.com
> > > >
> > > > --
> > > > Zafin - Canada
> > > >
> > > > --
> > > > http://zafin.com
> > > >
> > > > <http://zafin.com/>
> > > >
> > > > ------------------------------
> > > >
> > > > Connect with us
> > > >
> > > > <http://www.youtube.com/user/ZafinGlobal>
> > > > <http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>
> > > >
> > > > News and Events
> > > >
> > > > Zafin announces 100 person Center of Excellence in Toronto
> > > > <
> > > > http://zafin.com/press-releases/zafin-announces-new-
> > > 100-person-centre-excellence-toronto/
> > > > >
> > > >
> > > > For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and
> > > Fast
> > > > 500 rankings
> > > > <
> > > > http://zafin.com/press-releases/zafin-named-deloitte-
> > > technology-fast-50-fast-500-lists/
> > > > >
> > > >
> > > > <
> > > > http://zafin.com/press-releases/zafin-ranks-16th-on-
> > > the-2014-deloitte-technology-fast-50-list/
> > > > >
> > > >
> > >
> >
>

Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
We're not going to add the jar to SCM.... there's many reasons, and I could
go into depth about all of them (I've tried to enumerate some already), but
again... that's not the question. We're not going to do that. and I've
already stated that. I appreciate the advice... really, I do... but we're
not going to do that. Responding with that suggestion does not help answer
the question asked.

The purpose of this thread is to figure out the best way to create a jar
during the build without attaching. That's the requirement. That's the goal.

On Fri, Aug 19, 2016 at 5:09 PM Curtis Rueden <ct...@wisc.edu> wrote:

> Hi Christopher,
>
> The point of this JAR is for use in a unit test, right?
>
> So if it's in src/test/resources, it will only end up lumped into the test
> JAR, not the main JAR. Do you guys deploy your test JAR for downstream
> consumption? If so, do you actually need all the unit tests to pass _when
> run from the test JAR outside the project_? Or only during the actual Maven
> build? Because if you don't need that, then you could just put the JAR
> resource outside of src/test/resources (in, say, ${basedir}/src/test/extra
> or some such) and just access it from that relative path during the unit
> tests. You get your unit test, your test JAR does not get bloated by this
> nested JAR resource, and life goes on.
>
> That said, I agree with the others that naively, it does not seem bad to
> have this tiny test JAR embedded in your deployed test JAR. It is a binary
> test resource, very similar to an image file.
>
> Regards,
> Curtis
>
> --
> Curtis Rueden
> LOCI software architect - http://loci.wisc.edu/software
> ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
> Did you know ImageJ has a forum? http://forum.imagej.net/
>
>
> On Fri, Aug 19, 2016 at 1:46 PM, Christopher <ct...@apache.org> wrote:
>
> > We don't want to skip deployment of all the artifacts, just one jar built
> > in one module for one test, which is not intended to be one of the
> > artifact's modules. *maybe* we could move it to a separate module, and
> skip
> > deploy, but we've already got a lot of module bloat, and I'd prefer not
> to
> > make it worse.
> >
> > On Fri, Aug 19, 2016 at 2:34 PM Gordon Cody <go...@zafin.com>
> wrote:
> >
> > > Perhaps I don't understand what is meant by "not attaching" but if all
> > you
> > > want to do is skip deployment, the maven-deploy-plugin has this
> feature:
> > >                 <configuration>
> > >                     <skip>true</skip>
> > >                 </configuration>
> > > which can be added to the module you do not wish to deploy. We use this
> > in
> > > order to not deploy .ear files to our artifactory.
> > >
> > > Regards, Gord Cody
> > >
> > > On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <
> khmarbaise@gmx.de>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > On 19/08/16 03:36, Christopher wrote:
> > > >
> > > >> Hi Maven Users list,
> > > >>
> > > >> What's the best way to create a jar during a build without attaching
> > it?
> > > >>
> > > >> Currently, our pom is configured to use the maven-jar-plugin to
> create
> > > it,
> > > >> but that plugin attaches an artifact, which gets deployed. We don't
> > want
> > > >> that. That doesn't seem to be configurable.
> > > >>
> > > >
> > > > Can you describe why you would like to create a jar which shouldn't
> be
> > > > deployed ? May be we can enhance maven-jar-plugin to support such a
> use
> > > > case?
> > > >
> > > >
> > > > Kind regards
> > > > Karl Heinz Marbaise
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Best Regards, Gord Cody
> > >
> > > Release Manager  Zafin Labs Americas Inc.
> > > 179 Colonnade Road-Suite 100, Ottawa ON, Canada
> > > Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1
> > 613-601-2734
> > > Web: http://zafin.com  Email: gordon.cody@zafin.com
> > >
> > > --
> > > Zafin - Canada
> > >
> > > --
> > > http://zafin.com
> > >
> > > <http://zafin.com/>
> > >
> > > ------------------------------
> > >
> > > Connect with us
> > >
> > > <http://www.youtube.com/user/ZafinGlobal>
> > > <http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>
> > >
> > > News and Events
> > >
> > > Zafin announces 100 person Center of Excellence in Toronto
> > > <
> > > http://zafin.com/press-releases/zafin-announces-new-
> > 100-person-centre-excellence-toronto/
> > > >
> > >
> > > For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and
> > Fast
> > > 500 rankings
> > > <
> > > http://zafin.com/press-releases/zafin-named-deloitte-
> > technology-fast-50-fast-500-lists/
> > > >
> > >
> > > <
> > > http://zafin.com/press-releases/zafin-ranks-16th-on-
> > the-2014-deloitte-technology-fast-50-list/
> > > >
> > >
> >
>

Re: Create test jar during build without attaching

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Christopher,

The point of this JAR is for use in a unit test, right?

So if it's in src/test/resources, it will only end up lumped into the test
JAR, not the main JAR. Do you guys deploy your test JAR for downstream
consumption? If so, do you actually need all the unit tests to pass _when
run from the test JAR outside the project_? Or only during the actual Maven
build? Because if you don't need that, then you could just put the JAR
resource outside of src/test/resources (in, say, ${basedir}/src/test/extra
or some such) and just access it from that relative path during the unit
tests. You get your unit test, your test JAR does not get bloated by this
nested JAR resource, and life goes on.

That said, I agree with the others that naively, it does not seem bad to
have this tiny test JAR embedded in your deployed test JAR. It is a binary
test resource, very similar to an image file.

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Fri, Aug 19, 2016 at 1:46 PM, Christopher <ct...@apache.org> wrote:

> We don't want to skip deployment of all the artifacts, just one jar built
> in one module for one test, which is not intended to be one of the
> artifact's modules. *maybe* we could move it to a separate module, and skip
> deploy, but we've already got a lot of module bloat, and I'd prefer not to
> make it worse.
>
> On Fri, Aug 19, 2016 at 2:34 PM Gordon Cody <go...@zafin.com> wrote:
>
> > Perhaps I don't understand what is meant by "not attaching" but if all
> you
> > want to do is skip deployment, the maven-deploy-plugin has this feature:
> >                 <configuration>
> >                     <skip>true</skip>
> >                 </configuration>
> > which can be added to the module you do not wish to deploy. We use this
> in
> > order to not deploy .ear files to our artifactory.
> >
> > Regards, Gord Cody
> >
> > On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <kh...@gmx.de>
> > wrote:
> >
> > > Hi,
> > >
> > > On 19/08/16 03:36, Christopher wrote:
> > >
> > >> Hi Maven Users list,
> > >>
> > >> What's the best way to create a jar during a build without attaching
> it?
> > >>
> > >> Currently, our pom is configured to use the maven-jar-plugin to create
> > it,
> > >> but that plugin attaches an artifact, which gets deployed. We don't
> want
> > >> that. That doesn't seem to be configurable.
> > >>
> > >
> > > Can you describe why you would like to create a jar which shouldn't be
> > > deployed ? May be we can enhance maven-jar-plugin to support such a use
> > > case?
> > >
> > >
> > > Kind regards
> > > Karl Heinz Marbaise
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > Best Regards, Gord Cody
> >
> > Release Manager  Zafin Labs Americas Inc.
> > 179 Colonnade Road-Suite 100, Ottawa ON, Canada
> > Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1
> 613-601-2734
> > Web: http://zafin.com  Email: gordon.cody@zafin.com
> >
> > --
> > Zafin - Canada
> >
> > --
> > http://zafin.com
> >
> > <http://zafin.com/>
> >
> > ------------------------------
> >
> > Connect with us
> >
> > <http://www.youtube.com/user/ZafinGlobal>
> > <http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>
> >
> > News and Events
> >
> > Zafin announces 100 person Center of Excellence in Toronto
> > <
> > http://zafin.com/press-releases/zafin-announces-new-
> 100-person-centre-excellence-toronto/
> > >
> >
> > For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and
> Fast
> > 500 rankings
> > <
> > http://zafin.com/press-releases/zafin-named-deloitte-
> technology-fast-50-fast-500-lists/
> > >
> >
> > <
> > http://zafin.com/press-releases/zafin-ranks-16th-on-
> the-2014-deloitte-technology-fast-50-list/
> > >
> >
>

Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
We don't want to skip deployment of all the artifacts, just one jar built
in one module for one test, which is not intended to be one of the
artifact's modules. *maybe* we could move it to a separate module, and skip
deploy, but we've already got a lot of module bloat, and I'd prefer not to
make it worse.

On Fri, Aug 19, 2016 at 2:34 PM Gordon Cody <go...@zafin.com> wrote:

> Perhaps I don't understand what is meant by "not attaching" but if all you
> want to do is skip deployment, the maven-deploy-plugin has this feature:
>                 <configuration>
>                     <skip>true</skip>
>                 </configuration>
> which can be added to the module you do not wish to deploy. We use this in
> order to not deploy .ear files to our artifactory.
>
> Regards, Gord Cody
>
> On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <kh...@gmx.de>
> wrote:
>
> > Hi,
> >
> > On 19/08/16 03:36, Christopher wrote:
> >
> >> Hi Maven Users list,
> >>
> >> What's the best way to create a jar during a build without attaching it?
> >>
> >> Currently, our pom is configured to use the maven-jar-plugin to create
> it,
> >> but that plugin attaches an artifact, which gets deployed. We don't want
> >> that. That doesn't seem to be configurable.
> >>
> >
> > Can you describe why you would like to create a jar which shouldn't be
> > deployed ? May be we can enhance maven-jar-plugin to support such a use
> > case?
> >
> >
> > Kind regards
> > Karl Heinz Marbaise
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Best Regards, Gord Cody
>
> Release Manager  Zafin Labs Americas Inc.
> 179 Colonnade Road-Suite 100, Ottawa ON, Canada
> Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1 613-601-2734
> Web: http://zafin.com  Email: gordon.cody@zafin.com
>
> --
> Zafin - Canada
>
> --
> http://zafin.com
>
> <http://zafin.com/>
>
> ------------------------------
>
> Connect with us
>
> <http://www.youtube.com/user/ZafinGlobal>
> <http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>
>
> News and Events
>
> Zafin announces 100 person Center of Excellence in Toronto
> <
> http://zafin.com/press-releases/zafin-announces-new-100-person-centre-excellence-toronto/
> >
>
> For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and Fast
> 500 rankings
> <
> http://zafin.com/press-releases/zafin-named-deloitte-technology-fast-50-fast-500-lists/
> >
>
> <
> http://zafin.com/press-releases/zafin-ranks-16th-on-the-2014-deloitte-technology-fast-50-list/
> >
>

Re: Create test jar during build without attaching

Posted by Gordon Cody <go...@zafin.com>.
Perhaps I don't understand what is meant by "not attaching" but if all you
want to do is skip deployment, the maven-deploy-plugin has this feature:
                <configuration>
                    <skip>true</skip>
                </configuration>
which can be added to the module you do not wish to deploy. We use this in
order to not deploy .ear files to our artifactory.

Regards, Gord Cody

On Fri, Aug 19, 2016 at 1:37 PM, Karl Heinz Marbaise <kh...@gmx.de>
wrote:

> Hi,
>
> On 19/08/16 03:36, Christopher wrote:
>
>> Hi Maven Users list,
>>
>> What's the best way to create a jar during a build without attaching it?
>>
>> Currently, our pom is configured to use the maven-jar-plugin to create it,
>> but that plugin attaches an artifact, which gets deployed. We don't want
>> that. That doesn't seem to be configurable.
>>
>
> Can you describe why you would like to create a jar which shouldn't be
> deployed ? May be we can enhance maven-jar-plugin to support such a use
> case?
>
>
> Kind regards
> Karl Heinz Marbaise
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Best Regards, Gord Cody

Release Manager  Zafin Labs Americas Inc.
179 Colonnade Road-Suite 100, Ottawa ON, Canada
Phone: +1 (613) 216-2504  Fax: +1 (613) 688-1374  Mobile: +1 613-601-2734
Web: http://zafin.com  Email: gordon.cody@zafin.com

-- 
Zafin - Canada

-- 
http://zafin.com

<http://zafin.com/>

------------------------------

Connect with us

<http://www.youtube.com/user/ZafinGlobal>  
<http://www.linkedin.com/company/Zafin>  <http://twitter.com/Zafin>

News and Events

Zafin announces 100 person Center of Excellence in Toronto 
<http://zafin.com/press-releases/zafin-announces-new-100-person-centre-excellence-toronto/>

For the 2nd consecutive year, Zafin named to the Deloitte Fast 50 and Fast 
500 rankings 
<http://zafin.com/press-releases/zafin-named-deloitte-technology-fast-50-fast-500-lists/>

<http://zafin.com/press-releases/zafin-ranks-16th-on-the-2014-deloitte-technology-fast-50-list/>

Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
On Fri, Aug 19, 2016 at 1:38 PM Karl Heinz Marbaise <kh...@gmx.de>
wrote:

> Hi,
>
> On 19/08/16 03:36, Christopher wrote:
> > Hi Maven Users list,
> >
> > What's the best way to create a jar during a build without attaching it?
> >
> > Currently, our pom is configured to use the maven-jar-plugin to create
> it,
> > but that plugin attaches an artifact, which gets deployed. We don't want
> > that. That doesn't seem to be configurable.
>
> Can you describe why you would like to create a jar which shouldn't be
> deployed ? May be we can enhance maven-jar-plugin to support such a use
> case?
>

The goal is to test a classloader during the integration-test phase. For
the same reason that most people don't deploy the test-jar (or even create
it), we don't want to deploy this jar.

Another reason why we wouldn't want to deploy is that the contents of the
jar might be dynamically generated, so that we can verify that the
classloader is loading classes from this particular execution of the test,
and isn't being loaded from somewhere else on the classpath. Deploying it
to maven would be suitable for reuse, but we wouldn't want reuse in this
case.

The more I think about it, I think the maven-jar-plugin isn't necessarily
appropriate for this. I think the maven-assembly-plugin is better suited to
create the jar, and that does have an option to not attach.

Re: Create test jar during build without attaching

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

On 19/08/16 03:36, Christopher wrote:
> Hi Maven Users list,
>
> What's the best way to create a jar during a build without attaching it?
>
> Currently, our pom is configured to use the maven-jar-plugin to create it,
> but that plugin attaches an artifact, which gets deployed. We don't want
> that. That doesn't seem to be configurable.

Can you describe why you would like to create a jar which shouldn't be 
deployed ? May be we can enhance maven-jar-plugin to support such a use 
case?


Kind regards
Karl Heinz Marbaise

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


Re: Create test jar during build without attaching

Posted by jieryn <ji...@gmail.com>.
Confirmed. Is it so bad, though? :) I like the argument comparing
putting .jpeg files in there.

On Fri, Aug 19, 2016 at 2:13 PM, Christopher <ct...@apache.org> wrote:
> src/test/resources are included in the source-release artifact, yes.
>
> On Fri, Aug 19, 2016 at 1:56 AM jieryn <ji...@gmail.com> wrote:
>
>> Would src/test/resources be included in the src artifact? I suspect not.
>>
>> On Thu, Aug 18, 2016 at 9:47 PM, Christopher <ct...@apache.org> wrote:
>> > If this were a personal project, I'd probably do that... but this is for
>> an
>> > ASF project, and I don't want to put us in a position where we are
>> > releasing with binaries in the source artifact.
>> >
>> > On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:
>> >
>> >> Create the jar and then put it under src/test/resources/my.jar and
>> >> then refer to that my.jar in your testcase. It seems like an awful lot
>> >> of trouble to dynamically create this test artifact, when you could
>> >> just create it once and then add it to your repository. Yes, adding
>> >> jars to your scm is generally bad, but this seems like a perfect
>> >> exception.
>> >>
>> >> On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org>
>> wrote:
>> >> > Hi Maven Users list,
>> >> >
>> >> > What's the best way to create a jar during a build without attaching
>> it?
>> >> >
>> >> > Currently, our pom is configured to use the maven-jar-plugin to create
>> >> it,
>> >> > but that plugin attaches an artifact, which gets deployed. We don't
>> want
>> >> > that. That doesn't seem to be configurable.
>> >> >
>> >> > We could create a mini project and use maven-invoker-plugin to package
>> >> it,
>> >> > but that's a lot of overhead (configuration and processing time) for a
>> >> very
>> >> > small test jar containing a single file (used to test a classloader).
>> >> >
>> >> > We've also considered just using maven-exec-plugin to execute the jar
>> >> > command-line tool, but that's tricky to get right, accounting for
>> >> > JAVA_HOME, toolchains, etc.
>> >> >
>> >> > Any suggestions, or is maven-invoker-plugin the best option?
>> >> >
>> >> > I think the maven-assembly-plugin might be able to do it, and it has
>> an
>> >> > <attach>false</attach> option, but I've never used it like this
>> before.
>> >> If
>> >> > that's the best option, does anybody have any examples of that kind of
>> >> > thing?
>> >> >
>> >> > Thanks.
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>

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


Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
src/test/resources are included in the source-release artifact, yes.

On Fri, Aug 19, 2016 at 1:56 AM jieryn <ji...@gmail.com> wrote:

> Would src/test/resources be included in the src artifact? I suspect not.
>
> On Thu, Aug 18, 2016 at 9:47 PM, Christopher <ct...@apache.org> wrote:
> > If this were a personal project, I'd probably do that... but this is for
> an
> > ASF project, and I don't want to put us in a position where we are
> > releasing with binaries in the source artifact.
> >
> > On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:
> >
> >> Create the jar and then put it under src/test/resources/my.jar and
> >> then refer to that my.jar in your testcase. It seems like an awful lot
> >> of trouble to dynamically create this test artifact, when you could
> >> just create it once and then add it to your repository. Yes, adding
> >> jars to your scm is generally bad, but this seems like a perfect
> >> exception.
> >>
> >> On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org>
> wrote:
> >> > Hi Maven Users list,
> >> >
> >> > What's the best way to create a jar during a build without attaching
> it?
> >> >
> >> > Currently, our pom is configured to use the maven-jar-plugin to create
> >> it,
> >> > but that plugin attaches an artifact, which gets deployed. We don't
> want
> >> > that. That doesn't seem to be configurable.
> >> >
> >> > We could create a mini project and use maven-invoker-plugin to package
> >> it,
> >> > but that's a lot of overhead (configuration and processing time) for a
> >> very
> >> > small test jar containing a single file (used to test a classloader).
> >> >
> >> > We've also considered just using maven-exec-plugin to execute the jar
> >> > command-line tool, but that's tricky to get right, accounting for
> >> > JAVA_HOME, toolchains, etc.
> >> >
> >> > Any suggestions, or is maven-invoker-plugin the best option?
> >> >
> >> > I think the maven-assembly-plugin might be able to do it, and it has
> an
> >> > <attach>false</attach> option, but I've never used it like this
> before.
> >> If
> >> > that's the best option, does anybody have any examples of that kind of
> >> > thing?
> >> >
> >> > Thanks.
> >>
> >> ---------------------------------------------------------------------
> >> 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: Create test jar during build without attaching

Posted by jieryn <ji...@gmail.com>.
Would src/test/resources be included in the src artifact? I suspect not.

On Thu, Aug 18, 2016 at 9:47 PM, Christopher <ct...@apache.org> wrote:
> If this were a personal project, I'd probably do that... but this is for an
> ASF project, and I don't want to put us in a position where we are
> releasing with binaries in the source artifact.
>
> On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:
>
>> Create the jar and then put it under src/test/resources/my.jar and
>> then refer to that my.jar in your testcase. It seems like an awful lot
>> of trouble to dynamically create this test artifact, when you could
>> just create it once and then add it to your repository. Yes, adding
>> jars to your scm is generally bad, but this seems like a perfect
>> exception.
>>
>> On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org> wrote:
>> > Hi Maven Users list,
>> >
>> > What's the best way to create a jar during a build without attaching it?
>> >
>> > Currently, our pom is configured to use the maven-jar-plugin to create
>> it,
>> > but that plugin attaches an artifact, which gets deployed. We don't want
>> > that. That doesn't seem to be configurable.
>> >
>> > We could create a mini project and use maven-invoker-plugin to package
>> it,
>> > but that's a lot of overhead (configuration and processing time) for a
>> very
>> > small test jar containing a single file (used to test a classloader).
>> >
>> > We've also considered just using maven-exec-plugin to execute the jar
>> > command-line tool, but that's tricky to get right, accounting for
>> > JAVA_HOME, toolchains, etc.
>> >
>> > Any suggestions, or is maven-invoker-plugin the best option?
>> >
>> > I think the maven-assembly-plugin might be able to do it, and it has an
>> > <attach>false</attach> option, but I've never used it like this before.
>> If
>> > that's the best option, does anybody have any examples of that kind of
>> > thing?
>> >
>> > Thanks.
>>
>> ---------------------------------------------------------------------
>> 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: Create test jar during build without attaching

Posted by Jeff Jensen <je...@upstairstechnology.com>.
I had the same need on a prior product, needed two jars to test the
processing.

After trying to find built-in Maven features/plugins to solve, including
Embedder and other "Maven runners" I found with Google, I found the
clearest and simplest approach was to make a nearly empty pom for each jar
in separate subdirectories in src/test/resources (along with the needed
files) and run Maven for each pom at test startup to install into local
repo.
I found the easiest way to run Maven was
final Runtime runtime = Runtime.getRuntime();
runtime.exec(mvnCommand, envp, dir);

* Creating mvnCommand required and used Maven home env var, detected which
OS for the script (to run mvn or mvn.cmd), and included "clean install".
* envp was null.
* dir was the respective pom.xml directory.

HTH


On Thu, Aug 18, 2016 at 8:47 PM, Christopher <ct...@apache.org> wrote:

> If this were a personal project, I'd probably do that... but this is for an
> ASF project, and I don't want to put us in a position where we are
> releasing with binaries in the source artifact.
>
> On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:
>
> > Create the jar and then put it under src/test/resources/my.jar and
> > then refer to that my.jar in your testcase. It seems like an awful lot
> > of trouble to dynamically create this test artifact, when you could
> > just create it once and then add it to your repository. Yes, adding
> > jars to your scm is generally bad, but this seems like a perfect
> > exception.
> >
> > On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org>
> wrote:
> > > Hi Maven Users list,
> > >
> > > What's the best way to create a jar during a build without attaching
> it?
> > >
> > > Currently, our pom is configured to use the maven-jar-plugin to create
> > it,
> > > but that plugin attaches an artifact, which gets deployed. We don't
> want
> > > that. That doesn't seem to be configurable.
> > >
> > > We could create a mini project and use maven-invoker-plugin to package
> > it,
> > > but that's a lot of overhead (configuration and processing time) for a
> > very
> > > small test jar containing a single file (used to test a classloader).
> > >
> > > We've also considered just using maven-exec-plugin to execute the jar
> > > command-line tool, but that's tricky to get right, accounting for
> > > JAVA_HOME, toolchains, etc.
> > >
> > > Any suggestions, or is maven-invoker-plugin the best option?
> > >
> > > I think the maven-assembly-plugin might be able to do it, and it has an
> > > <attach>false</attach> option, but I've never used it like this before.
> > If
> > > that's the best option, does anybody have any examples of that kind of
> > > thing?
> > >
> > > Thanks.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
It is a test resource, built from source. I think it's substantively
different from a jpg, because it is derived from the creative work (source
code), and does not itself represent the creative work like a jpg does.
Compiled code does not meet the definition of open source from the Open
Source Initiative (https://opensource.org/osd), and we'd prefer to keep our
source code free from compiled code as much as possible. So, even if it
would be an "acceptable" case, we're trying to find a solution which avoids
that. We were actually doing that until recently, and we're trying to take
positive action to correct it.

In any case, my goal for this thread was to find solutions which allow me
to avoid having the binary in SCM, not to convince myself I don't need to.
:)

On Fri, Aug 19, 2016 at 4:44 AM Mirko Friedenhagen <mf...@gmail.com>
wrote:

> Hello Christopher,
>
> it seems the jar is a test resource, so it is not different from a jpg
> which could be included as well in this way IMO.
>
> Regards
> Mirko
> --
> Sent from my mobile
>
> Am 19.08.2016 03:47 schrieb "Christopher" <ct...@apache.org>:
>
> If this were a personal project, I'd probably do that... but this is for an
> ASF project, and I don't want to put us in a position where we are
> releasing with binaries in the source artifact.
>
> On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:
>
> > Create the jar and then put it under src/test/resources/my.jar and
> > then refer to that my.jar in your testcase. It seems like an awful lot
> > of trouble to dynamically create this test artifact, when you could
> > just create it once and then add it to your repository. Yes, adding
> > jars to your scm is generally bad, but this seems like a perfect
> > exception.
> >
> > On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org>
> wrote:
> > > Hi Maven Users list,
> > >
> > > What's the best way to create a jar during a build without attaching
> it?
> > >
> > > Currently, our pom is configured to use the maven-jar-plugin to create
> > it,
> > > but that plugin attaches an artifact, which gets deployed. We don't
> want
> > > that. That doesn't seem to be configurable.
> > >
> > > We could create a mini project and use maven-invoker-plugin to package
> > it,
> > > but that's a lot of overhead (configuration and processing time) for a
> > very
> > > small test jar containing a single file (used to test a classloader).
> > >
> > > We've also considered just using maven-exec-plugin to execute the jar
> > > command-line tool, but that's tricky to get right, accounting for
> > > JAVA_HOME, toolchains, etc.
> > >
> > > Any suggestions, or is maven-invoker-plugin the best option?
> > >
> > > I think the maven-assembly-plugin might be able to do it, and it has an
> > > <attach>false</attach> option, but I've never used it like this before.
> > If
> > > that's the best option, does anybody have any examples of that kind of
> > > thing?
> > >
> > > Thanks.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Create test jar during build without attaching

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello Christopher,

it seems the jar is a test resource, so it is not different from a jpg
which could be included as well in this way IMO.

Regards
Mirko
-- 
Sent from my mobile

Am 19.08.2016 03:47 schrieb "Christopher" <ct...@apache.org>:

If this were a personal project, I'd probably do that... but this is for an
ASF project, and I don't want to put us in a position where we are
releasing with binaries in the source artifact.

On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:

> Create the jar and then put it under src/test/resources/my.jar and
> then refer to that my.jar in your testcase. It seems like an awful lot
> of trouble to dynamically create this test artifact, when you could
> just create it once and then add it to your repository. Yes, adding
> jars to your scm is generally bad, but this seems like a perfect
> exception.
>
> On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org> wrote:
> > Hi Maven Users list,
> >
> > What's the best way to create a jar during a build without attaching it?
> >
> > Currently, our pom is configured to use the maven-jar-plugin to create
> it,
> > but that plugin attaches an artifact, which gets deployed. We don't want
> > that. That doesn't seem to be configurable.
> >
> > We could create a mini project and use maven-invoker-plugin to package
> it,
> > but that's a lot of overhead (configuration and processing time) for a
> very
> > small test jar containing a single file (used to test a classloader).
> >
> > We've also considered just using maven-exec-plugin to execute the jar
> > command-line tool, but that's tricky to get right, accounting for
> > JAVA_HOME, toolchains, etc.
> >
> > Any suggestions, or is maven-invoker-plugin the best option?
> >
> > I think the maven-assembly-plugin might be able to do it, and it has an
> > <attach>false</attach> option, but I've never used it like this before.
> If
> > that's the best option, does anybody have any examples of that kind of
> > thing?
> >
> > Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Create test jar during build without attaching

Posted by Christopher <ct...@apache.org>.
If this were a personal project, I'd probably do that... but this is for an
ASF project, and I don't want to put us in a position where we are
releasing with binaries in the source artifact.

On Thu, Aug 18, 2016 at 9:39 PM jieryn <ji...@gmail.com> wrote:

> Create the jar and then put it under src/test/resources/my.jar and
> then refer to that my.jar in your testcase. It seems like an awful lot
> of trouble to dynamically create this test artifact, when you could
> just create it once and then add it to your repository. Yes, adding
> jars to your scm is generally bad, but this seems like a perfect
> exception.
>
> On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org> wrote:
> > Hi Maven Users list,
> >
> > What's the best way to create a jar during a build without attaching it?
> >
> > Currently, our pom is configured to use the maven-jar-plugin to create
> it,
> > but that plugin attaches an artifact, which gets deployed. We don't want
> > that. That doesn't seem to be configurable.
> >
> > We could create a mini project and use maven-invoker-plugin to package
> it,
> > but that's a lot of overhead (configuration and processing time) for a
> very
> > small test jar containing a single file (used to test a classloader).
> >
> > We've also considered just using maven-exec-plugin to execute the jar
> > command-line tool, but that's tricky to get right, accounting for
> > JAVA_HOME, toolchains, etc.
> >
> > Any suggestions, or is maven-invoker-plugin the best option?
> >
> > I think the maven-assembly-plugin might be able to do it, and it has an
> > <attach>false</attach> option, but I've never used it like this before.
> If
> > that's the best option, does anybody have any examples of that kind of
> > thing?
> >
> > Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Create test jar during build without attaching

Posted by jieryn <ji...@gmail.com>.
Create the jar and then put it under src/test/resources/my.jar and
then refer to that my.jar in your testcase. It seems like an awful lot
of trouble to dynamically create this test artifact, when you could
just create it once and then add it to your repository. Yes, adding
jars to your scm is generally bad, but this seems like a perfect
exception.

On Thu, Aug 18, 2016 at 9:36 PM, Christopher <ct...@apache.org> wrote:
> Hi Maven Users list,
>
> What's the best way to create a jar during a build without attaching it?
>
> Currently, our pom is configured to use the maven-jar-plugin to create it,
> but that plugin attaches an artifact, which gets deployed. We don't want
> that. That doesn't seem to be configurable.
>
> We could create a mini project and use maven-invoker-plugin to package it,
> but that's a lot of overhead (configuration and processing time) for a very
> small test jar containing a single file (used to test a classloader).
>
> We've also considered just using maven-exec-plugin to execute the jar
> command-line tool, but that's tricky to get right, accounting for
> JAVA_HOME, toolchains, etc.
>
> Any suggestions, or is maven-invoker-plugin the best option?
>
> I think the maven-assembly-plugin might be able to do it, and it has an
> <attach>false</attach> option, but I've never used it like this before. If
> that's the best option, does anybody have any examples of that kind of
> thing?
>
> Thanks.

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