maven compile插件

熟悉一个东西最全的方式莫过于官网文档(前提是官网有相关介绍并且版面布局OK大笑),相信不少小伙伴也遇到过跟我类似的问题,想使用一个插件但是去官网一看要不没有说明要不板书不堪入目,幸运的是maven官网文档还挺OK,maven是现在使用比较广的一个项目管理工具,还有两个使用比较广的就是ant以及gradle。

Name Type Since Description
annotationProcessorPaths List 2.0

Classpath elements to supply as annotation processor path. If specified, the compiler will detect annotation processors only in those classpath elements. If omitted, the default classpath is used to detect annotation processors. The detection itself depends on the configuration of annotationProcessors.

Each classpath element is specified using their Maven coordinates (groupId, artifactId, version, classifier, type). Transitive dependencies are added automatically. Example:

<configuration>
  <annotationProcessorPaths>
    <path>
      <groupId>org.sample</groupId>
      <artifactId>sample-annotation-processor</artifactId>
      <version>1.2.3</version>
    </path>
    <!-- ... more ... -->
  </annotationProcessorPaths>
</configuration>
annotationProcessors String[] 2.0

Names of annotation processors to run. Only applies to JDK 1.6+ If not set, the default annotation processors discovery process applies.

compilerArgs List 2.0

Sets the arguments to be passed to the compiler if fork is set to true. Example:

<compilerArgs>
  <arg>-Xmaxerrs=1000</arg>
  <arg>-Xlint</arg>
  <arg>-J-Duser.language=en_us</arg>
</compilerArgs>
compilerArgument String 2.0

Sets the unformatted single argument string to be passed to the compiler if fork is set to true. To pass multiple arguments such as -Xmaxerrs 1000 (which are actually two arguments) you have to use compilerArguments.

This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.

compilerArguments Map 2.0 Deprecated. use compilerArgs instead.
compilerId String 2.0 The compiler id of the compiler to use. See this guide for more information.
Default value isjavac.
User property ismaven.compiler.compilerId.
compilerReuseStrategy String 2.0 Strategy to re use javacc class created:
  • reuseCreated (default): will reuse already created but in case of multi-threaded builds, each thread will have its own instance
  • reuseSame: the same Javacc class will be used for each compilation even for multi-threaded build
  • alwaysNew: a new Javacc class will be created for each compilation
Note this parameter value depends on the os/jdk you are using, but the default value should work on most of env.
Default value is${reuseCreated}.
User property ismaven.compiler.compilerReuseStrategy.
compilerVersion String 2.0 Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true.
User property ismaven.compiler.compilerVersion.
debug boolean 2.0 Set to true to include debugging information in the compiled class files.
Default value istrue.
User property ismaven.compiler.debug.
debuglevel String 2.0 Keyword list to be appended to the -g command-line switch. Legal values are none or a comma-separated list of the following keywords: linesvars, and source. If debug level is not specified, by default, nothing will be appended to -g. If debug is not turned on, this attribute will be ignored.
User property ismaven.compiler.debuglevel.
encoding String 2.0 The -encoding argument for the Java compiler.
Default value is${project.build.sourceEncoding}.
User property isencoding.
excludes Set 2.0 A list of exclusion filters for the compiler.
executable String 2.0 Sets the executable of the compiler to use when fork is true.
User property ismaven.compiler.executable.
failOnError boolean 2.0 Indicates whether the build will continue even if there are compilation errors.
Default value istrue.
User property ismaven.compiler.failOnError.
failOnWarning boolean 2.0 Indicates whether the build will continue even if there are compilation warnings.
Default value isfalse.
User property ismaven.compiler.failOnWarning.
fileExtensions List 2.0 file extensions to check timestamp for incremental build default contains only .class
forceJavacCompilerUse boolean 2.0 compiler can now use javax.tools if available in your current jdk, you can disable this feature using -Dmaven.compiler.forceJavacCompilerUse=true or in the plugin configuration
Default value isfalse.
User property ismaven.compiler.forceJavacCompilerUse.
fork boolean 2.0 Allows running the compiler in a separate process. If false it uses the built in compiler, while if true it will use an executable.
Default value isfalse.
User property ismaven.compiler.fork.
generatedSourcesDirectory File 2.0

Specify where to place generated source files created by annotation processing. Only applies to JDK 1.6+


Default value is${project.build.directory}/generated-sources/annotations.
includes Set 2.0 A list of inclusion filters for the compiler.
jdkToolchain Map 2.0

Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the maven-toolchain-plugin.

note: requires at least Maven 3.3.1
maxmem String 2.0 Sets the maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if fork is set to true.
User property ismaven.compiler.maxmem.
meminitial String 2.0 Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if fork is set to true.
User property ismaven.compiler.meminitial.
optimize boolean 2.0 Set to true to optimize the compiled code using the compiler's optimization methods.
Default value isfalse.
User property ismaven.compiler.optimize.
outputFileName String 2.0 默认输出文件名是"${project.build.finalName}"
proc String 2.0

Sets whether annotation processing is performed or not. Only applies to JDK 1.6+ If not set, both compilation and annotation processing are performed at the same time.

Allowed values are:

  • none - no annotation processing is performed.
  • only - only annotation processing is done, no compilation.
release String 2.0 The -release argument for the Java compiler, supported since Java9
User property ismaven.compiler.release.
showDeprecation boolean 2.0 Sets whether to show source locations where deprecated APIs are used.
Default value isfalse.
User property ismaven.compiler.showDeprecation.
showWarnings boolean 2.0 Set to true to show compilation warnings.
Default value isfalse.
User property ismaven.compiler.showWarnings.
skipMain boolean 2.0 Set this to 'true' to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on occasion.
User property ismaven.main.skip.
skipMultiThreadWarning boolean 2.0 (no description)
Default value isfalse.
User property ismaven.compiler.skipMultiThreadWarning.
source String 2.0 The -source argument for the Java compiler.
Default value is1.5.
User property ismaven.compiler.source.
staleMillis int 2.0 Sets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
Default value is0.
User property islastModGranularityMs.
target String 2.0 The -target argument for the Java compiler.
Default value is1.5.
User property ismaven.compiler.target.
useIncrementalCompilation boolean 2.0 to enable/disable incrementation compilation feature
Default value istrue.
User property ismaven.compiler.useIncrementalCompilation.
verbose boolean 2.0 Set to true to show messages about what the compiler is doing.
Default value isfalse.
User property ismaven.compiler.verbose.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1.[今日课程内容总览] Maven--***** 介绍 优点 用maven创建一个项目, 用maven创建一个ssm项目,每一层的代码分开,把一个项目拆解成多个项目 2.[今日包含笔记] maven介绍: Eclise: 缺点: Jar包: 版本管理,解决jar包冲突:删除老的jar包,保留新的jar包 不同的项目,jar包要复制一份;Users Library 羡慕yum的好处,安装软件,自动下载,自动验证,自动安装,自动测试;镜像网站 Jar包的依赖: 致命的缺点:现象: 每一个项目都有前台(广大网民)和后台(管理员看的),后台的功能远远的大于>前台的功能;迭代升级;每次升级都要重启tomcat;将tomcat做很多个备份(10个),为了nginx转发;前台:访问比较大,管理员访问量比较小; 问题: 每次升级,10个tomcat都升级一次 后台的升级频繁要比前台频繁;升级10次,9次改的是后台的代码,只有一次是前台的代码 解决方案: 是将前台(广大网民看的页面)的代码和后台(管理员)的代码要分开,将原来的一个项目分别放到两个web项目;一个web项目一个tomcat;好处:更新的时候如果更新后台(管理员),只需要重启后台的tomcat(服务); 折成两个项目以后的缺点:Service以下的代码重复; 将Service层以下的代码放到一个新创建的java项目中,在部署的时候将Service(java项目)打成一个jar包,分别放到两个web服务中;编译的时候让web项目依赖与Service(java项目)_source folder;配置麻烦,项目与项目之间的依赖头脑得相当清晰 这个缺点Maven解决了; 请听今天的内容 拆分前:图一 拆分后是图二 3. 介绍 官网:http://maven.apache.org/download.cgi 目录介绍: Bin:二进制文件 Boot:引导,启动 Conf:配置文件 Lib:jar包 README.txt:读我 3.1.修改配置文件的内容 路径:%MAVEN_HOME%\conf\settings.xml 配置文件代码: d:/repo alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central 注意: 千万不要将文档中的setting的内容全部替换到maven中的内容,要对比着修改,保留原来的; 只修改本地仓库,和下载镜像(源) 3.2.Eclipse Maven的配置 每打开一个新的工作空间,要配置一下Maven,然后再写代码 3.3.创建Maven项目 右击创建一个maven project Packing:有三种: Jar:java项目, War:web项目 Pom:文件夹,jar和war文件,mavenProject:一个项目,可以放jar和war包,通过pom,一般新创建的maven Project是POM 3.4.创建一个Maven Model 最外面的项目是MavenProject,其它的全部是Maven Model 3.4.1.创建JAR 目录介绍: Mvn-jar |-->Src:源码:java代码 |-->|-->main:代码:除测试以外的代码:junit |-->|-->main|-->java:代码 |-->|-->main|--

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值