Addition of Tomcat environment to acs-community-packaging

This commit is contained in:
Alan Davis
2020-10-23 18:51:59 +01:00
parent 9353da6901
commit ec3cae2153
16 changed files with 1053 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ env:
- TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts - TAS_SCRIPTS=../alfresco-community-repo/packaging/tests/scripts
- TAS_ENVIRONMENT=./tests/environment - TAS_ENVIRONMENT=./tests/environment
# Release version has to start with real version (7.0.0-....) for the docker image to build successfully. # Release version has to start with real version (7.0.0-....) for the docker image to build successfully.
- RELEASE_VERSION=7.0.0-A9 - RELEASE_VERSION=7.0.0-A10
- DEVELOPMENT_VERSION=7.0.0-SNAPSHOT - DEVELOPMENT_VERSION=7.0.0-SNAPSHOT
stages: stages:

104
dev/README.md Normal file
View File

@@ -0,0 +1,104 @@
# Development Tomcat Environment
It is possible to use Docker containers to test your code, but it is normally more convenient to simply run the
repository webapp (`alfresco.war`) in a tomcat instance.
## Build -repo projects
Build the `alfresco-community-repo` (if you have not done so already), so that your changes are in the enterprise alfresco.war file.
~~~
cd alfresco-community-repo
mvn clean install -PcommunityDocker -DskipTests=true -Dversion.edition=Community
cd ..
cd alfresco-enterprise-repo
mvn clean install -PenterpriseDocker -DskipTests=true -Dmaven.javadoc.skip=true
cd ..
~~~
## Docker test environment
The repository code will need to talk to other ACS components, such as a databases, message queue and transformers.
The simplest way to create these, is to use the `docker-compose.yml` file in the `dev` directory.
~~~
cd acs-community-packaging
docker-compose -f dev/docker-compose.yml up -d
~~~
## Alfresco Global Properties and Log4j
Set any alfresco-global.properties or log4j properties you may need in the following files. They will be copied
to the `dev/dev-acs-amps-overlay/target` directory. Other customisations may also be placed in the `extension` directory.
~~~
dev/dev-tomcat/src/main/tomcat/shared/classes/alfresco/extension/custom-log4j.properties
dev/dev-tomcat/src/main/tomcat/shared/classes/alfresco-global.properties
~~~
## Tomcat
Create the development tomcat environment, apply AMPs on top of the repository code, and
run tomcat. The `run` profile is what starts tomcat. The `withShare` applies
the Share services AMP and adds the `share.war` to tomcat.
Once started, you will be able to access Share on `http://localhost:8080/share` and various repository
endpoints via `http://localhost:8080/alfresco/`. `entT` is an alias for the
following command and `entTDebug` will allow a debugger to be attached.
~~~
$ # The alias entT is the same as the following mvn command. entTDebug may also be used.
$ mvn clean install -Prun,withShare
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Alfresco Content Services Community Packaging [pom]
[INFO] Alfresco Content Services Community Distribution zip [jar]
[INFO] Alfresco Content Services Public API Javadoc [pom]
[INFO] ACS Community Docker Image Builder for Alfresco Community [pom]
[INFO] Scanning for projects...
[INFO] --------------------------------[ pom ]---------------------------------
...
INFO: Starting ProtocolHandler ["http-bio-8080"]
~~~
If you kill the tomcat instance (^C) and wish to restart it, use the following command
or the `entO` alias, or `entODebug` to attach a debuger.
~~~
$ mvn install -Prun,withShare -rf dev-acs-amps-overlay
~~~
## Clean up
When finished, kill the tomcat instance and stop the Docker instances. You will normally also
remove the Docker containers, as you will need a clean database if you are going to issue
another `mvn clean install` command.
~~~
$ ^C
... Stopped 'sysAdmin' subsystem, ID: [sysAdmin, default]
$ docker-compose -f dev/docker-compose.yml stop
Stopping dev_transform-core-aio_1 ... done
Stopping dev_transform-router_1 ... done
Stopping dev_solr6_1 ... done
Stopping dev_postgres_1 ... done
Stopping dev_activemq_1 ... done
Stopping dev_shared-file-store_1 ... done
$ docker-compose -f dev/docker-compose.yml rm
Going to remove dev_transform-core-aio_1, dev_transform-router_1, dev_solr6_1, dev_postgres_1, dev_activemq_1, dev_shared-file-store_1
Are you sure? [yN] y
Removing dev_transform-core-aio_1 ... done
Removing dev_transform-router_1 ... done
Removing dev_solr6_1 ... done
Removing dev_postgres_1 ... done
Removing dev_activemq_1 ... done
Removing dev_shared-file-store_1 ... done
~~~
If you have not removed the containers, it is possible to restart the tomcat instance with
a `mvn install` (no `clean`), but this may result in failures if there are incompatibilities
between the code, database and content in `dev/dev-acs-amps-overlay/target/dev-instance/runtime/alf_data`.
Any changes made to alfresco-global properties or log4j will not be picked up, unless you
directly edit `dev/dev-acs-amps-overlay/target/dev-instance/tomcat/shared/classes/alfresco/extension/custom-log4j.properties`
and `dev/dev-acs-amps-overlay/target/dev-instance/tomcat/shared/classes/alfresco-global.properties`, but they will be thrown away
on the next `mvn clean`.
## Aliases
You may also find the aliases specified in the following file useful, as they may save you some typing.
~~~
$ source acs-community-packaging/dev/aliases
~~~

53
dev/aliases Executable file
View File

@@ -0,0 +1,53 @@
# The aliases in this script provide simple commands to build projects, start tomcat and combinations of these. This
# give the flexibility to only rebuild or repackage parts of the codebase that have changed.
#
# Once the repository component has been built, it will need to be combined with other ACS components in the
# acs_community_packaging projects.
#
# When developing code, you will normally not be creating repository docker images, but will be creating war files and
# then running them in a local tomcat instance. To provide the environment needed to do this you will need to start a
# docker-compose environment to provide access to a databases and other ACS components.
#
# Aliases to build a sequence of projects and start tomcat - remember to start a CLEAN docker-compose environment - see envUp
# com - builds alfresco-community-repo & acs-community-packaging
#
# Aliases to build projects WITHOUT creating docker images
# comR - alfresco-community-repo
# comP - acs-community-packaging
#
# Aliases to build projects including DOCKER images
# comRD - alfresco-community-repo
# comPD - acs-community-packaging
# Aliases to start tomcat in a CLEAN environment - remember to start a docker-compose environment - see envUp
# comT - acs-community-packaging
# comTDebug - acs-community-packaging (uses mvnDebug to allow a debugger to be attached)
# Aliases to start tomcat REUSING an existing environment (database and alf_data directory)
# comO - acs-community-packaging
# comODebug - acs-community-packaging (uses mvnDebug to allow a debugger to be attached)
export TAG=latest
alias comR='(cd alfresco-community-repo && mvn clean install -DskipTests=true -Dversion.edition=Community)'
alias comP='(cd acs-community-packaging && mvn clean install -Dmaven.javadoc.skip=true)'
alias comRD="(cd alfresco-community-repo && mvn clean install -PcommunityDocker -Dimage.tag=$TAG -DskipTests=true -Dversion.edition=Community)"
alias comPD="(cd acs-community-packaging && mvn clean install -PcommunityDocker -Dimage.tag=$TAG -Drepo.image.tag=$TAG -Dmaven.javadoc.skip=true)"
alias comT=' (cd acs-community-packaging && mvn clean install -Prun,withShare)'
alias comTDebug='(cd acs-community-packaging && mvnDebug clean install -Prun,withShare)'
alias comO=' (cd acs-community-packaging && mvn install -Prun,withShare -rf dev/dev-acs-amps-overlay)'
alias comODebug='(cd acs-community-packaging && mvnDebug install -Prun,withShare -rf dev/dev-acs-amps-overlay)'
alias com='comR && comP && comT'
alias comD='comRD && comPD'
# Clean up of docker images and content stores (alf_data directories)
alias drm='docker rm -f $(docker ps -q)'
alias arm='rm -rf `find . -name alf_data`'
alias envUp='docker-compose -f acs-community-packaging/dev/docker-compose.yml up'
alias envStop='docker-compose -f acs-community-packaging/dev/docker-compose.yml stop'
alias envKill='docker-compose -f acs-community-packaging/dev/docker-compose.yml kill'
alias envRm='docker-compose -f acs-community-packaging/dev/docker-compose.yml rm'

View File

@@ -0,0 +1,170 @@
#!/bin/bash -ex
# Script: cherry-pick-old-projects-setup.sh
#
# ***********************************************************************************************************
# ***** BEFORE RUNNING, edit the calls to setupRemotes (approx line 100) to specify the source branch ******
# ***** (2nd arg) to be checked out. ******
# ***********************************************************************************************************
#
# Clones and moves files in local copies of the the original repository projects to make it easier to cherry
# pick commits into alfresco-community-repo and alfresco-enterprise-repo. Run from a folder that contains
# alfresco-enterprise-repo and alfresco-enterprise-repo projects. The clones of the original projects are
# placed in a folder called oldRepos. Once run these projects will be set up as remotes to the new projects
# ready to allow cherry picking of commits.
if [[ ! -d alfresco-community-repo || ! -d alfresco-enterprise-repo ]]
then
echo "Script MUST be run in the parent folder of alfresco-community-repo and alfresco-enterprise-repo"
exit 1
fi
baseDir=`pwd`
oldReposDirName=oldRepos
oldReposDir=$baseDir/$oldReposDirName
mkdir -p $oldReposDir
#
# Moves the contents of the current folder to a new sub folder.
#
moveContent()
{
oldFolder=$1
newModule=$2
mkdir -p ${newModule}/$oldFolder
for file in `ls -a $oldFolder`
do
if [[ $file != ".git" && $file != ".." && $file != "." && $file != ".tmp" && $file != "${newModule}" ]]
then
git mv $oldFolder/$file ${newModule}/$oldFolder
fi
done
git commit -a -m "Moved content to new ${newModule} module" | grep -v "rename "
}
mvCommit()
{
from=$1
to=$2
echo git mv $from $to
git mv $from $to
if [[ -z "$(ls -A .tmp)" ]]
then
rmdir .tmp
fi
git commit -a -m "Moved $from to $to" | grep -v "rename "
}
#
# Moves all the root folder contents of a branch to a named folder in the root folder.
#
setupRemotes()
{
oldRepo=$1
oldBranch=$2
newRepo=$3
newModule=$4
echo
echo
cd $oldReposDir
rm -rf $oldRepo
git clone --single-branch --branch $oldBranch git@github.com:Alfresco/${oldRepo}.git
cd $oldRepo
count=`find . -type f | grep -v '^\.\/.git\/' | wc -l`
echo Move $count files in $oldRepo
# As the alfresco-repository src folder has so many files, the git mv and git commit commands fail,
# so let's do it in several parts
if [[ "$oldRepo" = "alfresco-repository" ]]
then
mkdir .tmp
mvCommit src/main/java/org/alfresco/repo .tmp/repo
mvCommit src/main/resources .tmp/resources
moveContent . $newModule
mvCommit .tmp/repo ${newModule}/src/main/java/org/alfresco/repo
mvCommit .tmp/resources ${newModule}/src/main/resources
else
moveContent . $newModule
fi
}
# source project branch target project module
setupRemotes alfresco-core master alfresco-community-repo core
setupRemotes alfresco-data-model master alfresco-community-repo data-model
setupRemotes alfresco-repository master alfresco-community-repo repository
setupRemotes alfresco-remote-api master alfresco-community-repo remote-api
setupRemotes acs-community-packaging develop alfresco-community-repo packaging
setupRemotes alfresco-enterprise-repository master alfresco-enterprise-repo repository
setupRemotes alfresco-enterprise-remote-api master alfresco-enterprise-repo remote-api
setupRemotes acs-packaging master alfresco-enterprise-repo packaging
#
# Add remotes and fetch original projects
#
echo
echo
cd $baseDir
cd alfresco-community-repo
git remote add alfresco-core ../$oldReposDirName/alfresco-core
git remote add alfresco-data-model ../$oldReposDirName/alfresco-data-model
git remote add alfresco-repository ../$oldReposDirName/alfresco-repository
git remote add alfresco-remote-api ../$oldReposDirName/alfresco-remote-api
git remote add acs-community-packaging ../$oldReposDirName/acs-community-packaging
git config merge.renameLimit 999999
git fetch alfresco-core | grep -v 'new tag]'
git fetch alfresco-data-model | grep -v 'new tag]'
git fetch alfresco-repository | grep -v 'new tag]'
git fetch alfresco-remote-api | grep -v 'new tag]'
git fetch acs-community-packaging | grep -v 'new tag]'
cd ..
cd alfresco-enterprise-repo
git remote add alfresco-enterprise-repository ../$oldReposDirName/alfresco-enterprise-repository
git remote add alfresco-enterprise-remote-api ../$oldReposDirName/alfresco-enterprise-remote-api
git remote add acs-packaging ../$oldReposDirName/acs-packaging
git config merge.renameLimit 999999
git fetch alfresco-enterprise-repository | grep -v 'new tag]'
git fetch alfresco-enterprise-remote-api | grep -v 'new tag]'
git fetch acs-packaging | grep -v 'new tag]'
cd ..
#
# remote remove repositories
#
echo You may now cherry pick to alfresco-community-repo and alfresco-enterprise-repo
echo after you press RETURN the remotes will be removed.
read DONE
cd alfresco-community-repo
git remote remove alfresco-core
git remote remove alfresco-data-model
git remote remove alfresco-repository
git remote remove alfresco-remote-api
git remote remove acs-community-packaging
git config --unset merge.renameLimit
cd ..
cd alfresco-enterprise-repo
git remote remove alfresco-enterprise-repository
git remote remove alfresco-enterprise-remote-api
git remote remove acs-packaging
git config --unset merge.renameLimit
cd ..
rm -rf $oldReposDir

View File

@@ -0,0 +1,358 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-acs-community-amps-overlay</artifactId>
<name>Content Services WAR with amps</name>
<packaging>war</packaging>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-dev-community-tomcat-env</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<properties>
<tomcat.version>7.0.86</tomcat.version>
<tomcat.default.solr6.port>8983</tomcat.default.solr6.port>
</properties>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>content-services-community</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-share-services</artifactId>
<type>amp</type>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<finalName>alfresco</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<overlays>
<overlay>
<groupId>org.alfresco</groupId>
<artifactId>content-services-community</artifactId>
<type>war</type>
</overlay>
<overlay>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-share-services</artifactId>
<type>amp</type>
</overlay>
</overlays>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
<executions>
<execution>
<id>prepare-exploded-war</id>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<systemProperties>
<index.subsystem.name>solr6</index.subsystem.name>
<solr.port>${tomcat.default.solr6.port}</solr.port>
<dir.root>${runtime.data.folder}/alf_data</dir.root>
<solr.host>localhost</solr.host>
<solr.base.url>/solr</solr.base.url>
<solr.secureComms>none</solr.secureComms>
<encryption.keystore.type>pkcs12</encryption.keystore.type>
<encryption.cipherAlgorithm>AES/CBC/PKCS5Padding</encryption.cipherAlgorithm>
<encryption.keyAlgorithm>AES</encryption.keyAlgorithm>
<metadata-keystore.password>mp6yc0UD9e</metadata-keystore.password>
<metadata-keystore.aliases>metadata</metadata-keystore.aliases>
<metadata-keystore.metadata.password>mp6yc0UD9e</metadata-keystore.metadata.password>
<metadata-keystore.metadata.algorithm>AES</metadata-keystore.metadata.algorithm>
</systemProperties>
<delegate>false</delegate>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
<contextFile>${runtime.tomcat.conf.folder}/alfresco-context.xml</contextFile>
<tomcatUsers>${runtime.tomcat.conf.folder}/tomcat-users.xml</tomcatUsers>
<webapps>
<webapp>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-server-root</artifactId>
<version>${dependency.alfresco-server-root.version}</version>
<contextPath>/</contextPath>
<type>war</type>
<asWebapp>true</asWebapp>
<!-- Workaround for https://issues.apache.org/jira/browse/MTOMCAT-269 -->
<!-- tomcat7-maven-plugin does not pick up the context.xml file from META-INF -->
<contextFile>${project.build.directory}/tomcat/webapps/alfresco-server-root/META-INF/context.xml</contextFile>
</webapp>
<webapp>
<groupId>org.alfresco</groupId>
<artifactId>api-explorer</artifactId>
<version>${alfresco.api-explorer.version}</version>
<contextPath>/api-explorer</contextPath>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper-el</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-el-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-tribes</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina-ha</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-annotations-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-log4j</artifactId>
<version>${tomcat.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- Download and unpack the tomcat config zip file -->
<execution>
<id>unpack-tomcat-config</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/tomcat-conf</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-dev-community-tomcat</artifactId>
<version>${project.version}</version>
<classifier>config</classifier>
<overWrite>true</overWrite>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Copy tomcat config from build directory to correct location -->
<!--
Q. Why not unpack directly to ${runtime.tomcat.conf.folder} ?
A. There is no way of telling maven NOT to overwrite the directory if it is already there.
overWrite doesn't work, overWriteIfNewer doesn't work either. The plugin uses marker files
to determine whether the zip has already been unpacked, rather than using the actual folder
where the contents are being unpacked - so if a clean is performed the marker files disappear
and the zip is unpacked regardless (overwriting your customised tomcat config). Whilst you
can change the location of the marker files, doing things this way really is going to be more
reliable, since the existing directory will be respected properly.
-->
<execution>
<id>copy-tomcat-config</id>
<goals>
<goal>run</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<if>
<available file="${runtime.tomcat.conf.folder}" type="dir"/>
<then>
<echo message="Skipping creation of tomcat configuration, already exists: ${runtime.tomcat.conf.folder}"/>
</then>
<else>
<echo message="Creating tomcat runtime configuration: ${runtime.tomcat.conf.folder}"/>
<copy todir="${runtime.tomcat.conf.folder}">
<fileset dir="${project.build.directory}/tomcat-conf"/>
</copy>
</else>
</if>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>20020829</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>run</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>run-exploded-webapp</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>withShare</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<webapps combine.children="append">
<webapp>
<groupId>org.alfresco</groupId>
<artifactId>share</artifactId>
<contextPath>/share</contextPath>
<version>${alfresco.share.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
</configuration>
<!-- Workaround required to make Share work after Tika upgrade -->
<dependencies>
<dependency>
<groupId>org.apache.sis.core</groupId>
<artifactId>sis-utility</artifactId>
<version>0.6</version>
</dependency>
<dependency>
<groupId>org.apache.sis.core</groupId>
<artifactId>sis-metadata</artifactId>
<version>0.6</version>
</dependency>
<dependency>
<groupId>org.apache.sis.storage</groupId>
<artifactId>sis-storage</artifactId>
<version>0.6</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

62
dev/dev-tomcat/pom.xml Normal file
View File

@@ -0,0 +1,62 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-dev-community-tomcat</artifactId>
<name>Tomcat Configuration</name>
<packaging>pom</packaging>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-dev-community-tomcat-env</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<properties>
<dev.tomcat.conf.folder>${basedir}/src/main/tomcat</dev.tomcat.conf.folder>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<id>dev-tomcat-config-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<attach>true</attach>
<descriptors>
<descriptor>src/assembly/tomcat-conf.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<executions>
<!-- Read alfresco-global.properties if it exists, to use it for cleaning runtime data (e.g. which database?) -->
<execution>
<id>read-alfresco-global-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${alfresco.properties.file}</file>
</files>
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
<!-- To build this, run "mvn package assembly:assembly" -->
<id>config</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${dev.tomcat.conf.folder}</directory>
<outputDirectory/>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="${project.build.directory}/${project.build.finalName}" path="/alfresco">
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}" />
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${runtime.tomcat.conf.folder}/shared/classes" />
</Context>

View File

@@ -0,0 +1,127 @@
alfresco.cluster.interface=127.0.0.1
## Legacy external executables (Docker containers)
alfresco-pdf-renderer.url=http://localhost:8090/
img.url=http://localhost:8090/
jodconverter.url=http://localhost:8090/
tika.url=http://localhost:8090/
transform.misc.url=http://localhost:8090/
jodconverter.enabled=true
##
# PostgreSQL RDBMS
##
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql:${db.name}
db.master.url=jdbc:postgresql:template1
db.master.username=${db.username}
db.master.password=${db.password}
db.drop.command=drop database if exists ${db.name}
db.create.command=create database ${db.name}
##
# MySQL
##
#db.name=alfresco
#db.username=alfresco
#db.password=alfresco
#db.driver=com.mysql.jdbc.Driver
#db.url=jdbc:mysql://localhost/${db.name}?useUnicode=true&characterEncoding=UTF-8
#db.master.url=jdbc:mysql://localhost/
#db.master.username=${db.username}
#db.master.password=${db.password}
#db.drop.command=drop database if exists ${db.name}
#db.create.command=create database ${db.name} CHARACTER SET utf8 COLLATE utf8_bin;
##
# Oracle
##
#db.username=alfresco
#db.password=alfresco
#db.host=localhost
#db.master.username=SYS AS SYSDBA
#db.master.password=alfresco
#db.url=jdbc:oracle:thin:@${db.host}:1521/ORCL
#db.driver=oracle.jdbc.OracleDriver
#db.drop.command=drop user ${db.username} cascade;
#db.create.command=grant connect,resource to ${db.username} identified by ${db.password};
##
# SQL Server
##
#db.name=alfresco
#db.username=alfresco
#db.password=alfresco
#db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#db.url=jdbc:sqlserver://${db.host};databaseName=${db.name};
#db.master.url=jdbc:sqlserver://${db.host};databaseName=master
#db.master.username=${db.username}
#db.master.password=${db.password}
#db.drop.command=drop database ${db.name};
#db.create.command=CREATE DATABASE ${db.name}; ALTER DATABASE ${db.name} SET ALLOW_SNAPSHOT_ISOLATION ON;
##
# H2
##
#db.name=alfresco
#db.username=alfresco
#db.password=alfresco
#db.params=MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=TRUE
#db.driver=org.h2.jdbcx.JdbcDataSource
#db.url=${db.master.url}
#db.master.url=jdbc:h2:${test.working.dir}/h2_data/${db.name};${db.params}
#db.master.username=${db.username}
#db.master.password=${db.password}
#db.drop.command=drop database if exists ${db.name}
#db.create.command=create database ${db.name}
##
# MariaDB
##
#db.name=alfresco
#db.username=alfresco
#db.password=alfresco
#db.driver=org.gjt.mm.mysql.Driver
#db.url=jdbc:mysql://localhost/${db.name}
#db.master.url=jdbc:mysql://localhost/
#db.master.username=${db.username}
#db.master.password=${db.password}
#db.drop.command=drop database if exists ${db.name}
#db.create.command=create database ${db.name}
solr.solrPingCronExpression=0 0/30 * * * ? *
solr.secureComms=none
index.subsystem.name=solr6
solr.host=localhost
solr.port=8983
Dsolr.base.url=/solr
transform.service.enabled=true
# Check every minute rather than the default of every hour
mimetype.config.cronExpression=0 0/1 * * * ?
rendition.config.cronExpression=2 0/1 * * * ?
local.transform.service.cronExpression=4 0/1 * * * ?
transform.service.cronExpression=6 0/1 * * * ?
# To switch to 5 T-Engines set ...core-aio.url to an empty string and add in the individual urls.
# Then comment in/out images in the BAT docker-compose
#localTransform.core-aio.url=
#localTransform.pdfrenderer.url=http://localhost:8090/
#localTransform.imagemagick.url=http://localhost:8091/
#localTransform.libreoffice.url=http://localhost:8092/
#localTransform.tika.url=http://localhost:8093/
#localTransform.misc.url=http://localhost:8094/
alfresco.host=localhost
alfresco.port=8080
share.host=localhost
share.port=8080

View File

@@ -0,0 +1,22 @@
log4j.logger.org.alfresco.repo.content.transform.TransformerDebug=debug
#log4j.logger.org.alfresco.util.exec.RuntimeExecBootstrapBean=debug
#log4j.logger.org.alfresco.util.exec.RuntimeExec=debug
#log4j.logger.org.alfresco.repo.rendition2=debug
#log4j.logger.org.alfresco.repo.content.metadata=debug
#log4j.logger.org.alfresco.repo.rendition2.LocalTransformClient=debug
#log4j.logger.org.alfresco.repo.rendition2.LegacyTransformClient=debug
#log4j.logger.org.alfresco.repo.rendition.RenditionServiceImpl=debug
#log4j.logger.org.alfresco.enterprise.repo.rendition2.RemoteTransformClient=debug
#log4j.logger.org.alfresco.repo.content.transform.LocalTransformServiceRegistry=debug
#log4j.logger.org.alfresco.enterprise.repo.rendition2.RemoteTransformServiceRegistry=debug
#log4j.logger.org.alfresco.repo.rendition2.RenditionDefinitionRegistry2Impl=debug
#log4j.logger.org.alfresco.repo.content.MimetypeMap=debug
#log4j.logger.org.alfresco.repo.content.transform.LocalTransform=debug
#log4j.logger.org.alfresco.repo.rawevents=debug
#log4j.logger.org.alfresco.repo.jscript.RhinoScriptProcessor=debug
#log4j.logger.RhinoScriptProcessor.calls=debug

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="${solr.solr.home}" override="true"/>
<Environment name="solr/model/dir" type="java.lang.String" value="${solr.solr.model.dir}" override="true"/>
<Environment name="solr/content/dir" type="java.lang.String" value="${solr.solr.content.dir}" override="true"/>
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/tomcat/webapps/alfresco-solr4" />
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.directory}/tomcat/webapps/alfresco-solr4/WEB-INF/classes" />
</Context>

View File

@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users>
<user username="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repoclient" password="null"/>
<user username="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repository" password="null"/>
</tomcat-users>

60
dev/docker-compose.yml Normal file
View File

@@ -0,0 +1,60 @@
# This docker-compose file will start up the environment needed for testing with T-Engines, ActiveMQ etc.
# Based on the community version in acs-deployment
# Using version 2 as 3 does not support resource constraint options (cpu_*, mem_* limits) for non swarm mode in Compose
version: "2"
services:
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:2.3.5
mem_limit: 1536m
environment:
JAVA_OPTS: " -Xms256m -Xmx1536m"
ports:
- 8090:8090
postgres:
image: postgres:11.7
mem_limit: 512m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
- POSTGRES_DB=alfresco
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- 5432:5432
solr6:
image: alfresco/alfresco-search-services:2.0.0
mem_limit: 2g
environment:
#Solr needs to know how to register itself with Alfresco
- SOLR_ALFRESCO_HOST=alfresco
- SOLR_ALFRESCO_PORT=8080
#Alfresco needs to know how to call solr
- SOLR_SOLR_HOST=solr6
- SOLR_SOLR_PORT=8983
#Create the default alfresco and archive cores
- SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive
#HTTP by default
- ALFRESCO_SECURE_COMMS=none
- "SOLR_JAVA_MEM=-Xms2g -Xmx2g"
ports:
- 8083:8983 #Browser port
activemq:
image: alfresco/alfresco-activemq:5.15.8
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
- 61616:61616 # OpenWire
- 61613:61613 # STOMP
# proxy:
# image: alfresco/acs-community-ngnix:1.0.0
# mem_limit: 128m
# depends_on:
# - alfresco
# ports:
# - 8080:8080

27
dev/pom.xml Normal file
View File

@@ -0,0 +1,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-dev-community-tomcat-env</artifactId>
<name>Development Tomcat Environment</name>
<packaging>pom</packaging>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>acs-community-packaging</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<properties>
<!-- Development Tomcat runtime environment configuration -->
<runtime.data.folder>${project.build.directory}/dev-instance/runtime</runtime.data.folder>
<runtime.tomcat.conf.folder>${project.build.directory}/dev-instance/tomcat</runtime.tomcat.conf.folder>
<alfresco.properties.file>${runtime.tomcat.conf.folder}/shared/classes/alfresco-global.properties</alfresco.properties.file>
</properties>
<modules>
<module>dev-tomcat</module>
<module>dev-acs-amps-overlay</module>
</modules>
</project>

12
pom.xml
View File

@@ -1,15 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>acs-community-packaging</artifactId> <artifactId>acs-community-packaging</artifactId>
<packaging>pom</packaging>
<name>Alfresco Content Services Community Packaging</name> <name>Alfresco Content Services Community Packaging</name>
<version>7.0.0-SNAPSHOT</version> <version>7.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<parent> <parent>
<groupId>org.alfresco</groupId> <groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId> <artifactId>alfresco-community-repo</artifactId>
<relativePath>../alfresco-community-repo/pom.xml</relativePath> <relativePath>../alfresco-community-repo/pom.xml</relativePath>
<version>8.304</version> <version>8.305</version>
</parent> </parent>
<scm> <scm>
@@ -31,7 +31,7 @@
</distributionManagement> </distributionManagement>
<properties> <properties>
<dependency.alfresco-community-repo.version>8.304</dependency.alfresco-community-repo.version> <dependency.alfresco-community-repo.version>8.305</dependency.alfresco-community-repo.version>
<repo.image.tag>${dependency.alfresco-community-repo.version}</repo.image.tag> <repo.image.tag>${dependency.alfresco-community-repo.version}</repo.image.tag>
<share.image.tag>${alfresco.share.version}</share.image.tag> <share.image.tag>${alfresco.share.version}</share.image.tag>
@@ -80,6 +80,12 @@
<module>docker-alfresco</module> <module>docker-alfresco</module>
</modules> </modules>
</profile> </profile>
<profile>
<id>run</id>
<modules>
<module>dev</module>
</modules>
</profile>
</profiles> </profiles>
<dependencyManagement> <dependencyManagement>