首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

maven诠注参数

2013-07-16 
maven注解参数IntroBecause I couldnt find a clear overview of which properties are availabe in mave

maven注解参数

Intro

Because I couldn't find a clear overview of which properties are availabe in maven2 I started this page. It is a collection of things found in the offcial maven documentation and postings to the maven user mailing list.

Note: In Maven 3.0, all

  • ${project.name}refers to the name of the project<project>...??<properties>?????<my.filter.value>hello</my.filter.value>??</properties>...</project>
    • ${my.filter.value} will result in?hello?if you inserted the above XML fragment in your pom.xml

      Parent Project variables

      How can parent project variables be accessed?

      You can use the prefix:?${project.parent}.

      A good way to determine possible variables is to have a look directly at the API. I'm currently using Maven 2.2.1, and to access the Parent you can use?${project.parent}. This will return anorg.apache.maven.project.MavenProject?instance.

      To access the parent version:?${parent.version}.

      Reflection Properties

      The pattern?${someX.someY.someZ} can simply sometimes mean?getSomeX().getSomeY().getSomeZ(). Thus, properties such as?${project.build.directory} is translated togetProject().getBuild().getDirectory().