mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added incremental build tasks
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@78749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
47
build.xml
47
build.xml
@@ -8,17 +8,15 @@
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<target name="cleanTarget">
|
||||
<delete dir="${ant.build.directory}" failonerror="true" />
|
||||
</target>
|
||||
|
||||
<target name="install">
|
||||
<exec executable="${mvn.exec}" failonerror="true">
|
||||
<arg value="clean" />
|
||||
<arg value="install" />
|
||||
<arg value="-DskipTests" />
|
||||
<arg value="-PfullBuild" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="fetchWarFile">
|
||||
<xmlproperty file="../pom.xml" keepRoot="false"/>
|
||||
<exec executable="${mvn.exec}" failonerror="true">
|
||||
@@ -39,7 +37,7 @@
|
||||
<delete dir="${app.folder}" failonerror="true" />
|
||||
</target>
|
||||
|
||||
<target name="alfresco:amp" depends="cleanTarget, unitTest">
|
||||
<target name="alfresco:amp" depends="install, unitTest">
|
||||
<exec executable="${mvn.exec}" failonerror="true">
|
||||
<arg value="alfresco:amp" />
|
||||
</exec>
|
||||
@@ -55,7 +53,7 @@
|
||||
<copy file="${ant.build.directory}/${app.package}" todir="${app.tomcat.webapps}" failonerror="true" />
|
||||
</target>
|
||||
|
||||
<target name="buildAndDeploy" depends="alfresco:install, copyWarFileToTomcat" description=""/>
|
||||
<target name="fullBuild" depends="alfresco:install, copyWarFileToTomcat" description=""/>
|
||||
|
||||
<target name="getSvnRevision">
|
||||
<mkdir dir="${ant.build.directory}"/>
|
||||
@@ -66,31 +64,13 @@
|
||||
<property file="${svnInfoFile}"/>
|
||||
</target>
|
||||
|
||||
<target name="assembleLocalisationPackage" depends="getSvnRevision" description="">
|
||||
<property name="i18n" value="${ant.build.directory}/i18n" />
|
||||
<delete dir="${i18n}" failonerror="true" />
|
||||
<copy todir="${i18n}/${ant.project.name}/${ant.config.directory}" failonerror="true">
|
||||
<fileset dir="${ant.config.directory}">
|
||||
<include name="**/*.properties" />
|
||||
<exclude name="**/*_*.properties" />
|
||||
<exclude name="**/rm-method-security.properties" />
|
||||
<exclude name="**/alfresco-global.properties" />
|
||||
<exclude name="**/log4j.properties" />
|
||||
<exclude name="**/module.properties" />
|
||||
<exclude name="**/file-mapping.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<xmlproperty file="../pom.xml" keepRoot="false"/>
|
||||
<zip destfile="${i18n}/${ant.project.name}-${version}-r${Revision}.zip" basedir="${i18n}" />
|
||||
</target>
|
||||
|
||||
<target name="copyWebDirectory" if="${web.directory.exists}">
|
||||
<copy todir="${app.folder}" failonerror="true">
|
||||
<fileset dir="${ant.source.web.directory}" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="deployExploded" depends="cleanTarget, install" description="">
|
||||
<target name="package">
|
||||
<fail message="Exploded webapp directory '${app.war.artifactId}' does not exist.">
|
||||
<condition>
|
||||
<not>
|
||||
@@ -98,11 +78,16 @@
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<copy todir="${app.folder}/WEB-INF/lib" failonerror="true">
|
||||
<fileset dir="${ant.build.directory}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<exec executable="${mvn.exec}" failonerror="true">
|
||||
<arg value="package" />
|
||||
<arg value="-DskipTests" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="incrementalBuild" depends="package, unitTest" description="">
|
||||
<xmlproperty file="pom.xml" keepRoot="false"/>
|
||||
<copy file="${ant.build.directory}/${artifactId}-${parent.version}.jar" tofile="${ant.build.directory}/${artifactId}-${parent.version}-amp.jar" failonerror="true" />
|
||||
<move file="${ant.build.directory}/${artifactId}-${parent.version}-amp.jar" todir="${app.folder}/WEB-INF/lib" failonerror="true" />
|
||||
<copy todir="${app.folder}/WEB-INF/classes" failonerror="true">
|
||||
<fileset dir="${ant.config.directory}">
|
||||
<exclude name="**/module.properties" />
|
||||
|
@@ -25,14 +25,14 @@
|
||||
</target>
|
||||
|
||||
<target name="prepareEnv" depends="copyDBDriver, copyDevContextFile" description="" />
|
||||
|
||||
<target name="unitTest" depends="install">
|
||||
|
||||
<target name="unitTest">
|
||||
<exec executable="${mvn.exec}" failonerror="true">
|
||||
<arg value="test" />
|
||||
<arg value="-Dtest=AllUnitTestSuite" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="fetchSOLR">
|
||||
<xmlproperty file="../pom.xml" keepRoot="false"/>
|
||||
<exec executable="${mvn.exec}" failonerror="true">
|
||||
@@ -43,62 +43,62 @@
|
||||
<arg value="-Dpackaging=${solr.packaging}" />
|
||||
<arg value="-Ddest=${solr.directory}/${solr.package}" />
|
||||
</exec>
|
||||
<unzip src="${solr.directory}/${solr.package}" dest="${solr.directory}"/>
|
||||
<unzip src="${solr.directory}/${solr.package}" dest="${solr.directory}"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="configure-solr" depends="fetchSOLR"
|
||||
description="Configures Tomcat and the Alfresco repository to use SOLR">
|
||||
|
||||
<dirname property="temp.dir" file="${ant.file}"/>
|
||||
<pathconvert property="base.dir" targetos="unix">
|
||||
<path location="${temp.dir}"/>
|
||||
</pathconvert>
|
||||
|
||||
<property name="data.root" value="${base.dir}/../../data" />
|
||||
<property name="solr.root" value="${base.dir}/${solr.directory}" />
|
||||
|
||||
<mkdir dir="${data.root}/solr-index"/>
|
||||
|
||||
<!-- copy SOLR config files -->
|
||||
<copy file="${solr.directory}/context.xml"
|
||||
tofile="${app.tomcat.folder}/conf/Catalina/localhost/solr.xml" />
|
||||
<replace file="${app.tomcat.folder}/conf/Catalina/localhost/solr.xml" summary="yes">
|
||||
<replacefilter token="@@ALFRESCO_SOLR_DIR@@" value="${solr.root}" />
|
||||
</replace>
|
||||
|
||||
<replace file="${solr.directory}/archive-SpacesStore/conf/solrcore.properties" summary="yes">
|
||||
<replacefilter token="@@ALFRESCO_SOLR_DIR@@" value="${data.root}/solr-index" />
|
||||
</replace>
|
||||
|
||||
<replace file="${solr.directory}/workspace-SpacesStore/conf/solrcore.properties" summary="yes">
|
||||
<replacefilter token="@@ALFRESCO_SOLR_DIR@@" value="${data.root}/solr-index" />
|
||||
</replace>
|
||||
|
||||
<!-- copy keystore files -->
|
||||
<copy todir="${data.root}/keystore">
|
||||
<fileset dir="${solr.directory}/alf_data/keystore" />
|
||||
description="Configures Tomcat and the Alfresco repository to use SOLR">
|
||||
|
||||
<dirname property="temp.dir" file="${ant.file}"/>
|
||||
<pathconvert property="base.dir" targetos="unix">
|
||||
<path location="${temp.dir}"/>
|
||||
</pathconvert>
|
||||
|
||||
<property name="data.root" value="${base.dir}/../../data" />
|
||||
<property name="solr.root" value="${base.dir}/${solr.directory}" />
|
||||
|
||||
<mkdir dir="${data.root}/solr-index"/>
|
||||
|
||||
<!-- copy SOLR config files -->
|
||||
<copy file="${solr.directory}/context.xml"
|
||||
tofile="${app.tomcat.folder}/conf/Catalina/localhost/solr.xml" />
|
||||
<replace file="${app.tomcat.folder}/conf/Catalina/localhost/solr.xml" summary="yes">
|
||||
<replacefilter token="@@ALFRESCO_SOLR_DIR@@" value="${solr.root}" />
|
||||
</replace>
|
||||
|
||||
<replace file="${solr.directory}/archive-SpacesStore/conf/solrcore.properties" summary="yes">
|
||||
<replacefilter token="@@ALFRESCO_SOLR_DIR@@" value="${data.root}/solr-index" />
|
||||
</replace>
|
||||
|
||||
<replace file="${solr.directory}/workspace-SpacesStore/conf/solrcore.properties" summary="yes">
|
||||
<replacefilter token="@@ALFRESCO_SOLR_DIR@@" value="${data.root}/solr-index" />
|
||||
</replace>
|
||||
|
||||
<!-- copy keystore files -->
|
||||
<copy todir="${data.root}/keystore">
|
||||
<fileset dir="${solr.directory}/alf_data/keystore" />
|
||||
</copy>
|
||||
|
||||
<!-- setup Tomcat SSL connector -->
|
||||
<!-- NOTE: indentation of the replacevalue below is intentional, it matches formatting in destination file -->
|
||||
<replace file="${app.tomcat.folder}/conf/server.xml" summary="yes">
|
||||
<replacetoken><![CDATA[<!-- Alfresco SSL Connector placeholder -->]]></replacetoken>
|
||||
<replacevalue><![CDATA[
|
||||
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
|
||||
maxThreads="150" scheme="https" keystoreFile="../../data/keystore/ssl.keystore"
|
||||
keystorePass="kT9X6oe68t" keystoreType="JCEKS"
|
||||
secure="true" connectionTimeout="240000"
|
||||
truststoreFile="../../data/keystore/ssl.truststore"
|
||||
truststorePass="kT9X6oe68t" truststoreType="JCEKS"
|
||||
clientAuth="want" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" maxHttpHeaderSize="32768" />]]></replacevalue>
|
||||
|
||||
<!-- setup Tomcat SSL connector -->
|
||||
<!-- NOTE: indentation of the replacevalue below is intentional, it matches formatting in destination file -->
|
||||
<replace file="${app.tomcat.folder}/conf/server.xml" summary="yes">
|
||||
<replacetoken><![CDATA[<!-- Alfresco SSL Connector placeholder -->]]></replacetoken>
|
||||
<replacevalue><![CDATA[
|
||||
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
|
||||
maxThreads="150" scheme="https" keystoreFile="../../data/keystore/ssl.keystore"
|
||||
keystorePass="kT9X6oe68t" keystoreType="JCEKS"
|
||||
secure="true" connectionTimeout="240000"
|
||||
truststoreFile="../../data/keystore/ssl.truststore"
|
||||
truststorePass="kT9X6oe68t" truststoreType="JCEKS"
|
||||
clientAuth="want" sslProtocol="TLS" allowUnsafeLegacyRenegotiation="true" maxHttpHeaderSize="32768" />]]></replacevalue>
|
||||
</replace>
|
||||
|
||||
<!-- update project repository.properties file with SOLR properties -->
|
||||
<propertyfile file="${data.root}/repository.properties">
|
||||
<entry key="dir.keystore" value="${data.root}/keystore" />
|
||||
<entry key="index.subsystem.name" value="solr" />
|
||||
</propertyfile>
|
||||
|
||||
|
||||
<!-- update project repository.properties file with SOLR properties -->
|
||||
<propertyfile file="${data.root}/repository.properties">
|
||||
<entry key="dir.keystore" value="${data.root}/keystore" />
|
||||
<entry key="index.subsystem.name" value="solr" />
|
||||
</propertyfile>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
</project>
|
@@ -27,63 +27,31 @@
|
||||
</testResource>
|
||||
</testResources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.alfresco.maven.plugin</groupId>
|
||||
<artifactId>alfresco-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>amp</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Additional source folder to be added: source/compatibility -->
|
||||
<!-- Additional source folder to be added: source/compatibility -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-source</id>
|
||||
<goals>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>source/compatibility</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-test-source</id>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>unit-test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>prepare-package</phase>
|
||||
<id>add-source</id>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
<goal>add-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<delete file="${project.build.outputDirectory}/alfresco/extension/dev-context.xml"/>
|
||||
<move todir="${project.build.directory}/${project.build.finalName}/config/alfresco">
|
||||
<fileset dir="${project.build.outputDirectory}/alfresco"/>
|
||||
</move>
|
||||
<move file="${project.build.directory}/${project.build.finalName}/config/alfresco/module/org_alfresco_module_rm/module.properties"
|
||||
todir="${project.build.directory}/${project.build.finalName}"/>
|
||||
</tasks>
|
||||
<sources>
|
||||
<source>source/compatibility</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-test-source</id>
|
||||
<goals>
|
||||
<goal>add-test-source</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sources>
|
||||
<source>unit-test/java</source>
|
||||
</sources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
@@ -186,6 +154,45 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>fullBuild</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.alfresco.maven.plugin</groupId>
|
||||
<artifactId>alfresco-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>amp</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<delete file="${project.build.outputDirectory}/alfresco/extension/dev-context.xml"/>
|
||||
<move todir="${project.build.directory}/${project.build.finalName}/config/alfresco">
|
||||
<fileset dir="${project.build.outputDirectory}/alfresco"/>
|
||||
</move>
|
||||
<move file="${project.build.directory}/${project.build.finalName}/config/alfresco/module/org_alfresco_module_rm/module.properties"
|
||||
todir="${project.build.directory}/${project.build.finalName}"/>
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
Reference in New Issue
Block a user