`
hy90171
  • 浏览: 58135 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

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 pom.* properties are deprecated. Use project.* instead!

Built-in properties

  • ${basedir} represents the directory containing pom.xml
  • ${version} equivalent to ${project.version} (deprecated: ${pom.version})

Pom/Project properties

All elements in the pom.xml, can be referenced with the project. prefix. This list is just an example of some commonly used elements. (deprecated: {pom.} prefix)

  • ${project.build.directory} results in the path to your "target" directory, this is the same as ${pom.project.build.directory}
  • ${project.build.outputDirectory} results in the path to your "target/classes" directory
  • ${project.name}refers to the name of the project (deprecated: ${pom.name} ).
  • ${project.version} refers to the version of the project (deprecated: or ${pom.version}).
  • ${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

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: ${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().

分享到:
评论

相关推荐

    maven window下安装包

    第14章:灵活的构建/14.2 Maven属性的使用/14.2.2 使用注解:Parameter 第14章:灵活的构建/14.2 Maven属性的使用/14.2.3 属性解析/14.2.3.1 打开属性解析 第14章:灵活的构建/14.2 Maven属性的使用/14.2.3 属性解析/...

    java 通过反射获取类上注解,方法上注解,注解里的值及方法参数

    java 通过反射获取类上注解,方法上注解,注解里的值及方法参数,项目为maven项目。导入时记得选择maven项目

    注解+AOP优雅的实现java项目的接口参数校验(含源码)

    基于Spring boot + maven,以注解+AOP方式实现的java后端项目接口参数校验框架。迄今为止使用最简单、最容易理解的参数校验方案。博客地址:https://blog.csdn.net/weixin_42686388/article/details/104009771

    jaxx-maven-plugin-2.8.1.zip

    jewelcli.zip,jewelcli使用带注释的接口定义来自动分析和显示命令行参数

    基于maven项目的SSM框架与layu前端框架的代码

    MyBatis使用简单的XML或注解用于配置和原始映射,将接口和Java的POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记录。可以这么理解,MyBatis是一个用来帮你管理数据增删改查的框架。

    软件仓库:轻量级Maven存储库软件

    厌倦了繁重的Maven存储库软件解决方案,做太多或配置不简单? 我也是。 建造 获取最新的Go,最好是1.12+,然后运行go build 组态 参见config.sample.toml,注释应足以指导您 跑步 直接运行构建的二进制文件,确保...

    利用JAVA注解与反射 - 实现SQL语句自动生成

    编写对应Entity添加相关注解,并通过SqlUtil工具,传入相关参数生成SQL语句 例如:要生成对应数据库Person的SQL增删改查 SqlUtil.create(Person.class) SqlUtil.insert(Person.class) SqlUtil.insert(Person....

    spring-base64-url-decoder:添加 MVC 参数注释和 HandlerMethodArgumentResolver 以启用解码 Base64 编码的 URL 参数

    二进制文件Maven 示例: &lt; dependency&gt; &lt; groupId&gt;de.is24.spring&lt;/ groupId&gt; &lt; artifactId&gt;base64-url-decoder&lt;/ artifactId&gt; &lt; version&gt;1.0&lt;/ version&gt; 用法根据此示例,在 MVC 控制器中使用@DecodedUri注释来注释...

    java8看不到源码-SimpleDefaultMethods:注释处理器为java内部的方法提供默认参数

    这个项目提供了一个注解处理器来为java内部的方法提供默认参数 免责声明 private methods are not supported! 如何使用 由于项目当前未发布到主要 Maven 存储库,请添加: repositories { maven { url " ...

    TypeSafeSQL:一个Maven插件,用于从带注释SQL文件生成Java类

    ## Introduction此Maven插件的目的是从(带注释的)SQL文件自动生成Java类,具有以下优点: 无需直接与JDBC交互。 忘记SQL脚本的参数是编译时错误。 TypeSafeSQL将自动关闭JDBC资源,例如 , , 。 SELECT查询的...

    qdox:QDox-Java类接口方法定义的完整提取器(包括注释,参数,参数名称)

    QDox地位 QDox是一种高速,占用空间小的解析器,用于完全提取类/接口/方法定义(包括注释,参数,参数名称)。 它被设计为供活动代码生成器或文档工具使用。 不再那么相关,但它也处理JavaDoc @tags从Codehaus迁移这...

    基于SSM的人事管理系统,使用Maven进行依赖包控制.zip

    用java写的项目,可用作本科毕业设计,源码都经测试过,能...MyBatis 可以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的 POJOs(Plain Ordinary Java Object,普通的 Java对象)映射成数据库中的记录。

    基于SpringMVC的一个web框架

    工具类数据校验 jsp自定义标签 Spring自定义注解 默认requestMapping 1.1.2 代码生成器 1.1.3 首页修改 dateformat.js 时间参数转换 SpringMVC配置文件集中 快递参数接口 1.1.4 des加解密字符串和文件 1.1.5 redis...

    ClassFinal字节码加密工具-其他

    本工具加密后,原始的class文件并不会完全被加密,只是方法体被清空,保留方法参数、注解等信息,这是为了兼容spring,swagger等扫描注解的框架; 方法体被清空后,反编译者只能看到方法名和注解,看不到方法的具体...

    基于Spring MVC的web框架 1.1.11

    工具类数据校验 jsp自定义标签 Spring自定义注解 默认requestMapping 1.1.2 代码生成器 1.1.3 首页修改 dateformat.js 时间参数转换 SpringMVC配置文件集中 快递参数接口 1.1.4 des加解密字符串和文件 1.1.5 redis...

    一个可以直接运行的基于SpringMVC的web框架1.1.12

    工具类数据校验 jsp自定义标签 Spring自定义注解 默认requestMapping 1.1.2 代码生成器 1.1.3 首页修改 dateformat.js 时间参数转换 SpringMVC配置文件集中 快递参数接口 1.1.4 des加解密字符串和文件 1.1.5 redis...

    可以直接运行的基于SpringMVC的web框架示例,也可以直接当公司框架

    工具类数据校验 jsp自定义标签 Spring自定义注解 默认requestMapping 1.1.2 代码生成器 1.1.3 首页修改 dateformat.js 时间参数转换 SpringMVC配置文件集中 快递参数接口 1.1.4 des加解密字符串和文件 1.1.5 redis...

    SpringMVC基础上的web框架

    工具类数据校验 jsp自定义标签 Spring自定义注解 默认requestMapping 1.1.2 代码生成器 1.1.3 首页修改 dateformat.js 时间参数转换 SpringMVC配置文件集中 快递参数接口 1.1.4 des加解密字符串和文件 1.1.5 redis...

    IDEA安装使用.doc

    创建项目 5.JVM参数配置(64位,内存8G以上) 6.java Web项目创建 7.为java Wbe项目添加第三方依赖 8.配置Maven及使用 9.创建Maven工程 10.Maven创建Java Web工程 11.使用Tomcat插件方式发布项目 12.创建聚合工程 13....

Global site tag (gtag.js) - Google Analytics