The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

newbie000 (10) [Avatar] Offline
#1
How does the following line:

<version>${camel-version}</version>

results into 2.2.5

The book says:

The version element is set to the camel-version property, which is defined in the POM referenced in the parent element 1, and will resolve to 2.5.0.


This is the parent element:

<parent>
<groupId>com.camelinaction</groupId>
<artifactId>chapter1</artifactId>
<version>1.0</version>
</parent>

I don't understand how the version is resolved to 2.5.0. Please explain.
davsclaus (413) [Avatar] Offline
#2
Re: first POM in the book
A parent can also have a parent, so you have to following down the parent tree.

In the root directory of the source code is a pom.xml, and it lists the versions in the properties section.
newbie000 (10) [Avatar] Offline
#3
Re: first POM in the book
Thanks for the reply:

I see the following pom.xml in "camelinaction-sourcechapter1"

<project xmlns="http://maven.apache.org/POM/4.0.0" >
xmlnssmiliesi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.camelinaction</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>chapter1</artifactId>
<packaging>pom</packaging>
<name>Camel in Action :: Chapter 1</name>

<modules>
<module>file-copy</module>
</modules>
</project>

and I see the following pom.xml in the "camelinaction-sourcechapter1file-copy"

<project xmlns="http://maven.apache.org/POM/4.0.0" >
xmlnssmiliesi="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>

<parent>
<groupId>com.camelinaction</groupId>
<artifactId>chapter1</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>chapter1-file-copy</artifactId>
<name>Camel in Action :: Chapter 1 :: File Copy Example</name>

<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
</dependencies>

</project>

I don't see the version 2.5 mentioned in any of the pom.xml. Please explain how does it resolves to 2.5. Also, which POM is used when "FileCopierWithCamel.java" is deployed?
davsclaus (413) [Avatar] Offline
#4
Re: first POM in the book
See the pom.xml file in the camelinaction-source directory.