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)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.stanbol.trial</groupId>
<artifactId>enhancer.servicesapi.dependent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.stanbol</groupId>
<artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
<version>0.9-SNAPSHOT</version>
<type>bundle</type>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.apache.stanbol.trial:enhancer.servicesapi.dependent:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: /home/cihan/workspaces/stanbol-migration/gg/target (included: [**], excluded: [])
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
Downloading: http://repo1.maven.org/maven2/org/apache/stanbol/org.apache.stanbol.enhancer.parent/${stanbol-version}/org.apache.stanbol.enhancer.parent-${stanbol-version}.pom
[INFO] Unable to find resource 'org.apache.stanbol:org.apache.stanbol.enhancer.parent:pom:${stanbol-version}' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.stanbol:org.apache.stanbol.enhancer.servicesapi:bundle:${stanbol-version}
Reason: Cannot find parent: org.apache.stanbol:org.apache.stanbol.enhancer.parent for project: org.apache.stanbol:org.apache.stanbol.enhancer.servicesapi:bundle:${stanbol-version} for project org.apache.stanbol:org.apache.stanbol.enhancer.servicesapi:bundle:${stanbol-version}
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Fri Apr 01 09:55:09 EEST 2011
[INFO] Final Memory: 9M/110M
[INFO] ------------------------------------------------------------------------