Apache Ant 1.8 0



Contents

Installed Programs:ant, antRun, antRun.pl, complete-ant-cmd.pl, runant.pl, and runant.py

Note: There is a new version for this artifact. New Version: 1.10.9: Maven; Gradle; SBT; Ivy; Grape; Leiningen; Buildr. Method 2: Install Apache Ant from Apt repository. Apache Ant package is available on both Debian and Ubuntu upstream repositories. With this method, you won’t get the latest release of Apache Ant. Install it by running the commands: sudo apt update sudo apt -y install ant. Once the package is installed, you can check for version using: $ ant. JAVAHOME « C: Program Files (x86) Java jdk1.8.066 ANTHOME « D: Apache apache-ant-1.9.4 MAVENHOME « D: Apache apache-maven-3.3.9 PATH « To check Underlying OS for required commands like java.exe, javac.exe, ant.bat, mvn.cmd.

Installed Libraries:ant.jar, ant-*.jar, xercesImpl.jar, and xml-apis.jar

Short Descriptions

ant

is a Java based build tool used by many packages instead of the conventional make program.

antRun

is a support script used to start ant build scripts in a given directory.

antRun.pl

is a Perl script that provides similar functionality offered by the antRun script.

complete-ant-cmd.pl

is a Perl script that allows Bash to complete an ant command-line.

runant.pl

is a Perl wrapper script used to invoke ant.

runant.py

is a Python wrapper script used to invoke ant.

ant-*.jar

files are the Apache AntJava class libraries.

xercesImpl.jar

is a Java class library used by Apache Ant to perform XML parsing.

xml-apis.jar

contains the DOM Java classes required by the Apache Ant XML formatter.

Home » Documentation » Apache Felix Maven SCR Plugin

The SCR Ant Task is implemented in the org.apache.felix.scr.ant library which must be registered as an Ant Task in the build file as follows:

Of course the value you set in the classpath attribute depends on the actual location of the org.apache.felix.scr.ant JAR file.

Apache Ant 1.8.1

The SCR Ant Task is available for download from the Apache Felix Downloads page.

Notes:

  • The name of the task is scr
  • The task requires that the source files have already been compiled

The task only generates the descriptor file(s). If you want to use the Declarative Services descriptor -- by default generated in the OSGI-INF/serviceComponents.xml -- you must make sure to add a Service-Components header to your bundle manifest. Unlike Maven plugin the Ant task cannot automatically generate this header.

Task Attributes¶

Apache Ant 1.8 0

Like the standard javac Ant Task, the SCR Ant Task defines an implicit fileset which defines the source files to be scanned for Java 5 Annotations or JavaDoc Tags. In addition to the child elements available to Ant Fileset as defined for directory-based tasks the following task attributes are supported:

scrdir
Required: Yes
Default --
The root directory of the implicitly defined fileset denoting the files to consider for annotation and/or JavaDoc tag processing.

destdir
Required: Yes
Default: --
The name of the directory where the descriptor files are generated into. This is also used as the directory where the compiled classes from the srcdir may be located. This directory is actually added as another element to the classpath as defined by classpath and classpathRef.

classpath
Required: No
Default: --
The class path used to load classes from to analyse for the descriptor file generation. Generally this will be the same class path as the one used to compile the sources.

classpathRef
Required: No
Default: --
A reference to a class path used to load classes from to analyse for the descriptor file generation. Generally this will be the same class path as the one used to compile the sources.

finalName
Required: No
Default: serviceComponents.xml
The name of the descriptor file to create. This file is always located inside the OSGI-INF folder in the destdir.

Apache-ant-1.8.1

metaTypeName
Required: No
Default: metatype.xml
The name of the descriptor file to create. This file is always located inside the OSGI-INF/metatype folder in the destdir.

generateAccessors
Required: No
Default: true
If this switch is turned on, the bind and unbind methods for unary references are automatically generated by the plugin.

annotationTagProviders
Required: No
Default: --
List of fully qualified class names providing more Annotation Tag Providers. As of version 1.4.0 of the SCR Annotations library this configuration element is optional if the SCR Annotations library comes with a proper SPI setup (see Extending SCR Annotations)

specVersion
Required: No
Default: Auto-Detected
The plugin will generate a descriptor for the Declarative Service version (e.g. 1.0, 1.1, or 1.2). If no value is specified, the plugin will detect the version and only use 1.1 if features from this version are used.

strictMode
Required: No
Default: false
If set to true, a warning will be considered as an error and the build will fail with warnings generated by this task.

parseJavadoc
Required: No
Default: true
If set to true, JavaDoc based annotations will be processed.

processAnnotations
Required: No
Default: true
If set to true, SCR annotations will be processed

The scr task must be provided with the same class path as was used to compile the sources. The classes in the class path are used by the task to be able to load compiled classes (mostly for Java 5 annotation processing) and any base classes, which may be extended. The easiest way to share the class path is to define a class path property and refer to it with the classpathref attribute of the scr task.

Using JavaDoc Tags¶

Apache-ant-1.8.2

Apache Ant 1.8 0 Download

JavaDoc tags are supported natively by the SCR Ant Task. No further configuration and/or libraries are needed.

Java 5 Annotations¶

To use Java 5 Annotations make sure the library defining the annotations is available on the class path for both the compilation in the javac task and for generating the descriptor in the scr task.

Apache Ant 1.8.2

No further configuration is required as the SCR Ant Task automatically recognizes SCR Annotation definitions from libraries in the class path provided the annotations are provided in a JAR library with properly setup SPI configuration as documented in Extending SCR Annotations.

Example¶

The following is very simple example build file based on the Apache Sling JCR WebConsole bundle:

Rev. 1509570 by cziegeler on Fri, 2 Aug 2013 07:24:35 +0000
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.