You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marco Huber <mh...@project-team.de> on 2008/11/11 11:39:53 UTC

How does classifier work in dependant modules?

Hi all,

We have two projects with dependencies from project A to project B.

Project A is multi module project with the structure:

master
   --> core
   --> client
   --> server

We have also defined 3 profiles for development, integration and  
production with different configuration values. The default value is  
for the development environment.
All modules have to be configured differently, so we suggest that all  
must have a classifer:
- development -> classifer dev
- integration -> classifer int
- production -> classifer prod


We defined the inner dependencies in the master pom like:

<dependencyManagement>
   <dependencies>
     <dependency>
	<groupId>com.myCompany.projectA</groupId>
	<artifactId>core</artifactId>
	<version>${project.version}</version>
	<classifier>${environment.suffix}</classifier>
    </dependency>
    ...

because client and server depends both on core.

In our second project we refer to project A like:

     <dependency>
	<groupId>com.myCompany.projectA</groupId>
	<artifactId>client</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<classifier>${projectA.suffix}</classifier>
    </dependency>

projectA.suffix is also defined in profile in the second project.

So now we get the following combinations if we assembly our second project.

dev build: projectB.module -> projectA.client-dev -> projectA.core-dev.
int build: projectB.module -> projectA.client-int -> projectA.core-dev.
prod build: projectB.module -> projectA.client-prod -> projectA.core-dev.

We always get the projectA.core as dev configuration, but we expected  
the int or prod configuration.
How do we do it to get the correct classified artifacted? Do we need  
to configure something special in our
project A master pom? Or in our project B pom to get the correct artifacts?

Regards
Marco


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


Re: How does classifier work in dependant modules?

Posted by Marco Huber <mh...@project-team.de>.
Hi all,

I have been tried a little more on this problem an find out the if I set 
   the classifier property for project A in project B it get the wrong 
dependencies (like explained). If I pass the property at the command 
line I get the right dependencies.

projectB>mvn clean install -Denvironment.suffix=int

This is a little bit confusing?!?

Any help on this would be useful.

Marco

Marco Huber wrote:
> Hi all,
> 
> We have two projects with dependencies from project A to project B.
> 
> Project A is multi module project with the structure:
> 
> master
>   --> core
>   --> client
>   --> server
> 
> We have also defined 3 profiles for development, integration and 
> production with different configuration values. The default value is for 
> the development environment.
> All modules have to be configured differently, so we suggest that all 
> must have a classifer:
> - development -> classifer dev
> - integration -> classifer int
> - production -> classifer prod
> 
> 
> We defined the inner dependencies in the master pom like:
> 
> <dependencyManagement>
>   <dependencies>
>     <dependency>
>     <groupId>com.myCompany.projectA</groupId>
>     <artifactId>core</artifactId>
>     <version>${project.version}</version>
>     <classifier>${environment.suffix}</classifier>
>    </dependency>
>    ...
> 
> because client and server depends both on core.
> 
> In our second project we refer to project A like:
> 
>     <dependency>
>     <groupId>com.myCompany.projectA</groupId>
>     <artifactId>client</artifactId>
>     <version>1.0.0-SNAPSHOT</version>
>     <classifier>${projectA.suffix}</classifier>
>    </dependency>
> 
> projectA.suffix is also defined in profile in the second project.
> 
> So now we get the following combinations if we assembly our second project.
> 
> dev build: projectB.module -> projectA.client-dev -> projectA.core-dev.
> int build: projectB.module -> projectA.client-int -> projectA.core-dev.
> prod build: projectB.module -> projectA.client-prod -> projectA.core-dev.
> 
> We always get the projectA.core as dev configuration, but we expected 
> the int or prod configuration.
> How do we do it to get the correct classified artifacted? Do we need to 
> configure something special in our
> project A master pom? Or in our project B pom to get the correct artifacts?
> 
> Regards
> Marco
> 
> 
> ---------------------------------------------------------------------
> 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