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 <[email protected]>

>
>
>
> 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
>
> [email protected]
>
>
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> https://signup.live.com/signup.aspx?id=60969

Reply via email to