读书人

maven诠注参数

发布时间: 2013-07-16 22:38:04 作者: rapoo

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().

  • 读书人网 >编程

    热点推荐