Greets,

I have a big maven project  that has about 300 pom files in it.  Currently,
the <version> is hardcoded on all the pom.xml files and moving from one
version to another is a PITA.   My question is, what's the best way of
doing away with the hardcoded value and moving to a variable where it can
be set in the parent pom.   Right now, I'm experimenting by setting version
to <version>${build_version}</version>  and added in my parent pom
<properties><build_version>2.2</build_version></properties>.      For the
most part, this works fine, but  there are some sub-components in the
project where ${build_version} is not getting expanded, which is quite
annoying, to say the least.

Here's a sample output where the variable is not getting expanded.

[INFO]
----------------------------------------------------------------------------
[INFO] Building CSDPRoleMappingPortlet
[INFO]    task-segment: [clean, antrun:run, install, rpm:rpm]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/com.ibm.csdp.pm.selfcare/CSDPRoleMappingPortlet/target
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/com.ibm.csdp.pm.selfcare/CSDPRoleMappingPortlet/WebContent/WEB-INF/classes
[INFO] Deleting directory
/home/egaona/projects/csdp_build/sources/csdp/com.ibm.csdp.pm.selfcare/CSDPRoleMappingPortlet/target/test-classes
Downloading:
ftp://ausgsa.austin.ibm.com/projects/c/csdpbuildrepository/maven/repository/com/ibm/csdp/prereq/com.ibm.csdp.prereq/${csdp_version}/com.ibm.csdp.prereq-${csdp_version}.pom
[WARNING] Unable to get resource from repository csdpFtpRepository
(ftp://ausgsa.austin.ibm.com/projects/c/csdpbuildrepository/maven/repository)
Downloading:
ftp://ausgsa.ibm.com/projects/c/csdpbuildrepository/maven/repository/com/ibm/csdp/prereq/com.ibm.csdp.prereq/${csdp_version}/com.ibm.csdp.prereq-${csdp_version}.pom
[WARNING] Unable to get resource from repository csdpFtpRepository
(ftp://ausgsa.ibm.com/projects/c/csdpbuildrepository/maven/repository)
Downloading:
http://ausgsa.ibm.com/projects/c/csdpbuildrepository/maven/repository/com/ibm/csdp/prereq/com.ibm.csdp.prereq/${csdp_version}/com.ibm.csdp.prereq-${csdp_version}.pom
[WARNING] Unable to get resource from repository csdpRepository
(http://ausgsa.ibm.com/projects/c/csdpbuildrepository/maven/repository)
Downloading:
http://www.ibiblio.net/pub/packages/maven2/com/ibm/csdp/prereq/com.ibm.csdp.prereq/${csdp_version}/com.ibm.csdp.prereq-${csdp_version}.pom
[WARNING] Unable to get resource from repository central
(http://repo1.maven.org/maven2)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: com.ibm.csdp.prereq
ArtifactId: com.ibm.csdp.prereq
Version: ${csdp_version}

Reason: Unable to download the artifact from any repository

  com.ibm.csdp.prereq:com.ibm.csdp.prereq:pom:${csdp_version}

from the specified remote repositories:
  Maven Snapshots (http://snapshots.maven.codehaus.org/maven2/),
  central (http://repo1.maven.org/maven2),
  csdpRepository
(http://ausgsa.ibm.com/projects/c/csdpbuildrepository/maven/repository),
  csdpFtpRepository
(ftp://ausgsa.austin.ibm.com/projects/c/csdpbuildrepository/maven/repository)


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 21 seconds
[INFO] Finished at: Tue Nov 27 12:36:55 CST 2007
[INFO] Final Memory: 11M/30M
[INFO]
------------------------------------------------------------------------


Any ideas?  Thanks.

Enrique

Reply via email to