You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dennis Lundberg <de...@apache.org> on 2007/07/24 17:10:22 UTC

What is the correct way to use classifiers

Hi

We are moving commons-logging over from Ant to a Maven 2 build. Almost 
everything is in place in the pom [1]. There is just one thing left. I'm 
seeking your advice on this.

Commons-logging is a single module build in Maven 2, although it 
probably shouldn't be if we follow all the Maven conventions (but that's 
another story). However, it produces no less that 4 jar files:
- Normal
- Tests
- API
- Adapters

The first two are created by the jar-plugin, while the other two are 
created using 2 antrun executions that extract select files from the 
normal jar. The current files are called:
- commons-logging-<version>.jar
- commons-logging-<version>-tests.jar
- commons-logging-api-<version>.jar
- commons-logging-adapters-<version>.jar

Now to the problem. When I do an install, and later a deploy, the api 
and adapters jars will not be put into the repository.

So I started looking at different ways to handle this and found the 
build-helper-maven-plugin [2]. It says it can attach artifacts that are 
created using antrun to the install and deploy. This seems to work, but 
you need to specify something called a classifier. I set the classifiers 
to api and adapters respectively, and I get these two extra jars 
included when i run 'mvn install'. They are slightly differently named, 
but I think we can live with that:
- commons-logging-<version>-api.jar
- commons-logging-<version>-adapters.jar


To sum this up: it works, but is it the right way (TM) to use classifiers?


[1] 
http://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk/pom.xml
[2] http://mojo.codehaus.org/build-helper-maven-plugin/

-- 
Dennis Lundberg

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


Re: What is the correct way to use classifiers

Posted by Graham Leggett <mi...@sharp.fm>.
Dennis Lundberg wrote:

> To sum this up: it works, but is it the right way (TM) to use classifiers?

For what it's worth, that's how we use classifiers.

Regards,
Graham
--