So for reasons I don't want to get into I have a jar that is backed by a
properties file. That properties file is different for different environments.
What I want to end up with is something like:
myapi-1.0-dev.jar
myapi-1.0-test.jar
myapi-1.0-ops.jar
Where dev, test, and ops are different flavors of the jar specified by the
classifier.
My real question was is how do I set the classifier such that it would create
one of these. The answer is in the maven-jar-plugin you can set a configuration
with a classifier.
<classifier>${env}</classifier>
Then I setup a Jenkins build that will execute a deploy for each of my flavors
by setting the env property differently for each execution.
env=dev
env=test
env=ops
Then when I or anyone makes changes to the jar they can update the version in
the Pom file and run he Jenkins task to deploy all three flavors. Making them
all available for all groups to grab out of my repository.
Sent from my iPhone
On Feb 28, 2012, at 3:26 PM, "Manfred Moser" <[email protected]> wrote:
> On Tue, February 28, 2012 2:13 pm, Benson Margulies wrote:
>> Let me try to arrange the explanation here in good order.
>>
>> Classifiers were not designed to allow for 'different flavors of one
>> artifact'. They were designed to allow an artifact to have an
>> entourage, such as its sources or javadoc.
>>
>> So, to begin with, there's no way to ask Maven to set a non-""
>> classifier for the main artifact with packaging jar.
>>
>> Further, there are corner cases of dependency management that will get
>> you in this case.
>>
>> The maven model is really that you would use different artifactIds for
>> the different 'flavors'. You might accomplish this with an aggregating
>> pom and a bunch of modules, one per flavor, for example.
>>
>> No it's not entirely satisfactory. This is just not a case that Maven
>> is designed to support well, and you should seriously consider
>> alternatives.
>
> While I agree with Benson if you still want to make it happen you could
> use the build helper plugin with the attachArtifact goal.
>
> manfred
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]