GOM : Project
project
A project is the atomic unit of integration. It can describe an installable package or a buildable product. The nested elements of a project definition fall into three different "groups", each optional:
-
Build instructions:
<ant>, <nant>, <mvn1>, <mvn2>, <mvn3>,
<gradle>, <script>, <configure>, <make> and <msbuild>.
Describes how to produce the outputs from the inputs. See also <delete> and <mkdir> below. - Inputs: <depend>, <option>, and <work>. Describes where to find the inputs (primarily jar files, but can be directories and files).
- Outputs: <home>, <license>, <output>, <jar> and <pom>. Describes where to locate the output files.
Attribute | Description | Required? |
---|---|---|
name | The name of the project. | Yes |
target | Override the ant target to be used. | No |
buildfile | Override the ant build file to be used. | No |
basedir | Override the base directory used for the ant build file. | No |
vm | Override the Java Virtual Machine version expected to be used. | No |
groupId | mvn groupId for artifacts built by this project. | No, inherits the value from the containing module. |
Inputs
depend
Specifies the name of a required prerequisite project. If a definition for that project is not found in the workspace, the generation will fail.
For a build "all", the invocation of ant or the script is bypassed if any of the outputs of the specified project can not be found.
For both script and ant based builds, any jars defined by the specified project as outputs are added to the CLASSPATH prior to invoking the build operation, unless you nest a <noclasspath> element into the <depend> element.
Attribute | Description | Required? |
---|---|---|
project | The name of the project depended on. | Yes |
inherit | Specifies whether dependendencies of this dependency are to be inherited. Default is "none". Other choices are "all" which will copy all dependencies as, "runtime" which will only copy the runtime dependencies, and "hard" which will not only copy all dependencies, but will also convert option elements into depend elements in the process, and "jars" which will actually copy the dependent jars into the list of jars exported by this project. | No |
runtime | Specifies whether this dependency is needed at runtime. Choices are "true" and "false" with the default being false. | No |
ids | Space separated list of ids for the jars this project depends on. Can be used if only a subset of all jars is needed. If ommitted, all jars of the referenced project will be used. | No |
option
Specifies the name of an optional prerequisite project. If a definition for that project is not found in the workspace, the dependency is ignored.
For both script and ant based builds, any jars defined by the specified project as outputs are added to the CLASSPATH prior to invoking the build operation, unless you nest a <noclasspath> element into the <option> element. If the files are not present, this will have little effect.
Attribute | Description | Required? |
---|---|---|
project | The name of the project depended on. | Yes |
inherit | Specifies whether dependendencies of this dependency are to be inherited. Default is "none". Other choices are "all" which will copy all dependencies as, "runtime" which will only copy the runtime dependencies, and "hard" which will not only copy all dependencies, but will also convert option elements into depend elements in the process. | No |
runtime | Specifies whether this dependency is needed at runtime. Choices are "true" and "false" with the default being false. | No |
ids | Space separated list of ids for the jars this project depends on. Can be used if only a subset of all jars is needed. If ommitted, all jars of the referenced project will be used. | No |
work
Adds a directory or a file to the class path. This is to allow projects which have compilation dependencies on byproducts of the build (e.g., tests which import the project itself). This is necessary when using the Ant build.sysclasspath="ignore".
If the directory is not present prior to the build, some VMs may drop it from the CLASSPATH. If this happens, use a <mkdir> element to create it before building the project.
If this directory is deleted during the course of the build, the behavior of the JVM may become unpredictable. The same is true if the element points to a jar file and that file is modified during the build.
If neither the parent nor the nested attributes are present, then the srcdir for the module is added to the classpath.
Note that the entries specified by <work> elements are prepended to the class path. If a class can be found both in a <work> entry and a jar refered to by <depend>, the one from the <work> entry will be loaded.
Attribute | Description | Required? |
---|---|---|
parent | Name of a directory or file, relative to the base directory of the workspace. | No |
nested | Name of a directory or file, relative to the srcdir of the module containing this project. | No |
Outputs
home
The home directory for a project is the directory which contains the files referenceable by another project. In many cases, it is possible for another project element by the same name (see the overview) to extend a project definition for an installable package in such a way that the result actually builds the project.
A home attribute on a project definition will override this value.
A package attribute on a project will provide a default for this value. Such a default would be relative to the workspace pkgdir
If none of these attributes or elements, the default value is the srcdir for the module.
Attribute | Description | Required? |
---|---|---|
parent | Name of a directory or file, relative to the base directory of the workspace. | No |
nested | Name of a directory or file, relative to the srcdir of the module containing this project. | No |
license
The filename of the license, relative to the src directory. This file will accompany any redistributable jars.
Attribute | Description | Required? |
---|---|---|
name | The filename of the license file | Yes |
output
The name of something a project creates. This is a generic element and there are specialized elements for jars and POMs for example.
Each output must have a type attribute and may have an id attribute. ids must be unique among all outputs of the same type.
Attribute | Description | Required? |
---|---|---|
name | The file name of the output. May contain shell glob patterns (*, ? or ranges like [a-z]) in which case the pattern must match exactly one existing file. The path is relative to the project's home-directory if it has been defined. |
Yes |
id | Provides a unique id which can be used to provide selection between multiple output definitions of the same type. | No |
type | One of "jar", "pom", "boot" (a jar that should be added to the bootclasspath), "testsjar" or "assembly". | Yes |
jar
The name of an output jar, relative to the home directory.
This is a shortcut for an output element with type="jar".
Attribute | Description | Required? |
---|---|---|
name | The name of the jar. May contain shell glob patterns (*, ? or ranges like [a-z]) in which case the pattern must match exactly one existing file. |
Yes |
id | Provides a unique id which can be used to provide selection between multiple jars definitions. | No |
type | If the value of this attribute is "boot" then the jar is prepended to the bootclasspath instead of being appended to the classpath. This attribute is ignored unless bootclass="yes" is specified on the workspace. | No, defaults to "jar" |
pom
The name of an output POM, relative to the home directory.
This is a shortcut for an output element with type="pom".
Attribute | Description | Required? |
---|---|---|
name | The name of the POM. May contain shell glob patterns (*, ? or ranges like [a-z]) in which case the pattern must match exactly one existing file. |
Yes |
id | Provides a unique id which can be used to provide selection between multiple poms definitions. | No |
type | Same as output's type attribute. | No, defaults to "pom". |
Other
report
This declares where any sort of report - for example the outputs of the junitreport tool - are placed.
The name junitreport can be used as a synonym for report.
Apache Gump takes the nested and parent references as a directory reference, and lists the contents of the files in that directory.
Attribute | Description | Required? |
---|---|---|
nested | Name of a directory or file, relative to the srcdir of the module containing this project. Note that this ignores any <home> settings. | No |
parent | Name of a directory or file, relative to the base directory of the workspace. | No |
nag
If this element is present, an entry for this project will be created in the file naglist. This enables email reports of build failures.
Attribute | Description | Required? |
---|---|---|
subject | value for the Subject header of the mail report. Defaults to "Build Failure - " and the name of the project. Will be prefixed by the prefix defined in the workspace. | No |
from | Sender address for the email report. | Yes. |
to | Recipient of the email report. Will be overridden by a "to" attribute in the workspace. | Yes. |
A build failure is detected by the exit code of the builder.
redistributable
If present, indicates that outputs of builds from this module are redistributable. Defaults to the redistributable value for the repository.
mkdir
Creates a directory before starting the build. This is sometimes needed in conjunction with <work>.
Attribute | Description | Required? |
---|---|---|
dir | The directory to create, relative to srcdir of the module containing this project. | Yes, unless file is specified. |
file | The file to delete, relative to srcdir of the module containing this project. | Yes, unless dir is specified |
delete
Deletes a directory before starting the build.
Attribute | Description | Required? |
---|---|---|
dir | The directory to create, relative to srcdir of the module containing this project. | Yes |
by Sam Ruby, Adam R. B. Jack