You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2011/03/31 14:24:18 UTC

${project-version} breaks maven 3 build

Hi,

mvn help:effective-pom (for example) fails with Maven 3 because of
this in most stanbol POMs:

 <parent>
    <groupId>org.apache.stanbol</groupId>
    <artifactId>stanbol-parent</artifactId>
    <version>${stanbol-version}</version>
    <relativePath>parent</relativePath>
  </parent>

And stanbol-version is defined in the parent pom, creating a
chicken-and-egg problem.

For some reason Maven 2 accepts that, but I think it's wrong anyway,
version numbers should be constants in general, and especially when
pointing to the parent pom. I think variable version numbers will
cause problems with the Maven release plugin, at least.

Can we change to constants for version numbers, or what was the idea
behind this?

-Bertrand

(workaround is to add -Dstanbol-version=0.9-SNAPSHOT to the mvn
command line in the meantime)

Re: ${project-version} breaks maven 3 build

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Rupert,

On Thu, Mar 31, 2011 at 3:21 PM, Rupert Westenthaler
<ru...@gmail.com> wrote:
> On Thu, Mar 31, 2011 at 2:24 PM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
>>... mvn help:effective-pom (for example) fails with Maven 3...

> I changed the links to the parent from "0.9-SNAMPSHOT" to
> "${stanbol-version} because the build was not working (with Maven 2)
> if the stanbol bundles where not already present within the local
> cache. Using the variable solved this problem.

If doing a full build, the parent pom should be built first, didn't that work?

Of course, if building a submodule without having built the parent pom
that would fail, but that's expected.

> If this causes problems with Maven 3 than I think we should define the
> version within the parent statically to "0.9-SNAPSHOT".

You mean just within the parent pom, and keep ${stanbol-version} in
the other poms? I don't think that will work either, we should IMO use
constants for <version>, at least for a module and its parent
versions.

-Bertrand

Re: ${project-version} breaks maven 3 build

Posted by Olivier Grisel <ol...@ensta.org>.
2011/4/4 Olivier Grisel <ol...@ensta.org>:
> 2011/4/1 Bertrand Delacretaz <bd...@apache.org>:
>> On Thu, Mar 31, 2011 at 7:10 PM, Olivier Grisel
>> <ol...@ensta.org> wrote:
>>> I am ok to switch back to constant versions as Bertrand is proposing.
>>> However can we wait for the http refactoring branch merge before
>>> changing all the pom.xml? I am pretty sure that will cause conflicts
>>> at merge time :)
>>
>> Ok, sounds good, let's wait for after your merge.
>
> Ok now that the merge is done, who wants to tackle the
> ${stanbol.version} issue? It is indeed very annoying.

Ok I did it and I am able to build everything from scratch.

See most of you tomorrow in Saarbrucken!

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: ${project-version} breaks maven 3 build

Posted by Olivier Grisel <ol...@ensta.org>.
2011/4/1 Bertrand Delacretaz <bd...@apache.org>:
> On Thu, Mar 31, 2011 at 7:10 PM, Olivier Grisel
> <ol...@ensta.org> wrote:
>> I am ok to switch back to constant versions as Bertrand is proposing.
>> However can we wait for the http refactoring branch merge before
>> changing all the pom.xml? I am pretty sure that will cause conflicts
>> at merge time :)
>
> Ok, sounds good, let's wait for after your merge.

Ok now that the merge is done, who wants to tackle the
${stanbol.version} issue? It is indeed very annoying.

-- 
Olivier
http://twitter.com/ogrisel - http://github.com/ogrisel

Re: ${project-version} breaks maven 3 build

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Thu, Mar 31, 2011 at 7:10 PM, Olivier Grisel
<ol...@ensta.org> wrote:
> I am ok to switch back to constant versions as Bertrand is proposing.
> However can we wait for the http refactoring branch merge before
> changing all the pom.xml? I am pretty sure that will cause conflicts
> at merge time :)

Ok, sounds good, let's wait for after your merge.
-Bertrand

Re: ${project-version} breaks maven 3 build

Posted by Olivier Grisel <ol...@ensta.org>.
I am ok to switch back to constant versions as Bertrand is proposing.
However can we wait for the http refactoring branch merge before
changing all the pom.xml? I am pretty sure that will cause conflicts
at merge time :)

-- 
Olivier

Re: ${project-version} breaks maven 3 build

Posted by Fabian Christ <ch...@googlemail.com>.
Hi,

I have also seen the "best practice" to have the versioning of parent
POM separated from the rest and to not use "-SNAPSHOT" for parent
versions. The reason is that parents don't change that much that you
need the SNAPSHOT concept.

We could define version "1" or whatever for the parent and use this to
refer to the parent POM. The idea behind ${stanbol-version} was once
to ensure that all components have the same version number. We decided
that we don't need different versions for components. This could be
ensured by a global variable. But perhaps this is not valid anymore
today. It is from "old IKS times" ;)

Personally, I had some bad experiences with Maven release plugin but
maybe those problems are solved in newer versions. I tried to use it
two years ago and it was a lot of trouble in complex project
structures.

Best,
 - Fabian

2011/3/31 Rupert Westenthaler <ru...@gmail.com>:
> Hi
>
>
>
> On Thu, Mar 31, 2011 at 2:24 PM, Bertrand Delacretaz
> <bd...@apache.org> wrote:
>> Hi,
>>
>> mvn help:effective-pom (for example) fails with Maven 3 because of
>> this in most stanbol POMs:
>>
>>  <parent>
>>    <groupId>org.apache.stanbol</groupId>
>>    <artifactId>stanbol-parent</artifactId>
>>    <version>${stanbol-version}</version>
>>    <relativePath>parent</relativePath>
>>  </parent>
>>
>> And stanbol-version is defined in the parent pom, creating a
>> chicken-and-egg problem.
>>
>> For some reason Maven 2 accepts that, but I think it's wrong anyway,
>> version numbers should be constants in general, and especially when
>> pointing to the parent pom. I think variable version numbers will
>> cause problems with the Maven release plugin, at least.
>>
>> Can we change to constants for version numbers, or what was the idea
>> behind this?
>
> I changed the links to the parent from "0.9-SNAMPSHOT" to
> "${stanbol-version} because the build was not working (with Maven 2)
> if the stanbol bundles where not already present within the local
> cache. Using the variable solved this problem.
>
> If this causes problems with Maven 3 than I think we should define the
> version within the parent statically to "0.9-SNAPSHOT".
>
> best
> Rupert Westenthaler
>
>>
>> -Bertrand
>>
>> (workaround is to add -Dstanbol-version=0.9-SNAPSHOT to the mvn
>> command line in the meantime)
>>
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                             ++43-699-11108907
> | A-5500 Bischofshofen
>



-- 
Fabian

Re: ${project-version} breaks maven 3 build

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi



On Thu, Mar 31, 2011 at 2:24 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> Hi,
>
> mvn help:effective-pom (for example) fails with Maven 3 because of
> this in most stanbol POMs:
>
>  <parent>
>    <groupId>org.apache.stanbol</groupId>
>    <artifactId>stanbol-parent</artifactId>
>    <version>${stanbol-version}</version>
>    <relativePath>parent</relativePath>
>  </parent>
>
> And stanbol-version is defined in the parent pom, creating a
> chicken-and-egg problem.
>
> For some reason Maven 2 accepts that, but I think it's wrong anyway,
> version numbers should be constants in general, and especially when
> pointing to the parent pom. I think variable version numbers will
> cause problems with the Maven release plugin, at least.
>
> Can we change to constants for version numbers, or what was the idea
> behind this?

I changed the links to the parent from "0.9-SNAMPSHOT" to
"${stanbol-version} because the build was not working (with Maven 2)
if the stanbol bundles where not already present within the local
cache. Using the variable solved this problem.

If this causes problems with Maven 3 than I think we should define the
version within the parent statically to "0.9-SNAPSHOT".

best
Rupert Westenthaler

>
> -Bertrand
>
> (workaround is to add -Dstanbol-version=0.9-SNAPSHOT to the mvn
> command line in the meantime)
>



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Re: ${project-version} breaks maven 3 build

Posted by Cihan Cimen <ci...@srdc.com.tr>.
Hi,

I have a problem that may be related to this issue.
When I have a dependency to 
org.apache.stanbol:org.apache.stanbol.enhancer.servicesapi:bundle:0.9-SNAPSHOT 
,
enhancer.parent can not be found by maven because it always searches for 
version ${stanbol-version}.
I use maven 2.2.1. I have Apache Stanbol on my local maven repo, built 
successfully.

Enclosed, please find an example pom.xml with a simple dependency on 
enhancer.servicesapi and the output of "mvn clean install 
-Dstanbol-version=0.9-SNAPSHOT" command.

Best,
-Cihan

On 03/31/2011 03:24 PM, Bertrand Delacretaz wrote:
> Hi,
>
> mvn help:effective-pom (for example) fails with Maven 3 because of
> this in most stanbol POMs:
>
>   <parent>
>      <groupId>org.apache.stanbol</groupId>
>      <artifactId>stanbol-parent</artifactId>
>      <version>${stanbol-version}</version>
>      <relativePath>parent</relativePath>
>    </parent>
>
> And stanbol-version is defined in the parent pom, creating a
> chicken-and-egg problem.
>
> For some reason Maven 2 accepts that, but I think it's wrong anyway,
> version numbers should be constants in general, and especially when
> pointing to the parent pom. I think variable version numbers will
> cause problems with the Maven release plugin, at least.
>
> Can we change to constants for version numbers, or what was the idea
> behind this?
>
> -Bertrand
>
> (workaround is to add -Dstanbol-version=0.9-SNAPSHOT to the mvn
> command line in the meantime)
>
>