Ametys products are built using various components.
Each component is a project found in the Ametys Subversion repository (https://svn.ametys.org).
Ant and Ivy are the main tools used for building these components.
Building an Ametys component requires:
Ivy is a powerful dependency manager oriented toward Java dependency management.
Ivy is integrated with Ant, easy to use, very flexible and continuous integration ready.
The external libraries needed by Ametys products can be found at :
https://svn.ametys.org/ivyrep/external/
The configuration file needed for building Ametys products can be found at :
https://svn.ametys.org/ivyrep/ivysettings.xml
There are four possible types of build for each component :
The following guide only describes integration builds.
There are three ways one can build an Ametys component:
In all cases, the Ivy repository needs to be checked out onto the local machine.
First you need to checkout the root of the Subversion repository, but not recursively (-N), since it contains all the branches, tags, ... :
$ svn co -N https://svn.ametys.org /path/to/store/svn.ametys.org
...
$ cd /path/to/store/svn.ametys.org
Then you need to checkout the ivyrep:
$ svn up ivyrep
...
Then you need to checkout a branch for the wanted component.
For the trunk of the cms project, use:
$ svn up -N trunk
...
$ cd trunk
$ svn up -N cms
...
$ cd cms
$ svn up trunk
...
$ cd trunk
You now have the cms project, you just need to call Ant in order to built and publish the artifacts.
Because dependencies on other Ametys components in trunk are of type latest.integration you need to build dependencies first.
Fortunately, if no integration build is found in your locally ivyrep, the latest nightly build will be used ( will not work offline).
The following command will build and publish the artifacts in your local ivyrep:
$ ant
Buildfile: /path/to/store/svn.ametys.org/trunk/cms/trunk/build.xml
prepare:
[mkdir] Created dir: /path/to/store/svn.ametys.org/trunk/cms/trunk/tmp
[delete] Deleting directory /path/to/store/svn.ametys.org/trunk/cms/trunk/target
...
publish:
:: delivering :: org.ametys.cms#cms;working@krusty :: 3.0.0.20090611-0849-dev :: integration :: Thu Jun 11 10:50:11 CEST 2009
delivering ivy file to /path/to/store/svn.ametys.org/trunk/cms/trunk/target/ivy/ivy.xml
remove-javadoc-publishing:
[ivy:publish] :: publishing :: org.ametys.cms#cms
[ivy:publish] published ametys-cms to /path/to/store/svn.ametys.org/ivyrep/ametys-products-integration/org.ametys.cms/cms/3.0.0.20090611-0849-dev/jars/ametys-cms-3.0.0.20090611-0849-dev.jar
...
clean:
[delete] Deleting directory /path/to/store/svn.ametys.org/trunk/cms/trunk/tmp
all:
BUILD SUCCESSFUL
Total time: 34 seconds
As artifacts are published in your local ivyrep, you can retrieve them manually or automatically with Ivy on a upstream Ivy based project.
Using the latest.integration special revision allows you to retrieve the latest successfully built local artifacts.
You can use this method when you want to check out only a project and you do not have access to the Subversion command line interface.
You first need to check out ivyrep from the following URL somewhere on your local machine:
https://svn.ametys.org/ivyrep/
And then checkout the branch of the component you want to build elsewhere on your local machine:
https://svn.ametys.org/trunk/cms/trunk/
Then you need to go to the directory where you have checked out this component and execute:
$ ant -Divy.settings=/path/to/locally/checked-out/ivyrep/ivysettings.xml
Buildfile: /path/to/store/svn.ametys.org/trunk/cms/trunk/build.xml
prepare:
[mkdir] Created dir: /path/to/store/svn.ametys.org/trunk/cms/trunk/tmp
[delete] Deleting directory /path/to/store/svn.ametys.org/trunk/cms/trunk/target
...
publish:
:: delivering :: org.ametys.cms#cms;working@krusty :: 3.0.0.20090611-0849-dev :: integration :: Thu Jun 11 10:50:11 CEST 2009
delivering ivy file to /path/to/store/svn.ametys.org/trunk/cms/trunk/target/ivy/ivy.xml
remove-javadoc-publishing:
[ivy:publish] :: publishing :: org.ametys.cms#cms
[ivy:publish] published ametys-cms to /path/to/store/svn.ametys.org/ivyrep/ametys-products-integration/org.ametys.cms/cms/3.0.0.20090611-0849-dev/jars/ametys-cms-3.0.0.20090611-0849-dev.jar
...
clean:
[delete] Deleting directory /path/to/store/svn.ametys.org/trunk/cms/trunk/tmp
all:
BUILD SUCCESSFUL
Total time: 34 seconds
The ivy.settings ant property must be the path to the ivysettings.xml file previously checked out.
This method is very similar to the previous one.
Indeed, you also need to first check out the ivyrep into a given directory.
Then, you need to retrieve the source package from http://releases.ametys.org/ and untar it:
$ tar zxvf ametys-cms-1.2.3.tar.gz
...
$ cd ametys-cms-1.2.3
Finally you need execute:
$ ant -Divy.settings=/path/to/locally/checked-out/ivyrep/ivysettings.xml
Buildfile: /path/to/store/svn.ametys.org/trunk/cms/trunk/build.xml
prepare:
[mkdir] Created dir: /path/to/store/svn.ametys.org/trunk/cms/trunk/tmp
[delete] Deleting directory /path/to/store/svn.ametys.org/trunk/cms/trunk/target
...
publish:
:: delivering :: org.ametys.cms#cms;working@krusty :: 3.0.0.20090611-0849-dev :: integration :: Thu Jun 11 10:50:11 CEST 2009
delivering ivy file to /path/to/store/svn.ametys.org/trunk/cms/trunk/target/ivy/ivy.xml
remove-javadoc-publishing:
[ivy:publish] :: publishing :: org.ametys.cms#cms
[ivy:publish] published ametys-cms to /path/to/store/svn.ametys.org/ivyrep/ametys-products-integration/org.ametys.cms/cms/3.0.0.20090611-0849-dev/jars/ametys-cms-3.0.0.20090611-0849-dev.jar
...
clean:
[delete] Deleting directory /path/to/store/svn.ametys.org/trunk/cms/trunk/tmp
all:
BUILD SUCCESSFUL
Total time: 34 seconds
Here again the ivy.settings ant property must be the path to the ivysettings.xml file previously checked out.
Required plugins :
Configuring IvyDE for Ametys :
Using a new Ametys component :