A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html below:

Apache Maven Compiler Plugin – compiler:compile

Compiles application sources. By default uses the javac compiler of the JDK used to execute Maven. This can be overwritten through Toolchains or parameter compilerId.
See also: javac Command

Parameter Details <annotationProcessorPaths>

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. Exclusions are supported as well. Example:

<configuration>
  <annotationProcessorPaths>
    <path>
      <groupId>org.sample</groupId>
      <artifactId>sample-annotation-processor</artifactId>
      <version>1.2.3</version> <!-- Optional - taken from dependency management if not specified -->
      <!-- Optionally exclude transitive dependencies -->
      <exclusions>
        <exclusion>
          <groupId>org.sample</groupId>
          <artifactId>sample-dependency</artifactId>
        </exclusion>
      </exclusions>
    </path>
    <!-- ... more ... -->
  </annotationProcessorPaths>
</configuration>
Note:

Exclusions are supported from version 3.11.0.


See also: javac -processorpath

,

javac Annotation Processing <annotationProcessorPathsUseDepMgmt>

Whether to use the Maven dependency management section when resolving transitive dependencies of annotation processor paths.

This flag does not enable / disable the ability to resolve the version of annotation processor paths from dependency management section. It only influences the resolution of transitive dependencies of those top-level paths.

<annotationProcessors> <compileSourceRoots>

The source directories containing the sources to be compiled.

<compilerArgs>

Sets the arguments to be passed to the compiler.

Note that -J options are only passed through if fork is set to true.

Example:

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

See also: javac -J <compilerArgument>

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

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

Note that -J options are only passed through if fork is set to true.


See also: javac -J <compilerArguments>

Sets the arguments to be passed to the compiler (prepending a dash).

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

Note that -J options are only passed through if fork is set to true.

To pass -Xmaxerrs 1000 -Xlint -Xlint:-path -Averbose=true you should include the following:

<compilerArguments>
  <Xmaxerrs>1000</Xmaxerrs>
  <Xlint/>
  <Xlint:-path/>
  <Averbose>true</Averbose>
</compilerArguments>
<compilerId>

The compiler id of the compiler to use. See this

guide

for more information.

<compilerReuseStrategy>

Strategy to re use javacc class created:

Note this parameter value depends on the os/jdk you are using, but the default value should work on most of env.

<compilerVersion>

Deprecated.
This parameter is no longer evaluated by the underlying compilers, instead the actual version of the javac binary is automatically retrieved.


Version of the compiler to use, ex. "1.3", "1.5", if

fork

is set to

true

.

<createMissingPackageInfoClass>

Package info source files that only contain javadoc and no annotation on the package can lead to no class file being generated by the compiler. This causes a file miss on the next compilations and forces an unnecessary recompilation. The default value of true causes an empty class file to be generated. This behavior can be changed by setting this parameter to false.

<debug>

Set to

true

to include debugging information in the compiled class files.


See also: javac -g

,

debuglevel <debugFileName>

When both

fork

and

debug

are enabled the commandline arguments used will be dumped to this file.

<debuglevel>

Keyword list to be appended to the

-g

command-line switch. Legal values are none or a comma-separated list of the following keywords:

lines

,

vars

, 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.


See also: javac -G:[lines,vars,source] <enablePreview> <encoding> <excludes>

A list of exclusion filters for the compiler.

<executable>

Sets the executable of the compiler to use when

fork

is

true

.

<failOnError>

Indicates whether the build will continue even if there are compilation errors.

<failOnWarning>

Indicates whether the build will continue even if there are compilation warnings.

<fileExtensions>

File extensions to check timestamp for incremental build.

<forceJavacCompilerUse>
<forceLegacyJavacApi> <fork>

Allows running the compiler in a separate process. If false it uses the built in compiler, while if true it will use an executable.

<generatedSourcesDirectory>

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

<implicit>

Keyword to be appended to the

-implicit:

command-line switch.


See also: javac -implicit <includes>

A list of inclusion filters for the compiler.

<incrementalExcludes>

A list of exclusion filters for the incremental calculation.

<jdkToolchain>

Specify the requirements for this jdk toolchain for using a different javac than the one of the JRE used by Maven. This overrules the toolchain selected by the maven-toolchain-plugin.

(see

Guide to Toolchains

for more info)

<configuration>
  <jdkToolchain>
    <version>11</version>
  </jdkToolchain>
  ...
</configuration>

<configuration>
  <jdkToolchain>
    <version>1.8</version>
    <vendor>zulu</vendor>
  </jdkToolchain>
  ...
</configuration>
note:

requires at least Maven 3.3.1

<maxmem>

Sets the maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if

fork

is set to

true

.

<meminitial>

Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if

fork

is set to

true

.

<moduleVersion>

The

--module-version

argument for the Java compiler. This is ignored if not applicable, e.g., in non-modular projects.


See also: javac --module-version <multiReleaseOutput>

When set to true, the classes will be placed in META-INF/versions/${release} The release value must be set, otherwise the plugin will fail.

Note:

A jar is only a multirelease jar if

META-INF/MANIFEST.MF

contains

Multi-Release: true

. You need to set this by configuring the

maven-jar-plugin

. This implies that you cannot test a multirelease jar using the outputDirectory.

<optimize>

Deprecated.
This property is a no-op in javac.

Set to true to optimize the compiled code using the compiler's optimization methods.

<outputDirectory>

The directory for compiled classes.

This parameter should only be modified in special cases. One example is creating a multi-release jar with a lower bytecode level (i.e. setting it to ${project.build.outputDirectory/META-INF/versions/21} or similar) in an additional execution.

When the required bytecode level is available though an installed JDK or toolchain, it is recommended to use the <release> property in conjunction with the ${multiReleaseOutput} parameter instead.

<outputFileName>

Sets the name of the output file when compiling a set of sources to a single file.

expression="${project.build.finalName}"

<outputTimestamp>

Timestamp for reproducible output archive entries, either formatted as ISO 8601

yyyy-MM-dd'T'HH:mm:ssXXX

or as an int representing seconds since the epoch (like

SOURCE_DATE_EPOCH

).

<parameters>

Set to

true

to generate metadata for reflection on method parameters.


See also: javac -parameters <proc>

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:

full

is the default. Starting with JDK 21, this option must be set explicitly.


See also: javac -proc

,

javac Annotation Processing <release>

The

-release

argument for the Java compiler, supported since Java9


See also: javac -release <showCompilationChanges>

No description.

<showDeprecation>

Sets whether to show source locations where deprecated APIs are used.

<showWarnings>

Set to false to disable warnings during compilation.

<skipMain>

Set this to true to bypass compilation of main sources. Its use is NOT RECOMMENDED, but quite convenient on occasion.

<skipMultiThreadWarning>

No description.

<source>

The -source argument for the Java compiler.

NOTE:

Since 3.8.0 the default value has changed from 1.5 to 1.6

Since 3.9.0 the default value has changed from 1.6 to 1.7

Since 3.11.0 the default value has changed from 1.7 to 1.8


See also: javac -source <staleMillis>

Sets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.

<target>

The -target argument for the Java compiler.

NOTE:

Since 3.8.0 the default value has changed from 1.5 to 1.6

Since 3.9.0 the default value has changed from 1.6 to 1.7

Since 3.11.0 the default value has changed from 1.7 to 1.8


See also: javac -target <useIncrementalCompilation>

to enable/disable incremental compilation feature.

This leads to two different modes depending on the underlying compiler. The default javac compiler does the following:

<verbose>

Set to

true

to show messages about what the compiler is doing.


See also: javac -verbose

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4