You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Barışcan Güngör <ba...@w.cn> on 2010/05/17 14:53:28 UTC

About Maven3 M2Eclipse Plug-in Versioning Problem



Hi,

 

At first, thanks for your attention and time to read.

 

In our enterprise applications we use MyEclipse 8.5 with
M2Eclipse maven3 plug-in support. Before begining to use maven3, with maven2 we
could specify a variable for the application version in the parent pom, so that
in the child poms we could able to specify the version by the same variable.
That helps us saving our time for updating version number in each project
upgrade and for reusability. 

 

I hope I can clearly demonstrate the problem as the
following piece of code for pom.xml’s. 

Now the problem is in maven3 (m2eclipse) it gives a warning
that says “version must be a constant instead of a variable”. I have been
trying lots of variations such as moving out the <version> tag or
swapping the expressions between <projectVersion> and <version>
tags or the other suggestions from the different forum sites, etc.. However,
the solution never comes up.. Maybe I am doing something wrong, but could not
find out yet. 

 

Any help would be appreciated,

Many thanks in advance,

Bariscan

 

BTW, you can check the case from here:

 

PARENT:

<project

      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"

      xmlns="http://maven.apache.org/POM/4.0.0"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <modelVersion>4.0.0</modelVersion>

      <groupId>com.gg.n3gservices</groupId>

      <artifactId>n3gservices</artifactId>

      <name>n3gservices Maven
Main</name>

      <packaging>pom</packaging>

      <description>Version Alias:
MemberProfitLocalService </description> 

      <version>${projectVersion}</version>

      <properties>

           
<projectVersion>2.4</projectVersion>

      </properties>

 

Child;

<project

      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"

      xmlns="http://maven.apache.org/POM/4.0.0"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <modelVersion>4.0.0</modelVersion>

      <groupId>com.gg.n3gservices</groupId>

      <artifactId>n3gservicesBugfix</artifactId>

      <name>n3gservices Bugfix</name>

      <parent>

           
<artifactId>n3gservices</artifactId>

           
<groupId>com.gg.n3gservices</groupId>

           
<relativePath>../n3gservices/pom.xml</relativePath>

           
<version>${projectVersion}</version>

      </parent>

<version>${projectVersion}</version>



--
Barışcan Güngör
Matematik Mühendisi
+905322277334

bariscan@w.cn

 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969

Re: About Maven3 M2Eclipse Plug-in Versioning Problem

Posted by Benjamin Bentmann <be...@udo.edu>.
Barışcan Güngör wrote:

> Now the problem is in maven3 (m2eclipse) it gives a warning
> that says “version must be a constant instead of a variable”.

A POM deployed to a repository must be self-contained in the way that 
all information required to process it (e.g. calculate the effective 
POM) must be present in the POM.

This does not hold for a POM referencing its parent via an external 
property. Until Maven provides support to (partly) interpolate 
properties before deployment, using properties for POM coordinates is an 
anti-pattern that enables deployment of broken POMs, i.e. that can't be 
used during dependency resolution as we have already seen in the past 
for stuff in central.

Regarding easier version maintenance for multi-module projects, right 
now I can only suggest to use the Release Plugin and to vote for MNG-624.


Benjamin

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


Re: About Maven3 M2Eclipse Plug-in Versioning Problem

Posted by Stephen Connolly <st...@gmail.com>.
No worries... though I need to call a vote to get a 3.0-beta-1 compatible
version published

2010/5/17 Benjamin Bentmann <be...@udo.edu>

> Barışcan Güngör wrote:
>
>  [...] we
>>
>> could specify a variable for the application version in the parent pom, so
>> that
>> in the child poms we could able to specify the version by the same
>> variable.
>> That helps us saving our time for updating version number in each project
>> upgrade and for reusability.
>>
>
> Oh, and I likely should have mentioned the
>
>  http://mojo.codehaus.org/versions-maven-plugin/
>
> (sorry Stephen ;-) )
>
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: About Maven3 M2Eclipse Plug-in Versioning Problem

Posted by Benjamin Bentmann <be...@udo.edu>.
Barışcan Güngör wrote:

> [...] we
> could specify a variable for the application version in the parent pom, so that
> in the child poms we could able to specify the version by the same variable.
> That helps us saving our time for updating version number in each project
> upgrade and for reusability.

Oh, and I likely should have mentioned the

   http://mojo.codehaus.org/versions-maven-plugin/

(sorry Stephen ;-) )


Benjamin

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


RE: About Maven3 M2Eclipse Plug-in Versioning Problem

Posted by Martin Gainty <mg...@hotmail.com>.
 
//did you try setting the necessary properties in settings.xml or profiles.xml e.g.?


<profilesXml>

  </profiles>
    <profile>
      <id>appserverConfig</id>
      <properties>
        <version>1.0</version>
      </properties>

    </profile>

  </profiles>

  <activeProfiles>
    <activeProfile>appserverConfig</activeProfile>
  </activeProfiles
</profilesXml>


http://maven.apache.org/guides/introduction/introduction-to-profiles.html
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> From: bariscan@w.cn
> To: dev@maven.apache.org
> Subject: About Maven3 M2Eclipse Plug-in Versioning Problem
> Date: Mon, 17 May 2010 15:53:28 +0300
> 
> 
> 
> 
> Hi,
> 
> 
> 
> At first, thanks for your attention and time to read.
> 
> 
> 
> In our enterprise applications we use MyEclipse 8.5 with
> M2Eclipse maven3 plug-in support. Before begining to use maven3, with maven2 we
> could specify a variable for the application version in the parent pom, so that
> in the child poms we could able to specify the version by the same variable.
> That helps us saving our time for updating version number in each project
> upgrade and for reusability. 
> 
> 
> 
> I hope I can clearly demonstrate the problem as the
> following piece of code for pom.xml’s. 
> 
> Now the problem is in maven3 (m2eclipse) it gives a warning
> that says “version must be a constant instead of a variable”. I have been
> trying lots of variations such as moving out the <version> tag or
> swapping the expressions between <projectVersion> and <version>
> tags or the other suggestions from the different forum sites, etc.. However,
> the solution never comes up.. Maybe I am doing something wrong, but could not
> find out yet. 
> 
> 
> 
> Any help would be appreciated,
> 
> Many thanks in advance,
> 
> Bariscan
> 
> 
> 
> BTW, you can check the case from here:
> 
> 
> 
> PARENT:
> 
> <project
> 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd"
> 
> xmlns="http://maven.apache.org/POM/4.0.0"
> 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> 
> <modelVersion>4.0.0</modelVersion>
> 
> <groupId>com.gg.n3gservices</groupId>
> 
> <artifactId>n3gservices</artifactId>
> 
> <name>n3gservices Maven
> Main</name>
> 
> <packaging>pom</packaging>
> 
> <description>Version Alias:
> MemberProfitLocalService </description> 
> 
> <version>${projectVersion}</version>
> 
> <properties>
> 
> 
> <projectVersion>2.4</projectVersion>
> 
> </properties>
> 
> 
> 
> Child;
> 
> <project
> 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd"
> 
> xmlns="http://maven.apache.org/POM/4.0.0"
> 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> 
> <modelVersion>4.0.0</modelVersion>
> 
> <groupId>com.gg.n3gservices</groupId>
> 
> <artifactId>n3gservicesBugfix</artifactId>
> 
> <name>n3gservices Bugfix</name>
> 
> <parent>
> 
> 
> <artifactId>n3gservices</artifactId>
> 
> 
> <groupId>com.gg.n3gservices</groupId>
> 
> 
> <relativePath>../n3gservices/pom.xml</relativePath>
> 
> 
> <version>${projectVersion}</version>
> 
> </parent>
> 
> <version>${projectVersion}</version>
> 
> 
> 
> --
> Barışcan Güngör
> Matematik Mühendisi
> +905322277334
> 
> bariscan@w.cn
> 
> 
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> https://signup.live.com/signup.aspx?id=60969
 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

Re: About Maven3 M2Eclipse Plug-in Versioning Problem

Posted by Stephen Connolly <st...@gmail.com>.
You were relying on a bug.

the following xpath:/project/parent/groupId,
xpath:/project/parent/artifactId, xpath:/project/parent/version,
xpath:/project/groupId, xpath:/project/artifactId, xpath:/project/version
cannot ever reference a property as they are all evaluated before the model
is available.

-Stephen

2010/5/17 Barışcan Güngör <ba...@w.cn>

>
>
>
> Hi,
>
>
>
> At first, thanks for your attention and time to read.
>
>
>
> In our enterprise applications we use MyEclipse 8.5 with
> M2Eclipse maven3 plug-in support. Before begining to use maven3, with
> maven2 we
> could specify a variable for the application version in the parent pom, so
> that
> in the child poms we could able to specify the version by the same
> variable.
> That helps us saving our time for updating version number in each project
> upgrade and for reusability.
>
>
>
> I hope I can clearly demonstrate the problem as the
> following piece of code for pom.xml’s.
>
> Now the problem is in maven3 (m2eclipse) it gives a warning
> that says “version must be a constant instead of a variable”. I have been
> trying lots of variations such as moving out the <version> tag or
> swapping the expressions between <projectVersion> and <version>
> tags or the other suggestions from the different forum sites, etc..
> However,
> the solution never comes up.. Maybe I am doing something wrong, but could
> not
> find out yet.
>
>
>
> Any help would be appreciated,
>
> Many thanks in advance,
>
> Bariscan
>
>
>
> BTW, you can check the case from here:
>
>
>
> PARENT:
>
> <project
>
>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd"
>
>      xmlns="http://maven.apache.org/POM/4.0.0"
>
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>      <modelVersion>4.0.0</modelVersion>
>
>      <groupId>com.gg.n3gservices</groupId>
>
>      <artifactId>n3gservices</artifactId>
>
>      <name>n3gservices Maven
> Main</name>
>
>      <packaging>pom</packaging>
>
>      <description>Version Alias:
> MemberProfitLocalService </description>
>
>      <version>${projectVersion}</version>
>
>      <properties>
>
>
> <projectVersion>2.4</projectVersion>
>
>      </properties>
>
>
>
> Child;
>
> <project
>
>      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd"
>
>      xmlns="http://maven.apache.org/POM/4.0.0"
>
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>      <modelVersion>4.0.0</modelVersion>
>
>      <groupId>com.gg.n3gservices</groupId>
>
>      <artifactId>n3gservicesBugfix</artifactId>
>
>      <name>n3gservices Bugfix</name>
>
>      <parent>
>
>
> <artifactId>n3gservices</artifactId>
>
>
> <groupId>com.gg.n3gservices</groupId>
>
>
> <relativePath>../n3gservices/pom.xml</relativePath>
>
>
> <version>${projectVersion}</version>
>
>      </parent>
>
> <version>${projectVersion}</version>
>
>
>
> --
> Barışcan Güngör
> Matematik Mühendisi
> +905322277334
>
> bariscan@w.cn
>
>
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> https://signup.live.com/signup.aspx?id=60969