root/branches/omero/maven.xml
| Revision 142, 9.9 kB (checked in by jmoore, 4 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project xmlns:j="jelly:core" xmlns:ant="jelly:ant" |
| 3 | xmlns:maven="jelly:maven" xmlns:u="jelly:util" default="help"> |
| 4 | |
| 5 | |
| 6 | <!-- ========================================================= --> |
| 7 | <!-- |
| 8 | Contents |
| 9 | - help |
| 10 | - setup |
| 11 | - top-level goals |
| 12 | - component goals |
| 13 | - deployment |
| 14 | - dependencies |
| 15 | --> |
| 16 | <!-- ========================================================= --> |
| 17 | |
| 18 | |
| 19 | <!-- ========================================================= --> |
| 20 | <!-- HELP --> |
| 21 | <!-- ========================================================= --> |
| 22 | <goal name="help" |
| 23 | description="Default; provides help with Omero build system"> |
| 24 | <ant:echo></ant:echo> |
| 25 | <ant:echo>********************************************************</ant:echo> |
| 26 | <ant:echo> Omero Build System:</ant:echo> |
| 27 | <ant:echo> -------------------</ant:echo> |
| 28 | <ant:echo> Main goals: (e.g. "maven GOAL")</ant:echo> |
| 29 | <ant:echo> help -- This file</ant:echo> |
| 30 | <ant:echo> build -- Compile to target and package </ant:echo> |
| 31 | <ant:echo> install -- Add dependencies to your repository </ant:echo> |
| 32 | <ant:echo> deploy -- Copy war to container (see server.dir)</ant:echo> |
| 33 | <ant:echo> test-all -- Run all tests (see test mode below)</ant:echo> |
| 34 | <ant:echo> clean -- Remove all generated items </ant:echo> |
| 35 | <ant:echo> </ant:echo> |
| 36 | <ant:echo> Use "maven -u" for a list of all goals </ant:echo> |
| 37 | <ant:echo> Use "maven -h" for help on maven </ant:echo> |
| 38 | <ant:echo> </ant:echo> |
| 39 | <ant:echo> Main properties: (e.g. "maven -DPROPERTY=VALUE")</ant:echo> |
| 40 | <ant:echo> maven.test.mode={integration|unit} (Now: ${maven.test.mode})</ant:echo> |
| 41 | <ant:echo> maven.server.dir=WEBAPP_DIR (Now: ${maven.server.dir})</ant:echo> |
| 42 | <ant:echo> </ant:echo> |
| 43 | <ant:echo> See project.properties and build.properties for all properties </ant:echo> |
| 44 | <ant:echo></ant:echo> |
| 45 | <ant:echo>********************************************************</ant:echo> |
| 46 | <ant:echo> For more information, see http://maven.apache.org</ant:echo> |
| 47 | <ant:echo></ant:echo> |
| 48 | </goal> |
| 49 | |
| 50 | <!-- ========================================================= --> |
| 51 | <!-- SETUP --> |
| 52 | <!-- ========================================================= --> |
| 53 | <goal name="init" prereqs="create-properties,create-classpath" |
| 54 | description="Initialization for all tasks"/><!--TODO jam --> |
| 55 | <goal name="get-tomcat-plugin" |
| 56 | description="Download tomcat plugin for deployment"> |
| 57 | <maven:property name="artifactId" defaultValue="maven-tomcat-plugin" /> |
| 58 | <maven:property name="groupId" defaultValue="codeczar-tomcat" /> |
| 59 | <maven:property name="version" defaultValue="1.1" /> |
| 60 | <attainGoal name="plugin:download"/> |
| 61 | </goal> |
| 62 | <goal name="get-jam-plugin" |
| 63 | description="Get jam -- the maven-ant bridge"> |
| 64 | <maven:property name="artifactId" defaultValue="maven-jam-plugin" /> |
| 65 | <maven:property name="groupId" defaultValue="jam" /> |
| 66 | <maven:property name="version" defaultValue="2.1" /> |
| 67 | <attainGoal name="plugin:download"/> |
| 68 | </goal> |
| 69 | <goal name="create-classpath" |
| 70 | description="Produces a bash source-able classpath definition"> |
| 71 | <ant:pathconvert targetos="${ant.os}" |
| 72 | property="my.classpath" |
| 73 | refid="maven.dependency.classpath"/> |
| 74 | <ant:echo file="${maven.build.dir}/Classpath.sh"><!-- TODO --> |
| 75 | export CLASSPATH=${maven.build.dest}:${my.classpath} |
| 76 | </ant:echo> |
| 77 | </goal> |
| 78 | |
| 79 | |
| 80 | <!-- ========================================================= --> |
| 81 | <!-- TOP-LEVEL: For calling from the top level --> |
| 82 | <!-- ========================================================= --> |
| 83 | <goal name="build" description="Produces main artifacts (jars/wars) under target/ "> |
| 84 | <attainGoal name="multiproject:artifact" /> |
| 85 | </goal> |
| 86 | <goal name="install" description="Copies main artifacts to local maven repository"> |
| 87 | <attainGoal name="multiproject:install" /> |
| 88 | </goal> |
| 89 | <goal name="clean" description="Removes all generated content"> |
| 90 | <attainGoal name="multiproject:clean"/> |
| 91 | <attainGoal name="clean:clean"/> |
| 92 | </goal> |
| 93 | <goal name="test-all" description="Runs test:test goal on all components"> |
| 94 | <j:expr value="${context.setVariable('maven.test.skip', false)}"/> |
| 95 | <maven:property name="goal" defaultValue="test:test" /> |
| 96 | <attainGoal name="multiproject:goal"/> |
| 97 | </goal> |
| 98 | |
| 99 | |
| 100 | |
| 101 | <!-- ========================================================= --> |
| 102 | <!-- COMPONENTS: From calling within a component --> |
| 103 | <!-- ========================================================= --> |
| 104 | <goal name="create-properties" description="Produces spring.properties file for all components"> |
| 105 | <u:file name="${basedir}/src" var="srcDir"/> |
| 106 | <j:if test="${srcDir.exists()}"> |
| 107 | <ant:propertyfile |
| 108 | comment=" DO NOT EDIT: Generated Database and Server properties from build.properties" |
| 109 | file="${basedir}/src/spring.properties"> |
| 110 | <ant:entry key="database.driver" value="${database.driver}"/> |
| 111 | <ant:entry key="database.url" value="${database.url}"/> |
| 112 | <ant:entry key="database.username" value="${database.username}"/> |
| 113 | <ant:entry key="database.password" value="${database.password}"/> |
| 114 | <ant:entry key="database.dialect" value="${database.dialect}"/> |
| 115 | <ant:entry key="database.show_sql" value="${database.show_sql}"/> |
| 116 | <ant:entry key="server.host" value="localhost"/> |
| 117 | <ant:entry key="server.port" value="8080"/> |
| 118 | <ant:entry key="local.path" value="${maven.build.dest}"/> |
| 119 | <ant:entry key="omeds.url" value="${omeds.url}"/> |
| 120 | <ant:entry key="omeds.user" value="${omeds.user}"/> |
| 121 | <ant:entry key="omeds.pass" value="${omeds.pass}"/> |
| 122 | <ant:entry key="omero.context" value="${omero.context}"/> |
| 123 | |
| 124 | </ant:propertyfile> |
| 125 | <ant:copy file="${basedir}/../../log4j.properties" todir="${basedir}/src"/> |
| 126 | </j:if> |
| 127 | </goal> |
| 128 | |
| 129 | <goal name="delete-properties" description="Removes spring.properties and log4j.properties from components"> |
| 130 | <ant:delete file="${basedir}/src/spring.properties"/> |
| 131 | <ant:delete file="${basedir}/src/log4j.properties"/> |
| 132 | </goal> |
| 133 | |
| 134 | <!-- Necessary due to maven issues. Hopefully resolved in Maven 2 --> |
| 135 | <goal name="bootstrap" description="Necessary initialization for a new installation"> |
| 136 | <maven:reactor |
| 137 | basedir="." |
| 138 | includes="components/common/project.xml" |
| 139 | goals="jar:install" |
| 140 | ignoreFailures="false" |
| 141 | /> |
| 142 | <maven:reactor |
| 143 | basedir="." |
| 144 | includes="components/client/project.xml" |
| 145 | goals="jar:install" |
| 146 | ignoreFailures="false" |
| 147 | /> |
| 148 | <maven:reactor |
| 149 | basedir="." |
| 150 | includes="components/shoola-adapter/project.xml" |
| 151 | goals="jar:install" |
| 152 | ignoreFailures="false" |
| 153 | /> |
| 154 | <!-- |
| 155 | <j:forEach var="reactorProject" items="${reactorProjects}"> |
| 156 | ==* ADD postProcessing="true" to reactor |
| 157 | ... Do whatever you want with the harvested information ... |
| 158 | </j:forEach> |
| 159 | --> |
| 160 | </goal> |
| 161 | |
| 162 | <!-- ========================================================= --> |
| 163 | <!-- DEPLOYMENT --> |
| 164 | <!-- ========================================================= --> |
| 165 | |
| 166 | <goal name="server" description="Prepares server" prereqs="build"> |
| 167 | <!-- test for tomcat TODO --> |
| 168 | <ant:echo message=" "/> |
| 169 | <ant:echo message=" =================================== "/> |
| 170 | <ant:echo message=" Reload/Start your web container now "/> |
| 171 | <ant:echo message=" =================================== "/> |
| 172 | <ant:echo message=" "/> |
| 173 | </goal> |
| 174 | |
| 175 | <goal name="server-tomcat" description="Prepares Tomcat using tomcat plugin"> |
| 176 | <maven:reactor |
| 177 | basedir="." |
| 178 | includes="components/server/project.xml" |
| 179 | goals="tomcat:remove,tomcat:install" |
| 180 | ignoreFailures="false" |
| 181 | /> |
| 182 | </goal> |
| 183 | |
| 184 | <goal name="server-misc" description="Copies war to server director"> |
| 185 | <ant:copy todir="${server.dir}" |
| 186 | file="${maven.repo.local}/omero/wars/omero-server-1.0.war" |
| 187 | /> |
| 188 | </goal> |
| 189 | |
| 190 | |
| 191 | <!-- ========================================================= --> |
| 192 | <!-- DEPENDENCIES: what happens when and why --> |
| 193 | <!-- ========================================================= --> |
| 194 | <postGoal name="java:prepare-filesystem"> |
| 195 | <attainGoal name="init"/> |
| 196 | </postGoal> |
| 197 | <postGoal name="war:war-resources"> |
| 198 | <attainGoal name="init"/> |
| 199 | </postGoal> |
| 200 | <preGoal name="clean:clean"> |
| 201 | <attainGoal name="delete-properties"/> |
| 202 | </preGoal> |
| 203 | <!-- http://weblogs.java.net/blog/michael_n/archive/2005/05/maven_multiple.html--> |
| 204 | <preGoal name="java:compile"> |
| 205 | <u:file name="${maven.gen.src}" var="genDir"/> |
| 206 | <j:if test="${genDir.exists()}"> |
| 207 | <path id="additional.src.path"> |
| 208 | <pathelement location="${maven.gen.src}"/> |
| 209 | </path> |
| 210 | <maven:addPath id="maven.compile.src.set" |
| 211 | refid="additional.src.path"/> |
| 212 | </j:if> |
| 213 | </preGoal> |
| 214 | <!-- Allows for switching between integration and unit testing: |
| 215 | from: http://java2.5341.com/msg/33178.html --> |
| 216 | <preGoal name="test:test"> |
| 217 | <j:set var="testModeX" value="${maven.test.mode}X" /> |
| 218 | <j:if test="${testModeX == 'X'}" > |
| 219 | <j:set var="maven.test.mode" value="all" /> |
| 220 | </j:if> |
| 221 | <echo>Running ${maven.test.mode} tests</echo> |
| 222 | <j:if test="${maven.test.mode != 'all'}" > |
| 223 | <j:set var="includeProp" value="test.${maven.test.mode}.includes" /> |
| 224 | <j:if test="${context.getVariable(includeProp) != null}"> |
| 225 | <u:tokenize var="patterns" delim=",">${context.getVariable(includeProp)}</u:tokenize> |
| 226 | <j:forEach var="pattern" items="${patterns}"> |
| 227 | <j:set var="dummy" value="${pom.build.unitTest.addInclude(pattern)}" /> |
| 228 | </j:forEach> |
| 229 | </j:if> |
| 230 | <j:set var="excludeProp" value="test.${maven.test.mode}.excludes" /> |
| 231 | <j:if test="${context.getVariable(excludeProp) != null}"> |
| 232 | <u:tokenize var="patterns" delim=",">${context.getVariable(excludeProp)}</u:tokenize> |
| 233 | <j:forEach var="pattern" items="${patterns}"> |
| 234 | <j:set var="dummy" value="${pom.build.unitTest.addExclude(pattern)}" /> |
| 235 | </j:forEach> |
| 236 | </j:if> |
| 237 | </j:if> |
| 238 | </preGoal> |
| 239 | <!-- TODO Needed for doing in class compilation. Try removing --> |
| 240 | <preGoal name="java:compile"> |
| 241 | <ant:path id="jdk.classpath"> |
| 242 | <ant:pathelement path="${tools.jar}"/> |
| 243 | </ant:path> |
| 244 | <maven:addPath id="maven.dependency.classpath" refid="jdk.classpath"/> |
| 245 | </preGoal> |
| 246 | |
| 247 | </project> |
Note: See TracBrowser
for help on using the browser.
