2012-12-21 44 views
0

我这里下载的样本气氛JAX-RS的源代码 - http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.atmosphere.samples%22%20AND%20a%3A%22atmosphere-jaxrs2-chat%22

我下载了战争和sources.jar。而pom.xml的是在浏览器中查看 - http://search.maven.org/remotecontent?filepath=org/atmosphere/samples/atmosphere-jaxrs2-chat/1.0.7/atmosphere-jaxrs2-chat-1.0.7.pom

我想一些从这个pom.xml的依赖关系复制到我自己的pom.xml,但我看到的东西一样 -

<dependency> 
    <groupId>ch.qos.logback</groupId> 
    <artifactId>logback-classic</artifactId> 
    <version>${logback-version}</version> 
</dependency> 
<dependency> 
    <groupId>com.sun.jersey</groupId> 
    <artifactId>jersey-json</artifactId> 
    <version>${jersey-version}</version> 
</dependency> 

我相信${logback-version}${jersey-version}是占位符,但实际上它们在哪里设置?

回答

2

在父pom。在pom的顶部,有一个对包含值的父pom的引用。

this thread中的一些基本原理 - 基本上,它使版本在多模块项目中保持同步。

父定义看起来是这样的:在POM文档页面的inheritance section

<parent> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>my-parent</artifactId> 
    <version>2.0</version> 
    <relativePath>../my-parent</relativePath> 
</parent> 

喜欢解释。

相关问题