煩惱歲月

          付出總是有回報的 take action follow your heart , or follow your head
          posts - 40, comments - 5, trackbacks - 0, articles - 4

          Maven Properties Guide

          Posted on 2009-10-11 23:01 不需要解釋 閱讀(1430) 評論(0)  編輯  收藏 所屬分類: maven
          Build in properties
          • ${basedir} represents the directory containing pom.xml
          • ${version} equivalent to ${project.version} or ${pom.version}
          Pom/Project properties

          All elements in the pom.xml, can be referenced with the project. prefix or using pom. as prefix. This list is just an example of some commonly used elements.

          • ${project.build.directory} results in the path to your "target" dir, this is the same as ${pom.project.build.directory}
          • ${project.build.outputDirectory} results in the path to your "target/classes" dir
          • ${project.name} or ${pom.name} refers to the name of the project.
          • ${project.version} or ${pom.version} refers to the version of the project.
          • ${project.build.finalName} refers to the final name of the file created when the built project is packaged
          Local user settings

          Similarly, values in the user's settings.xml can be referenced using property names with settings. prefix.

          • ${settings.localRepository} refers to the path of the user's local repository.
          • ${maven.repo.local} also works for backward compatibility with maven1 ??
          Environment variables

          Environment variables can be referenced using the env prefix

          • ${env.M2_HOME} returns the Maven2 installation path.
          • ${java.home} specifies the path to the current JRE_HOME environment use with relative paths to get for example:
            <jvm>${java.home}../bin/java.exe</jvm>
            Java system properties

          All Java System Properties defined by the JVM.

          Custom properties in the POM

          User defined properties in the pom.xml.

          <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: ${parent.project}.

          For example, use ${parent.project.version} to retrieve parent version.

          A good way to determine possible variables is to have a look directly at the API. The above example was not working for me, maybe it was working that way with older releases of maven. I'm currently using Maven 2.2.1, and to access the Parent you can use ${project.parent}. This will return an org.apache.maven.project.MavenProject instance.

          Reflection Properties

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

          我實話告訴你們,我可是身經百戰了.bbs我見的多了,哪個版我沒灌過?你們要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你們不知道厲害到哪里去了,我在那談笑風聲.你 們有一好就是無論在哪個版,什么話題都灌,但是灌來灌去的問題,都too simple, sometimes naive!你 們懂不懂呀?啊?所以說灌水啊,關鍵是要提高自己的知識水平.你 們啊,不要總想著弄個大坑,然后灌上十大,再把我羞辱一番……你們啊,naive!你們這 樣灌是不行地!~那你問我支持 不支持灌水,我說支持,我常來這裡灌,你說支持不支持?
          主站蜘蛛池模板: 长丰县| 万年县| 普格县| 扶绥县| 池州市| 革吉县| 元谋县| 酒泉市| 新绛县| 视频| 亚东县| 福贡县| 曲水县| 新乡市| 六安市| 玛沁县| 施甸县| 黄梅县| 沙河市| 景洪市| 吉木萨尔县| 丽水市| 富源县| 平遥县| 庆云县| 黔西| 浦城县| 开阳县| 右玉县| 砀山县| 罗田县| 华宁县| 九寨沟县| 澎湖县| 沙田区| 金塔县| 平乐县| 北流市| 江都市| 宁安市| 高尔夫|