REPO-5271 Backport new structure to master (#22)

- Simplify dependencies and standardise order
- README updated
- Green builds
- Changes to make Jars in enterprise war match
- Changes to make files in enterprise image match
- Added travis_wait 40 to the initial build as it can take 20 minutes to download artifacts
This commit is contained in:
Alan Davis
2020-09-27 10:50:16 +01:00
committed by GitHub
parent 3eb4b282ee
commit 4e4f10d63e
5 changed files with 111 additions and 154 deletions

View File

@@ -38,7 +38,7 @@ stages:
if: fork = false AND (branch != master AND branch !~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no downstream\]/
before_install: travis_retry bash scripts/travis/init.sh
install: travis_retry bash scripts/travis/build.sh
install: travis_retry travis_wait 40 bash scripts/travis/build.sh
jobs:
include:

223
README.md
View File

@@ -1,29 +1,57 @@
# TODO
# alfresco-community-repo
## Create new README for the combined project
[![Build Status](https://travis-ci.com/Alfresco/alfresco-community-repo.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-community-repo)
Original README files:
This project contains the bulk of the [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository) code.
### Alfresco Core
[![Build Status](https://travis-ci.com/Alfresco/alfresco-core.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-core)
To make the development process simpler, it brings together code historically in `alfresco-core`,
`alfresco-data-madel`, `alfresco-repository`, `alfresco-remote-api` and repository specific
tests and war file creation from `acs-community-packaging`. They exist as sub projects within the Maven Reactor and still
create the same artifacts.
Alfresco Core is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
#### Alfresco Core
Alfresco Core is a library packaged as a jar file which contains the following:
* Various helpers and utils
* Canned queries interface and supporting classes
* Generic encryption supporting classes
Version 7 of the library uses Spring 5, Quartz 2.3 and does not have Hibernate dependency.
### Building and testing
The project can be built and tested by running Maven command:
#### Alfresco Data Model
Data model is a library packaged as a jar file which contains the following:
* Dictionary, Repository and Search Services interfaces
* Models for data types and Dictionary implementation
* Parsers
#### Alfresco Repository
Repository is a library packaged as a jar file which contains the following:
* DAOs and SQL scripts
* Various Service implementations
* Utility classes
Tests are combined into test classes split by test type or Spring application context used in the test, see classes
in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test
class name and a set of DB connection properties. Check the travis.yml file for docker images that should be started
to provide a sutable test environment. For example:
~~~
mvn clean install
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
~~~
### Artifacts
#### Alfresco Remote API
Remote API is a library packaged as a jar file which contains the following:
* REST API framework
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
Like the `alfresco-repository` tests are combined in test classes split by test type or Spring application context used
in the test.
#### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* downloading from [Alfresco maven repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
@@ -31,150 +59,83 @@ The artifacts can be obtained by:
<artifactId>alfresco-core</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Old version history
The history for older versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/services/alfresco-core/)
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
### Alfresco Data Model
[![Build Status](https://travis-ci.com/Alfresco/alfresco-data-model.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-data-model)
Data model is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* Dictionary, Repository and Search Services interfaces
* Models for data types and Dictionary implementation
* Parsers
Please note that the data model uses version 2 of the Jackson libraries.
The upgrade from version 1 was not backward compatible, any projects
that are dependent on data model using Jackson 1.x should use the data-model 6.N branch.
Version 8.0 of data-model depends on alfresco-core 7.0 which is based on Spring 5.
### Building and testing
The project can be built and tested by running Maven command:
~~~
mvn clean install
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-data-model</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Old version history
The history for older versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/data-model)
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
### Alfresco Repository
[![Build Status](https://travis-ci.com/Alfresco/alfresco-repository.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-repository)
Repository is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* DAOs and SQL scripts
* Various Service implementations
* Utility classes
### Building and testing
The project can be built by running Maven command:
~~~
mvn clean install
~~~
The tests are combined in test classes split by test type or Spring application context used in the test, see classes in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test class name and a set of DB connection properties, for example:
~~~
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-repository</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco Maven repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
### Alfresco Remote API
[![Build Status](https://travis-ci.com/Alfresco/alfresco-remote-api.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-remote-api)
Remote API is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* REST API framework
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
### Building and testing
The project can be built by running Maven command:
~~~
mvn clean install
~~~
The tests are combined in test classes split by test type or Spring application context used in the test, see classes in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test class name and a set of DB connection properties, for example:
~~~
mvn clean test -Dtest=SomeTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-remote-api</artifactId>
<version>version</version>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>content-services-community</artifactId>
<version>version</version>
<type>war</type>
</dependency>
~~~
and Alfresco Maven repository:
and Alfresco maven repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
The SNAPSHOT versions of the artifact are not published.
All current source versions are held in github. Historic versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/services/alfresco-core/)
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
## Setting up your development environment
Although it is possible to work on individual github projects, we recommend working on
the `alfresco-community-repo`, `alfresco-enterprise-repo`, `acs-packaging` and `acs-community-packaging`
in a single Intellij IDEA project. They depend on each other and typically you
will want to make changes to all of them if you are changing the repository code.
In the case of older branches, there is generally no need for the `acs-community-packaging` as you will
not be creating a community release.
Although it is possible to work on individual github projects, we recommend working on the `alfresco-community-repo`
and `acs-community-packaging` in a single Intellij IDEA project. They depend on each other and typically you will
want to make changes to both of them if you are changing the repository code.
~~~
$ mkdir work
$ cd work
$ git clone git@github.com:Alfresco/alfresco-community-repo.git
$ git clone git@github.com:Alfresco/acs-community-packaging.git
~~~
If you wish to build these projects from the command line, use the following commands.
~~~
$ cd alfresco-community-repo
$ mvn clean install -PcommunityDocker -DskipTests=true -Dversion.edition=Community
$ cd ..
$ cd acs-community-packaging
$ mvn clean install -PcommunityDocker -Dmaven.javadoc.skip=true
$ cd ..
~~~
In Itellij IDEA, create a new project using the `work` directory as the source.
* File > New Project from Existing Sources > .../work > Maven
## Branches
As multiple projects have been combined, branch names use the ACS version they are targeting.
For example the code used to create the repository in ACS 6.2.1 in a branch called `releases/6.2.1`.
The actual version number of the **repository artifacts** created by `alfresco-community-repo` are however different.
For example `release/6.2.1` artifacts are `7.183.x`. This adds some complexity, but ensures that
version numbers do not go backwards in existing releases. It also provides some level of
independence between the repository and other ACS components.

View File

@@ -2,7 +2,7 @@
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
FROM alfresco/alfresco-base-tomcat:8.5.51-java-11-openjdk-centos-7
# Set default docker_context. Will / Can be overriden with maven.
# Set default docker_context.
ARG resource_path=target
# Set default user information
@@ -48,7 +48,8 @@ COPY ${resource_path}/amps ${TOMCAT_DIR}/amps
# Install amps on alfresco.war
RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \
${TOMCAT_DIR}/amps ${TOMCAT_DIR}/webapps/alfresco -directory -nobackup -force
${TOMCAT_DIR}/amps \
${TOMCAT_DIR}/webapps/alfresco -directory -nobackup
# Move the log file
RUN sed -i -e "s_log4j.appender.File.File\=alfresco.log_log4j.appender.File.File\=${TOMCAT_DIR}/logs\/alfresco.log_" \
@@ -69,14 +70,13 @@ RUN yum install -y fontconfig-2.13.0-4.3.el7 \
dejavu-sans-fonts-2.33-6.el7 && \
yum clean all
# Generate default keystore. Please generate new one for production systems
# Generate default keystore. Please generate a new one for production systems
ARG CERT_DNAME="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
ARG CERT_VALIDITY=36525
ARG KEYSTORE_PASSWORD=mp6yc0UD9e
RUN mkdir ${TOMCAT_DIR}/shared/classes/alfresco/keystore && \
keytool -genseckey -dname "$CERT_DNAME" -validity ${CERT_VALIDITY} -alias metadata -keyalg AES -keysize 256 -keystore ${TOMCAT_DIR}/shared/classes/alfresco/keystore/keystore -storetype pkcs12 -storepass ${KEYSTORE_PASSWORD}
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,
# group only has restricted permissions and world has no permissions.
RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
@@ -95,7 +95,10 @@ RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
chmod o-w ${TOMCAT_DIR}/logs && \
chmod g+rwx ${TOMCAT_DIR}/temp && \
chmod g+rwx ${TOMCAT_DIR}/work && \
chmod o-w ${TOMCAT_DIR}/work
chmod o-w ${TOMCAT_DIR}/work && \
chmod 664 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
find /licenses -type d -exec chmod 0755 {} \; && \
find /licenses -type f -exec chmod 0644 {} \;
EXPOSE 10001

View File

@@ -18,7 +18,6 @@
</modules>
<properties>
<!-- TAS tests require an old version -->
<dependency.org-json.version>20170516</dependency.org-json.version>
</properties>
</project>

26
pom.xml
View File

@@ -21,30 +21,23 @@
</modules>
<properties>
<!-- Set to "Community Early Access" to add to the version.edition property in version.properties -->
<version.edition>Community</version.edition>
<licenseName>community</licenseName>
<alfresco.package.name>alfresco-community</alfresco.package.name>
<build-number>local</build-number>
<!-- The values set in version.properties. acs.version.label may be overridden in alfresco-enterprise-repo -->
<acs.version.major>7</acs.version.major>
<acs.version.minor>0</acs.version.minor>
<acs.version.revision>0</acs.version.revision>
<acs.version.label />
<version.edition>Community</version.edition>
<licenseName>community</licenseName>
<build-number>local</build-number>
<image.tag>latest</image.tag>
<image.registry>quay.io</image.registry>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.build.sourceVersion>11</maven.build.sourceVersion>
<image.tag>latest</image.tag>
<image.registry>quay.io</image.registry>
<installer.version.name>${project.version}</installer.version.name>
<alfresco.distribution.name>${alfresco.package.name}-distribution</alfresco.distribution.name>
<dir.root>${project.build.directory}/alf_data</dir.root>
<img.exe>convert</img.exe>
@@ -103,7 +96,7 @@
<alfresco.aos-module.version>1.3.1</alfresco.aos-module.version>
<dependency.postgresql.version>42.2.15</dependency.postgresql.version>
<dependency.mysql.version>8.0.21</dependency.mysql.version>
<dependency.mysql.version>8.0.19</dependency.mysql.version>
<dependency.mariadb.version>2.6.2</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.21</dependency.tas-utility.version>
@@ -481,7 +474,8 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${dependency.bouncycastle.version}</version>
<version>1.65</version>
<!-- <version>${dependency.bouncycastle.version}</version>-->
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>