The Moxie project descriptor defines the structure, metadata, and dependencies of your project. It is the heart of Moxie and is used by all Moxie Extension tasks.
groupId |
artifactId |
version |
name | Name of the project |
description | description of the project |
organization | organization sponsoring development of the project |
organizationUrl | url of the organization sponsoring the project |
issuesUrl | url of the issue tracker for the project |
forumUrl | url of the forum or discussion group for the project |
blogUrl | url of the blog for the project |
socialNetworkUrl | url of the social network profile for the project |
ciUrl | url of the continuous integration server for the project |
url | url of the project web site |
inceptionYear | year the project was founded |
releaseVersion | current stable release |
releaseDate | current stable release date |
mx:package
task.
packaging: jar packaging: jar+zip packaging: jar+zip+tgz
apply: eclipse, intellij, pom
apply: 'eclipse:+var+groovy'
parent: ../build.moxie
You can specify the project licenses in the licenses setting. This setting is currently only used during POM generation.
licenses: - { name: 'Apache ASL v2.0' url: 'http://www.apache.org/licenses/LICENSE-2.0.html' }
You can specify the project developers in the developers setting. This setting is currently only used during POM generation.
developers: - { id: james name: 'James Moger' url: 'https://plus.google.com/u/0/116428776452027956920' organization: 'James Moger' organizationUrl: 'http://www.jamesmoger.com' roles: developer }
You can specify the project SCM information in the scm setting. This setting is currently only used during POM generation.
scm: { connection: 'scm:git:git://github.com/gitblit-org/moxie.git' developerConnection: 'scm:git:https://github.com/gitblit-org/moxie.git' url: 'https://gitblit-org.github.com/moxie' tag: HEAD }
This section is used to define remote artifact repositories. Currently only http/https repositories are supported.
The default connectTimeout is 20 seconds.
The default readTimeout is 1800 seconds (30 mins).
If a repository specifies one or more affinities and a dependency matches one of those affinities, that repository will be used first during dependency or metadata resolution of that artifact. This allows you to control the efficiency of the resolution process by boosting the importance of a specific repository.
In the following example, the Restlet repository has an affinity for all artifacts belonging to the org.restlet groupId. During resolution, the Restlet repository is checked first for all org.restlet.
registeredRepositories: - { id: 'central', url: 'https://repo1.maven.org/maven2' } - { id: 'mavencentral', url: 'https://repo1.maven.org/maven2' } - { id: 'sonatype-oss' url: 'https://oss.sonatype.org/content/groups/public' # Snapshot Purge Policy revisionRetentionCount: 1 revisionPurgeAfterDays: 0 } - { id: 'restlet' url: 'https://maven.restlet.talend.com' # Snapshot Purge Policy revisionRetentionCount: 1 revisionPurgeAfterDays: 0 # Artifact affinitities affinity: [ 'org.restlet' ] # seconds to wait till connected connectTimeout: 20 # seconds to wait on read readTimeout: 1800 # authentication credentials username: 'someuser' password: 'mypassword' }
repositories: 'central'
The projects are assumed to be located relative to the current project. You may use an Ant or enviromental property as part of the module reference.
All referenced modules must have a
build.moxie
descriptor unless a different descriptor is manually specified with the @file syntax.
Parent Project
modules: - 'project1' - 'project2' - '${myprojects}/project3' @build2.moxie
mx
tasks support these tagged subsets.
sourceDirectories: - compile 'src/main/core' :mytag - compile 'src/main/pro' - compile 'src/main/all' - compile 'src/client/java' :mytag - { scope: 'test', dir: 'src/test/java' }
mx
tasks support these tagged subsets.
resourceDirectories: - compile 'src/main/resources' - compile 'src/client/resources' :mytag - test 'src/test/resources' - site 'src/site/resources'
properties: { jgit.version : 1.3.0.201202151440-r }
dependencyManagement: - 'org.apache.ant:ant:1.8.3' - 'junit:junit:4.11'
groupId:artifactId:versionEach dependency must also have an assigned scope.
mx
tasks support these tagged subsets.
dependencies: - compile 'org.apache.ant:ant' - compile 'com.acme:widget:1.2.3' :mytag - test 'junit'
- compile 'org.apache.ant:ant.1.8.4:jdk14'
Sometimes it is desirable to specify exclusions from a dependency's graph. There are two ways to exclude dependencies.
- compile 'org.apache.ant:ant.1.8.4' @jar
- compile 'org.apache.ant:ant.1.8.4' !commons-logging
<googlecode>:projectName:filename
repositories: central, googlecode dependencies: - compile '<googlecode>:iciql:iciql-0.7.0.jar'
dependencyDirectory: ext
When you are using the dependencyDirectory
setting you may also control the destination name of the project-relative artifacts.
dependencyNamePattern: [artifactId]-[version](-[classifier]).[ext]
These settings can be used to manipulate released POMs and/or to enable clever dependency tricks. Both of these features are used internally by Moxie.
Dependency aliases allow you to specify shorthand notation for a dependency which will be resolved at runtime to the full coordinates.
dependencyAliases: { junit: 'junit:junit' testng: 'org.testng:testng' cobertura: 'net.sourceforge.cobertura:cobertura' emma: 'emma:emma' jacoco: 'org.jacoco:org.jacoco.ant' 'mx:jgit' : 'org.eclipse.jgit:org.eclipse.jgit' 'mx:markdownpapers' : 'org.tautua.markdownpapers:markdownpapers-core' 'mx:rhino' : 'org.mozilla:rhino' }
Dependency overrides are used to redefine the dependencies of released/published POMs from other projects. The most common use case would be to add undeclared dependencies for old POMs or to purposefully exclude dependencies from specific scopes.
Moxie uses this feature to simplify specification of "build" scope dependencies so that enabling Cobertura, Emma, or TestNG is as easy as adding a single build dependency.
You must declare the full coordinates of the dependency to tweak. Property substitution is prohibited. You may specify the scopes for which your override applies. If no scope is specified ALL scopes are assumed.
Be very careful when using dependency overrides!
dependencyOverrides: { # cobertura: redefine ant as optional for build scope 'net.sourceforge.cobertura:cobertura:1.9.4.1' : { scope: build dependencies: - compile 'oro:oro:2.0.8' - compile 'asm:asm:3.0' - compile 'asm:asm-tree:3.0' - compile 'log4j:log4j:1.2.9' - compile 'org.apache.ant:ant:1.7.0' optional } # emma: add emma_ant dependency for build scope 'emma:emma:2.1.5320' : { scope: build dependencies: - compile 'emma:emma_ant:2.1.5320' } }