You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by to...@gi-de.com on 2009/03/10 11:44:35 UTC

how can I guarantee delivery artifacts (*.war, *.ear) to use the same shared API?

Hi, 

in our build environment, we build and release our modules at different 
times.
Lets say UI.war is released first,  than backend.ear (using the released 
UI) is released three days later, 
than last the WebServices.war were released.

All are using a shared API (common-services.jar)

In our delivery build we dependency-copy the UI.war, the Backend.ear and 
the Webservices.war into a directory structure.
We have to guarantee, that the UI.war and the Backend.ear and all other 
components, too are all using the same version 
of "commons-services.jar".

How can I check, that an artifact (*.war, *.ear) has the same dependency 
as another artifact?

Thanx, Torsten

AW: Antwort: Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same shared API?

Posted by "Lewis, Eric" <Er...@ipi.ch>.
We do it like Tobias described, and frankly, how would you force your projects to use the same version otherwise?

We have a hierarchy of parent POMs
- Master parent POM defines everything for Maven, like plugins, properties, repositories and stuff
- Per project (not Maven project, the real, big project which is composed of n Maven projects) we have a parent POM which defines the version of all dependencies, internal and external. The individual projects are only allowed to use groupId and artifactId, but not version.

You're just circling around the problem, otherwise. I think that it's much more painful to implement and update test cases for versions of components than to do it The Maven Way (TM)  ;-)

Best regards,
Eric

> -----Ursprüngliche Nachricht-----
> Von: torsten.reinhard@gi-de.com [mailto:torsten.reinhard@gi-de.com] 
> Gesendet: Dienstag, 10. März 2009 15:41
> An: Maven Users List
> Betreff: Antwort: Re: how can I guarantee delivery artifacts 
> (*.war, *.ear) to use the same shared API?
> 
> ...that would only move the problem to the common parent.
> Than I have to guarantee, that all my artifacts use the same common 
> parent.
> 
> I´m thinking about a (JUnit)Testcase, that checks the version of 
> common-services, or 
> that reads an entry of all the Manifest.MF oder 
> "common-services.properties", containing the version string.
> 
> Any other idea - Maven based?
> 
> Thanx, Torsten
> 
> 
> 
> 
> Tobias Gierke <to...@code-sourcery.de> 
> 10.03.2009 14:57
> Bitte antworten an
> "Maven Users List" <us...@maven.apache.org>
> 
> 
> An
> Maven Users List <us...@maven.apache.org>
> Kopie
> 
> Thema
> Re: how can I guarantee delivery artifacts (*.war, *.ear) to 
> use the same 
> shared API?
> 
> 
> 
> 
> 
> 
> Hi Torsten,
> > Hi, 
> >
> > in our build environment, we build and release our modules 
> at different 
> > times.
> > Lets say UI.war is released first,  than backend.ear (using 
> the released 
> 
> > UI) is released three days later, 
> > than last the WebServices.war were released.
> >
> > All are using a shared API (common-services.jar)
> >
> > In our delivery build we dependency-copy the UI.war, the 
> Backend.ear and 
> 
> > the Webservices.war into a directory structure.
> > We have to guarantee, that the UI.war and the Backend.ear 
> and all other 
> > components, too are all using the same version 
> > of "commons-services.jar".
> >
> > How can I check, that an artifact (*.war, *.ear) has the 
> same dependency 
> 
> > as another artifact?
> > 
> Why don't you create a separate "parent POM" project
> 
> <project>
> 
>    [...]
>    <packaging>pom</packaging>
>     [...]
> 
>   <dependencyManagement>
>      [...]
>     <dependency>
>       <groupId>your-group-id</groupId>
>       <artifactId>common-services<artifactId>
>       <version>1.2.3</version>
>     </dependency>
>     [...]
>   </dependencyManagement>
> [...]
> </project>
> 
> and let your UI / webservices / backend projects all inherit 
> the version
> number from the common parent ?
> 
> Regards,
> 
> Tobias
>  
> 
> > Thanx, Torsten
> >
> > 
> 
> 
> ---------------------------------------------------------------------
> 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: Antwort: Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same shared API?

Posted by Tobias Gierke <to...@code-sourcery.de>.
Hi,
> ...that would only move the problem to the common parent.
> Than I have to guarantee, that all my artifacts use the same common 
> parent.
>   
We've solved this by doing all of our releases using a simple Perl
wrapper script that

1.) changes into the project's directory
2.) svn up
3.) mvn org.codehaus.mojo:versions-maven-plugin:1.0-alpha-2:update-parent
   [ updates the parent POM version number to the latest version ]
4.)  svn checkin
5.)  mvn release:prepare release:perform

Regards,

Tobias
> I´m thinking about a (JUnit)Testcase, that checks the version of 
> common-services, or 
> that reads an entry of all the Manifest.MF oder 
> "common-services.properties", containing the version string.
>
> Any other idea - Maven based?
>   

We're using a simple Perl script


> Thanx, Torsten
>
>
>
>
> Tobias Gierke <to...@code-sourcery.de> 
> 10.03.2009 14:57
> Bitte antworten an
> "Maven Users List" <us...@maven.apache.org>
>
>
> An
> Maven Users List <us...@maven.apache.org>
> Kopie
>
> Thema
> Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same 
> shared API?
>
>
>
>
>
>
> Hi Torsten,
>   
>> Hi, 
>>
>> in our build environment, we build and release our modules at different 
>> times.
>> Lets say UI.war is released first,  than backend.ear (using the released 
>>     
>
>   
>> UI) is released three days later, 
>> than last the WebServices.war were released.
>>
>> All are using a shared API (common-services.jar)
>>
>> In our delivery build we dependency-copy the UI.war, the Backend.ear and 
>>     
>
>   
>> the Webservices.war into a directory structure.
>> We have to guarantee, that the UI.war and the Backend.ear and all other 
>> components, too are all using the same version 
>> of "commons-services.jar".
>>
>> How can I check, that an artifact (*.war, *.ear) has the same dependency 
>>     
>
>   
>> as another artifact?
>>
>>     
> Why don't you create a separate "parent POM" project
>
> <project>
>
>    [...]
>    <packaging>pom</packaging>
>     [...]
>
>   <dependencyManagement>
>      [...]
>     <dependency>
>       <groupId>your-group-id</groupId>
>       <artifactId>common-services<artifactId>
>       <version>1.2.3</version>
>     </dependency>
>     [...]
>   </dependencyManagement>
> [...]
> </project>
>
> and let your UI / webservices / backend projects all inherit the version
> number from the common parent ?
>
> Regards,
>
> Tobias
>  
>
>   
>> Thanx, Torsten
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>   


Antwort: Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same shared API?

Posted by to...@gi-de.com.
...that would only move the problem to the common parent.
Than I have to guarantee, that all my artifacts use the same common 
parent.

I´m thinking about a (JUnit)Testcase, that checks the version of 
common-services, or 
that reads an entry of all the Manifest.MF oder 
"common-services.properties", containing the version string.

Any other idea - Maven based?

Thanx, Torsten




Tobias Gierke <to...@code-sourcery.de> 
10.03.2009 14:57
Bitte antworten an
"Maven Users List" <us...@maven.apache.org>


An
Maven Users List <us...@maven.apache.org>
Kopie

Thema
Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same 
shared API?






Hi Torsten,
> Hi, 
>
> in our build environment, we build and release our modules at different 
> times.
> Lets say UI.war is released first,  than backend.ear (using the released 

> UI) is released three days later, 
> than last the WebServices.war were released.
>
> All are using a shared API (common-services.jar)
>
> In our delivery build we dependency-copy the UI.war, the Backend.ear and 

> the Webservices.war into a directory structure.
> We have to guarantee, that the UI.war and the Backend.ear and all other 
> components, too are all using the same version 
> of "commons-services.jar".
>
> How can I check, that an artifact (*.war, *.ear) has the same dependency 

> as another artifact?
> 
Why don't you create a separate "parent POM" project

<project>

   [...]
   <packaging>pom</packaging>
    [...]

  <dependencyManagement>
     [...]
    <dependency>
      <groupId>your-group-id</groupId>
      <artifactId>common-services<artifactId>
      <version>1.2.3</version>
    </dependency>
    [...]
  </dependencyManagement>
[...]
</project>

and let your UI / webservices / backend projects all inherit the version
number from the common parent ?

Regards,

Tobias
 

> Thanx, Torsten
>
> 


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



Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same shared API?

Posted by Tobias Gierke <to...@code-sourcery.de>.
Hi Torsten,
> Hi, 
>
> in our build environment, we build and release our modules at different 
> times.
> Lets say UI.war is released first,  than backend.ear (using the released 
> UI) is released three days later, 
> than last the WebServices.war were released.
>
> All are using a shared API (common-services.jar)
>
> In our delivery build we dependency-copy the UI.war, the Backend.ear and 
> the Webservices.war into a directory structure.
> We have to guarantee, that the UI.war and the Backend.ear and all other 
> components, too are all using the same version 
> of "commons-services.jar".
>
> How can I check, that an artifact (*.war, *.ear) has the same dependency 
> as another artifact?
>   
Why don't you create a separate "parent POM" project

<project>

   [...]
   <packaging>pom</packaging>
    [...]

  <dependencyManagement>
     [...]
    <dependency>
      <groupId>your-group-id</groupId>
      <artifactId>common-services<artifactId>
      <version>1.2.3</version>
    </dependency>
    [...]
  </dependencyManagement>
[...]
</project>

and let your UI / webservices / backend projects all inherit the version
number from the common parent ?

Regards,

Tobias
 

> Thanx, Torsten
>
>   


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


Re: how can I guarantee delivery artifacts (*.war, *.ear) to use the same shared API?

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Torsten,

torsten.reinhard@gi-de.com wrote at Dienstag, 10. März 2009 11:44:

> Hi,
> 
> in our build environment, we build and release our modules at different
> times.
> Lets say UI.war is released first,  than backend.ear (using the released
> UI) is released three days later,
> than last the WebServices.war were released.
> 
> All are using a shared API (common-services.jar)
> 
> In our delivery build we dependency-copy the UI.war, the Backend.ear and
> the Webservices.war into a directory structure.
> We have to guarantee, that the UI.war and the Backend.ear and all other
> components, too are all using the same version
> of "commons-services.jar".
> 
> How can I check, that an artifact (*.war, *.ear) has the same dependency
> as another artifact?

Use a shared parent and define the version in a dependencyManagement
sectiuon.

- Jörg


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