blob: 3d225993668c76fb903fec4bf701e6c9b8d42a39 [file] [log] [blame]
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Builds bundled and source distribution of Pluto, archiving it in zip, gzip and bzip2 files.
Prerequisites for this build includes an installed Java 5+ JDK, Maven 2.0+ and Ant 1.6+.
Run the binary build using the command line:
ant -f dist-build.xml
The bundled distribution is done in the following way:
1. Downloads Tomcat from Apache and unzips it into a working directory. To this distribution, the
a. Adds emptySessionPath="true" to server.xml.
b. Adds a pluto and tomcat users with pluto and manager roles to tomcat-users.xml.
2. Runs 'mvn install' and 'mvn pluto:install' to create the Pluto driver and testsuite
and installs them into the Tomcat dist in the working directory.
3. Archives the altered Tomcat dist with Pluto into a zip, gzip and bzip2 file.
All built distributions end up in target/dist.
After unarchiving the built distribution into a directory, invoke the startup script in the bin
directory and browse to: http://localhost:8080/pluto/portal/
Login as 'pluto' (password=pluto) to the portal. You will need to login again into the manager
application linked at the bottom of the Pluto Admin page in order to upload portlet application
war files to be able to deploy them to Pluto using the admin portlet. The 'tomcat' (password=tomcat)
user can also be used to deploy portlets.
<project name="PlutoDistributions" default="bundle-dist">
<property name="tomcat.major.version" value="7" description="Major version of Tomcat to deploy Pluto war files."/>
<property name="tomcat.full.version" value="7.0.21" description="Full version of Tomcat to deploy Pluto war files."/>
<xmlproperty file="pom.xml"/> <!-- picks up pluto build version from pom file -->
<property name="pluto.version" value="${project.version}" description="Version of Pluto to build"/>
<property name="dist.basedir" value="target/dist" description="Base working directory"/>
<property name="" value="apache-tomcat-${tomcat.full.version}"/>
<property name="dist.dir" value="${dist.basedir}/${}"/>
<property name="" value="pluto-${pluto.version}"/>
<property name="pluto.dir" value="${dist.basedir}/${}"/>
<property name="unzip.file" value="${dist.basedir}/${}.tar.gz"/>
<property name="tar.file" value="${dist.basedir}/${}.tar"/>
<target name="bundle-dist" depends="prepare-bundle-dist,run-maven" description="Creates zip, gzip, and bzip2 distributions">
<!-- Copy over jars needed to deploy custom portlets -->
<copy file="pluto-util/target/pluto-util-${pluto.version}.jar" todir="${dist.dir}/PlutoDomain"/>
<!-- Zip everything up -->
<zip destfile="${dist.basedir}/${}">
<zipfileset prefix="${}" dir="${dist.dir}" includes="**/*"/>
<antcall target="tar-nocompress"/>
<gzip src="${dist.basedir}/${}-bundle.tar"
<bzip2 src="${dist.basedir}/${}-bundle.tar"
<antcall target="clean"/>
<target name="tar-nocompress" description="Creates tar bundled distribution">
<tar destfile="${dist.basedir}/${}-bundle.tar">
<tarfileset prefix="${}" dir="${dist.dir}" mode="755" username="pluto" group="pluto">
<include name="bin/*.sh"/>
<tarfileset prefix="${}" dir="${dist.dir}" username="pluto" group="pluto">
<include name="**/*"/>
<exclude name="bin/*.sh"/>
<target name="prepare-bundle-dist">
<exec executable="mvn" vmlauncher="false" dir="${basedir}" failonerror="true">
<arg line="clean:clean"/>
<mkdir dir="${dist.basedir}"/>
<get src="${tomcat.major.version}/v${tomcat.full.version}/bin/${}.tar.gz"
<gunzip src="${unzip.file}"
description="Creates tar from tar.gz tomcat dist"
<untar src="${tar.file}"
description="Untars tomcat dist"
<!-- Copy over README -->
<copy file="README" todir="${dist.dir}"/>
<!-- Copy over additional licenses from pluto and testsuite web app-->
<copy todir="${dist.dir}" flatten="true">
<fileset dir="${basedir}/pluto-testsuite">
<include name="src/main/webapp/META-INF/*-LICENSE"/>
<copy todir="${dist.dir}" flatten="true">
<fileset dir="${basedir}/pluto-portal">
<include name="src/main/webapp/META-INF/*-LICENSE"/>
<!-- Add sessionCookiePath="/" to root Context in context.xml
(Tomcat 6.0.27+ replacement for emptySessionPath="true" attribute of Connector element in server.xml) -->
<replace file="${dist.dir}/conf/context.xml"
value="&lt;Context sessionCookiePath=&quot;/&quot;&gt;"
<!-- Add 'pluto' and 'tomcat' users to tomcat-users.xml -->
<replace file="${dist.dir}/conf/tomcat-users.xml"
value="&lt;user name=&quot;tomcat&quot; password=&quot;tomcat&quot; roles=&quot;tomcat,pluto,manager&quot; /&gt;${line.separator}&lt;user name=&quot;pluto&quot; password=&quot;pluto&quot; roles=&quot;pluto,manager&quot; /&gt;${line.separator}&lt;/tomcat-users&gt;"
<target name="run-maven" description="Runs maven2 goals">
<exec executable="mvn" vmlauncher="false" dir="${basedir}" failonerror="true">
<arg line="install"/>
<exec executable="mvn" vmlauncher="false" dir="${basedir}" failonerror="true">
<arg line="org.apache.portals.pluto:maven-pluto-plugin:${pluto.version}:install -DinstallDir=${basedir}/${dist.dir}"/>
<target name="clean">
<delete dir="${dist.dir}"/>
<delete file="${unzip.file}"/>
<delete file="${tar.file}"/>