tycho-compiler:compile

Full name:

org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile

Description:

Compiles application sources with eclipse plugin dependencies

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: compile.

Optional Parameters

Name Type Since Description
annotationProcessors String[] 0.16.0 Qualified class names of annotation processors to run. If specified, the normal processor discovery process will be skipped. This parameter requires a 1.6 VM or above and is used only if the compliance is 1.6
compilerArgs List 0.17.0 Arguments to be passed to the compiler.
compilerArgument String -

Unformatted argument string to be passed to the compiler if fork is set to true.

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


compilerArguments Map - Deprecated. use compilerArgs instead.
compilerId String - The compiler id of the compiler to use.
Default value is: jdt.
User property is: maven.compiler.compilerId.
compilerVersion String - Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true
User property is: maven.compiler.compilerVersion.
copyResources boolean - Whether all resources in the source folders should be copied to ${project.build.outputDirectory}. true (default) means that all resources are copied from the source folders to ${project.build.outputDirectory}. false means that no resources are copied from the source folders to ${project.build.outputDirectory}. Set this to false in case you want to keep resources separate from java files in src/main/resources and handle them using maven-resources-plugin (e.g. for resource filtering.
Default value is: true.
debug boolean - Whether to include debugging information in the compiled class files. The default value is true.
Default value is: true.
User property is: maven.compiler.debug.
encoding String - The -encoding argument for the Java compiler
User property is: project.build.sourceEncoding.
excludeResources Set - A list of exclusion filters for non-java resource files which should not be copied to the output directory.
excludes Set - A list of exclusion filters for the compiler.
executable String - The executable of the compiler to use when fork is true.
User property is: maven.compiler.executable.
extraClasspathElements Dependency[] - Transitively add specified maven artifacts to compile classpath in addition to elements calculated according to OSGi rules. All packages from additional entries will be accessible at compile time. Useful when OSGi runtime classpath contains elements not defined using normal dependency mechanisms. For example, when Eclipse Equinox is started from application server with -Dosgi.parentClassloader=fwk parameter.
fork boolean - 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 is: false.
generatedSourcesDirectory File 0.16.0 The directory where source files generated by annotation processors will be created. This parameter requires a 1.6 VM or above and is used only if the compliance is 1.6.
Default value is: ${project.build.directory}/generated-sources/annotations.
includes Set - A list of inclusion filters for the compiler.
maxmem String - maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if fork is set to true
User property is: maven.compiler.maxmem.
meminitial String - Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if fork is set to true
User property is: maven.compiler.meminitial.
optimize boolean - Optimize compiled code using the compiler's optimization methods
Default value is: false.
User property is: maven.compiler.optimize.
outputFileName String - Used to control the name of the output file when compiling a set of sources to a single file.
User property is: project.build.finalName.
proc String 0.16.0 If only is specified, the annotation processors will run but no compilation will be performed. If none is specified, annotation processors will not be discovered or run; compilation will proceed as if no annotation processors were found. By default the compiler must search the classpath for annotation processors, so specifying none may speed compilation if annotation processing is not required. This parameter requires a 1.6 VM or above and is used only if the compliance is 1.6
requireJREPackageImports boolean - Whether a bundle is required to explicitly import non-java.* packages from the JDK. This is the design-time equivalent to the equinox runtime option osgi.compatibility.bootdelegation.
Default value is: false.
showDeprecation boolean - Output source locations where deprecated APIs are used
Default value is: false.
User property is: maven.compiler.showDeprecation.
showWarnings boolean - Output warnings
Default value is: false.
User property is: maven.compiler.showWarnings.
source String - The -source argument for the Java compiler
User property is: maven.compiler.source.
staleMillis int - The granularity in milliseconds of the last modification date for testing whether a source needs recompilation
Default value is: 0.
User property is: lastModGranularityMs.
strictCompilerTarget boolean - If set to false (the default) issue a warning if effective compiler target level is incompatible with bundle minimal execution environment. If set to true will fail the build if effective compiler target and minimal BREE are incompatible.
Default value is: false.
target String - The -target argument for the Java compiler
User property is: maven.compiler.target.
useJDK ToolchainProvider$JDKUsage - Which JDK to use for compilation. Default value is SYSTEM which means the currently running JDK. If BREE is specified, MANIFEST header Bundle-RequiredExecutionEnvironment is used to define the JDK to compile against. In this case, you need to provide a toolchains.xml configuration file. The value of BREE will be matched against the id of the toolchain elements in toolchains.xml. Example:
<toolchains>
  <toolchain>
     <type>jdk</type>
     <provides>
         <id>J2SE-1.5</id>
     </provides>
     <configuration>
        <jdkHome>/path/to/jdk/1.5</jdkHome>
     </configuration>
  </toolchain>
</toolchains>
The default value of the bootclasspath used for compilation is <jdkHome>/lib/*;<jdkHome>/lib/ext/*;<jdkHome>/lib/endorsed/* . For JDKs with different filesystem layouts, the bootclasspath can be specified explicitly in the configuration section. Example:
<configuration>
  <jdkHome>/path/to/jdk/1.5</jdkHome>
  <bootClassPath>
    <includes>
      <include>jre/lib/amd64/default/jclSC160/*.jar</include>
    </includes>
    <excludes>
      <exclude>**/alt-*.jar</exclude>
    </excludes>
  </bootClassPath>
</configuration>

Default value is: SYSTEM.
useProjectSettings boolean - If set to true, the settings file ${project.basedir}/.settings/org.eclipse.jdt.core.prefs will be passed to the compiler. If the file is not present, the build will not fail.
Default value is: false.
verbose boolean - Whether to output messages about what the compiler is doing
Default value is: false.
User property is: maven.compiler.verbose.

Parameter Details

annotationProcessors:

Qualified class names of annotation processors to run. If specified, the normal processor discovery process will be skipped. This parameter requires a 1.6 VM or above and is used only if the compliance is 1.6
  • Type: java.lang.String[]
  • Since: 0.16.0
  • Required: No

compilerArgs:

Arguments to be passed to the compiler.
  • Type: java.util.List
  • Since: 0.17.0
  • Required: No

compilerArgument:

Unformatted argument string to be passed to the compiler if fork is set to true.

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

  • Type: java.lang.String
  • Required: No

compilerArguments:

Deprecated. use compilerArgs instead.

Arguments to be passed to the compiler (prepending a dash) if fork is set to true.

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

  • Type: java.util.Map
  • Required: No

compilerId:

The compiler id of the compiler to use.
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.compilerId
  • Default: jdt

compilerVersion:

Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.compilerVersion

copyResources:

Whether all resources in the source folders should be copied to ${project.build.outputDirectory}. true (default) means that all resources are copied from the source folders to ${project.build.outputDirectory}. false means that no resources are copied from the source folders to ${project.build.outputDirectory}. Set this to false in case you want to keep resources separate from java files in src/main/resources and handle them using maven-resources-plugin (e.g. for resource filtering.
  • Type: boolean
  • Required: No
  • Default: true

debug:

Whether to include debugging information in the compiled class files. The default value is true.
  • Type: boolean
  • Required: No
  • User Property: maven.compiler.debug
  • Default: true

encoding:

The -encoding argument for the Java compiler
  • Type: java.lang.String
  • Required: No
  • User Property: project.build.sourceEncoding

excludeResources:

A list of exclusion filters for non-java resource files which should not be copied to the output directory.
  • Type: java.util.Set
  • Required: No

excludes:

A list of exclusion filters for the compiler.
  • Type: java.util.Set
  • Required: No

executable:

The executable of the compiler to use when fork is true.
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.executable

extraClasspathElements:

Transitively add specified maven artifacts to compile classpath in addition to elements calculated according to OSGi rules. All packages from additional entries will be accessible at compile time. Useful when OSGi runtime classpath contains elements not defined using normal dependency mechanisms. For example, when Eclipse Equinox is started from application server with -Dosgi.parentClassloader=fwk parameter.
  • Type: org.apache.maven.model.Dependency[]
  • Required: No

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.
  • Type: boolean
  • Required: No
  • Default: false

generatedSourcesDirectory:

The directory where source files generated by annotation processors will be created. This parameter requires a 1.6 VM or above and is used only if the compliance is 1.6.
  • Type: java.io.File
  • Since: 0.16.0
  • Required: No
  • Default: ${project.build.directory}/generated-sources/annotations

includes:

A list of inclusion filters for the compiler.
  • Type: java.util.Set
  • Required: No

maxmem:

maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" if fork is set to true
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.maxmem

meminitial:

Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" if fork is set to true
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.meminitial

optimize:

Optimize compiled code using the compiler's optimization methods
  • Type: boolean
  • Required: No
  • User Property: maven.compiler.optimize
  • Default: false

outputFileName:

Used to control the name of the output file when compiling a set of sources to a single file.
  • Type: java.lang.String
  • Required: No
  • User Property: project.build.finalName

proc:

If only is specified, the annotation processors will run but no compilation will be performed. If none is specified, annotation processors will not be discovered or run; compilation will proceed as if no annotation processors were found. By default the compiler must search the classpath for annotation processors, so specifying none may speed compilation if annotation processing is not required. This parameter requires a 1.6 VM or above and is used only if the compliance is 1.6
  • Type: java.lang.String
  • Since: 0.16.0
  • Required: No

requireJREPackageImports:

Whether a bundle is required to explicitly import non-java.* packages from the JDK. This is the design-time equivalent to the equinox runtime option osgi.compatibility.bootdelegation.
  • Type: boolean
  • Required: No
  • Default: false

showDeprecation:

Output source locations where deprecated APIs are used
  • Type: boolean
  • Required: No
  • User Property: maven.compiler.showDeprecation
  • Default: false

showWarnings:

Output warnings
  • Type: boolean
  • Required: No
  • User Property: maven.compiler.showWarnings
  • Default: false

source:

The -source argument for the Java compiler
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.source

staleMillis:

The granularity in milliseconds of the last modification date for testing whether a source needs recompilation
  • Type: int
  • Required: No
  • User Property: lastModGranularityMs
  • Default: 0

strictCompilerTarget:

If set to false (the default) issue a warning if effective compiler target level is incompatible with bundle minimal execution environment. If set to true will fail the build if effective compiler target and minimal BREE are incompatible.
  • Type: boolean
  • Required: No
  • Default: false

target:

The -target argument for the Java compiler
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.target

useJDK:

Which JDK to use for compilation. Default value is SYSTEM which means the currently running JDK. If BREE is specified, MANIFEST header Bundle-RequiredExecutionEnvironment is used to define the JDK to compile against. In this case, you need to provide a toolchains.xml configuration file. The value of BREE will be matched against the id of the toolchain elements in toolchains.xml. Example:
<toolchains>
  <toolchain>
     <type>jdk</type>
     <provides>
         <id>J2SE-1.5</id>
     </provides>
     <configuration>
        <jdkHome>/path/to/jdk/1.5</jdkHome>
     </configuration>
  </toolchain>
</toolchains>
The default value of the bootclasspath used for compilation is <jdkHome>/lib/*;<jdkHome>/lib/ext/*;<jdkHome>/lib/endorsed/* . For JDKs with different filesystem layouts, the bootclasspath can be specified explicitly in the configuration section. Example:
<configuration>
  <jdkHome>/path/to/jdk/1.5</jdkHome>
  <bootClassPath>
    <includes>
      <include>jre/lib/amd64/default/jclSC160/*.jar</include>
    </includes>
    <excludes>
      <exclude>**/alt-*.jar</exclude>
    </excludes>
  </bootClassPath>
</configuration>
  • Type: org.eclipse.tycho.core.maven.ToolchainProvider$JDKUsage
  • Required: No
  • Default: SYSTEM

useProjectSettings:

If set to true, the settings file ${project.basedir}/.settings/org.eclipse.jdt.core.prefs will be passed to the compiler. If the file is not present, the build will not fail.
  • Type: boolean
  • Required: No
  • Default: false

verbose:

Whether to output messages about what the compiler is doing
  • Type: boolean
  • Required: No
  • User Property: maven.compiler.verbose
  • Default: false