Compare commits

...

44 Commits

Author SHA1 Message Date
alfresco-build
f4c3ac7c84 [maven-release-plugin] prepare release alfresco-sdk-aggregator-3.1.0 2019-03-26 18:50:25 +00:00
alfresco-build
af8c6c42c4 [maven-release-plugin] prepare for next development iteration 2019-03-26 16:25:15 +00:00
alfresco-build
e61c08c650 [maven-release-plugin] prepare release alfresco-sdk-aggregator-3.1.0 2019-03-26 16:25:06 +00:00
Ole Hejlskov
3050c9deb4 Bump version to 3.1.0 2019-03-26 16:06:39 +01:00
Jose Luis Osorno
6dc927e668 Archetypes - Update default enterprise version to 5.2.4 2019-03-26 13:12:35 +01:00
Ole Hejlskov
1d551d1895 Merge pull request #531 from Alfresco/bug/sdk-3-bugfixing
BUGFIX - SDK 3.0.1 bug fixing
2019-01-28 12:36:36 +01:00
Jose Luis Osorno
766847585e Fix javadoc errors
- Fix the javadoc error raised by the javadoc-maven-plugin.
- Configure the javadoc-maven-plugin to accept custom javadoc annotations
from maven mojo development.
2019-01-28 12:30:05 +01:00
Ole Hejlskov
b366ae3ddd Merge pull request #530 from Alfresco/bug/255
BUGFIX - 255 - Archetypes - Add JS minification
2019-01-25 11:36:27 +01:00
Ole Hejlskov
19369a23b5 Merge pull request #529 from Alfresco/bug/457
BUGFIX - 457 - Archetypes - Modify IT company home assertion
2019-01-25 11:35:33 +01:00
Jose Luis Osorno
93c28f5dde 255 - Archetypes - Add JS minification
Modify the pom.xml files of the archetypes to include the
yuicompressor-maven-plugin in order to configure the minification
of the JS files.
2019-01-24 17:09:44 +01:00
Jose Luis Osorno
7792574dae 457 - Archetypes - Modify IT company home assertion
Modity the assertion about the name of the company home node in the
integration test DemoComponentIT to avoid issues with the language
in which the Alfresco environment is installed. It asserts now
about the path of the node which is independant from the language
of the application.
2019-01-24 12:34:50 +01:00
Ole Hejlskov
e8976addea Merge pull request #528 from Alfresco/bug/440
BUGFIX - 440 - Maven Plugin - Make Tomcat Maven Plugin version configurable
2019-01-24 11:48:55 +01:00
Jose Luis Osorno
a7f2db61e8 440 - Maven Plugin - Make Tomcat Maven Plugin version configurable
Add a new parameter (tomcatMavenPluginVersion) and maven property
(maven.alfresco.tomcat.maven.plugin.version) to be able to set the version of
the Tomcat Maven Plugin that is going to be used in the Alfresco Maven
Plugin to run the project.

This way, an integrator can create a patched version of the Tomcat Plugin to
solve any issue with it and tell the Alfresco Maven Plugin to use that fixed
version of the Tomcat Plugin. This is helpful with the reported issue about
the maxHttpHeaderSize (https://github.com/Alfresco/alfresco-sdk/issues/440).
2019-01-24 11:37:21 +01:00
Ole Hejlskov
387a584aa1 Merge pull request #525 from Alfresco/bug/420
BUGFIX - 420 - Maven Plugin - Add goal to generate WARs only
2019-01-22 15:15:55 +01:00
Ole Hejlskov
edd8d8317b Merge pull request #524 from Alfresco/bug/425
BUGFIX - 425 - Maven Plugin - Support for platform context file
2019-01-22 15:01:48 +01:00
Jose Luis Osorno
eb30a2d9e2 Merge pull request #491 from tartard/master
BUGFIX - Allow to write test methods in abstract classes
2019-01-22 11:01:33 +01:00
Jose Luis Osorno
cf777840be Merge pull request #496 from tartard/solr-cron
Make the Solr indexation frequency customizable
2019-01-22 10:01:15 +01:00
Jose Luis Osorno
efec137a10 Merge branch 'bug/sdk-3-bugfixing' into solr-cron 2019-01-22 10:00:46 +01:00
Jose Luis Osorno
210bee7d76 420 - Maven Plugin - Add goal to generate WARs only
Add a new goal to the Alfresco Mvane Plugin to be able to generate
the WAR files (platform, share and/or activity if they're enabled)
without the need of running the Tomcat server.
2019-01-22 09:33:39 +01:00
Jose Luis Osorno
534e70a2c4 425 - Maven Plugin - Support for platform context file
Code change migrated from PR https://github.com/Alfresco/alfresco-sdk/pull/431.

Change implemented by the user @pzrinscak.

Modify the Alfresco Maven Plugin to add the possibility to set
a custom Tomcat context file for the platform war. This features
enables the possibility to define custom JNDI resources in the
context of the Alfresco platform application.
2019-01-22 08:21:11 +01:00
Ole Hejlskov
0fcec384fd Merge pull request #523 from Alfresco/bug/469
BUGFIX - 469 - Maven Plugin - AMP files order
2019-01-21 15:59:02 +01:00
Jose Luis Osorno
9d1c2feaf2 469 - Maven Plugin - AMP files order
Modify the Alfresco Maven Plugin in order to take into
account the order in which the AMP modules were defined
as the same order of the AMPs to be applied to the war
files.
2019-01-21 15:16:46 +01:00
Ole Hejlskov
709b820f2c Merge pull request #520 from Alfresco/bug/MNT-19097
BUGFIX - MNT-19097 - Ensure unmount war files
2019-01-21 11:08:00 +01:00
Jose Luis Osorno
217f135006 Merge branch 'bug/sdk-3-bugfixing' into bug/MNT-19097 2019-01-21 11:04:49 +01:00
Ole Hejlskov
64843588f8 Merge pull request #521 from Alfresco/bug/499
BUGFIX - 499 - Maven Plugin - Add the ability to set Tomcat version
2019-01-21 10:59:56 +01:00
Ole Hejlskov
f1a7e645e4 Merge pull request #522 from Alfresco/bug/498
BUGFIX - 498 - Archetypes - Add module-specific log4j.properties to AMPs
2019-01-21 10:54:28 +01:00
Jose Luis Osorno
e3ae54be9b 498 - Archetypes - Add module-specific log4j.properties to AMPs
Add module-specific log4j.properties files to the archetypes and modify the assembly
files to include them in the AMPs. This way, it is possible to add custom log
configuration for each developed module.
2019-01-21 08:28:41 +01:00
Jose Luis Osorno
2871883c7d 499 - Maven Plugin - Add the ability to set Tomcat version
Add a new parameter to the Alfresco Maven Plugin in order to be able to set the
Tomcat version to be executed when running Tomcat through the Tomcat Maven Plugin.

The parameter "tomcatVersion" (or the Maven property "maven.alfresco.tomcat.version")
allows to modify the default Tomcat version used by the Tomcat Maven Plugin. The
default version currently is 7.0.47 (set by the Tomcat Maven Plugin v2.2). If the version
of Tomcat is not set via the plugin parameter or the maven property, then the default
one is used.
2019-01-18 15:56:26 +01:00
Jose Luis Osorno
376815c746 MNT-19097 - Ensure unmount war files
Ensure the unmount of the war files in the alfresco maven plugin to avoid
the exception thrown by the FsSyncShutdownHook.
2019-01-18 12:29:32 +01:00
Ole Hejlskov
f5e3552283 Merge pull request #500 from fcorti/patch-1
Typo in description.
2018-09-18 13:11:05 +02:00
Ole Hejlskov
ab9f384830 Merge pull request #505 from melahn/master
Updated the readme to bring it up-to-date.  See Issue #396
2018-09-18 13:10:42 +02:00
Gregory Melahn
dced89eda6 Updated the readme to bring it up-to-date. See Issue #396 2018-09-13 16:16:19 -04:00
Francesco Corti
3bced985d6 Typo in description.
Suggested from the Community.
(thank you Digicat and Yreg)
2018-06-04 10:07:50 +02:00
a.hausherr
f0210c173a Make the Solr indexation frequency customizable. 2018-04-06 15:21:05 +02:00
tartard
ea521ba7ee Avoid an InstantiationException to be thrown from RunTestWebscript when testing a class which inherits test methods from an abstract class. 2018-03-12 14:20:08 +01:00
Ole Hejlskov
865ae6fd38 Merge pull request #484 from marsv024/runtest_saxparseexception
Fix null check to work with assertEqual-failures and exception messages containing reserved xml characters
2017-11-09 16:49:41 +01:00
Marcus Svartmark
017dfcbff8 Fix null check to work with assertEqual-failures and exception messages containing reserved xml characters 2017-11-09 16:32:35 +01:00
Ole Hejlskov
c25417e702 Deprecate Activiti features. See #481 for more info 2017-09-22 16:40:51 +02:00
Ole Hejlskov
448b5c2929 Merge pull request #475 from tom-vandepoele/master
Feature request: adding support for custom solr config #474
2017-09-22 09:31:43 +01:00
Ole Hejlskov
ab29cc53fa Merge pull request #477 from nklomp/master
Nullpointer in code crashes Freemarker evaluation within Integration Testing
2017-09-22 09:24:50 +01:00
nklomp
228a98c566 Message of Failure delegates to getMessage() of the throwable which can be null in some cases (Nullpointer for instance) causing the Freemarker template evaluation to fail which in turn hides the real problem in the integration test 2017-07-09 19:05:05 +02:00
Tom.Vandepoele
82b7886a51 Feature request: adding support for custom solr config #474 2017-06-29 15:15:54 +02:00
Ole Hejlskov
012dc70f43 Update with 3.0.1 release info 2017-06-23 11:29:07 +02:00
alfresco-build
b8377041a5 [maven-release-plugin] prepare for next development iteration 2017-06-23 10:17:52 +01:00
41 changed files with 666 additions and 103 deletions

View File

@@ -3,10 +3,13 @@
This is the home of the Alfresco SDK. The Alfresco SDK is used by developers to build extensions for the Alfresco Digital Business Platform. It is based on [Apache Maven](http://maven.apache.org/), compatible with major IDEs and enables Rapid Application Development (RAD) and Test Driven Development (TDD).
## License
This project is released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). If you are an Enterprise customer check the [Support](#alfresco-enterprise-customers-and-partners-support) section.
This project is released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license.
If you are an Enterprise customer check the [Support](#alfresco-enterprise-customers-and-partners-support) section.
## News
- 2017-06-23: Alfresco SDK 3.0.1 released, [containing a critical bugfix](https://github.com/Alfresco/alfresco-sdk/issues/461)
- 2017-04-01: Alfresco SDK 3.0.0 released
- 2017-03-27: After years of hard work, countless iterations and gathering feedback, SDK 3.0 has finally been merged into the master branch, ready for release in the coming days
- 2016-02-20: SDK 2.2.0 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html), [Release notes](https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/latest/github-report.html)
- 2015-10-19: SDK 2.1.1 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html)
@@ -18,16 +21,15 @@ This project is released under the [Apache License, Version 2.0](http://www.apac
## User Getting Started
### Latest Documentation
To get started with Alfresco SDK 2.2.0 (latest) visit the offical Alfresco Documentation for:
- [Alfresco Community 5.1 and above](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html)
- [Alfresco Enterprise 5.1 and above](http://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html)
#### Previous versions Documentation
- Documentation for [Alfresco SDK 2.1](http://docs.alfresco.com/sdk2.1/concepts/alfresco-sdk-intro.html) (compatible with Alfresco 5.0.d Community and 5.0.1 Enterprise)
- Documentation for [Alfresco SDK 2.0](http://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html) (compatible with Alfresco 5.0.c Community and 5.0.0 Enterprise)
- Documentation for [Alfresco SDK 1.1.1](http://docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-intro.html) (compatible with Alfresco 4.2)
To get started with **Alfresco SDK 3.0.x** (latest) visit the [Alfresco Documentation](https://docs.alfresco.com/5.2/concepts/sdk-intro.html)
#### Documentation about Previous Versions
| SDK Version | Alfresco Enterprise Version | Alfresco Community Version | Documentation |
| ------------- |:-------------:| :-----:|:-----|
| SDK 2.2 | Alfresco 5.1.x | Alfresco 5.1.x | https://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html |
| SDK 2.1 | Alfresco 5.0.1 | Alfresco 5.0.d | https://docs.alfresco.com/sdk2.1/concepts/alfresco-sdk-intro.html |
| SDK 2.0 | Alfresco 5.0.0 | Alfresco 5.0.c | https://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html |
| SDK 1.1.1 | Alfresco 4.2.x | Alfresco 4.2.x | https://docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-intro.html |
@@ -35,19 +37,22 @@ To get started with Alfresco SDK 2.2.0 (latest) visit the offical Alfresco Docum
Report issues (and contribute!) [here](https://github.com/Alfresco/alfresco-sdk/issues?milestone=1&state=open) or join us on the [IRC Channel](http://chat.alfresco.com/).
## Alfresco Enterprise Customers and Partners Support
If you are an Alfresco Customer please check the [SDK Support status](http://www.alfresco.com/services/subscription/technical-support/product-support-status) for the version you are using and the [Compatibily Matrix](http://docs.alfresco.com/community/concepts/alfresco-sdk-compatibility.html) for the SDK / Alfresco compatibility. If your version is in Limited or Full Support, you can raise issues via the [Support Portal](http://support.alfresco.com).
If you are an Alfresco Customer
please check the [SDK Support status](http://www.alfresco.com/services/subscription/technical-support/product-support-status)
for the version you are using. If your version is in Limited or Full Support and you need help, visit the [Support Portal](http://support.alfresco.com).
## Maven repositories
- As of version 2.0-beta-1, The Alfresco SDK is released in [Maven Central](http://search.maven.org/#search|ga|1|alfresco-sdk). Previous versions are available in the [Alfresco Artifacts Repository](https://artifacts.alfresco.com/).
- Alfresco (Community and Enterprise) artifacts are hosted in the [Alfresco Artifacts Repository](https://artifacts.alfresco.com/).
- Alfresco Community artifacts (JARs, WARs, AMPs, poms) and SDK artifacts are publicly available.
*NOTE:* For Enterprise and Premiere licensed software access you need to get credential via the Alfresco Enterprise Support. See [Maven Alfresco Enterprise setup](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-using-enterprise-edition.html).
*NOTE:* By default the Alfresco SDK will use Community Edition releases but it can be configured to use Enterprise Edition releases. Enterprise and Premier customers can use the SDK with
Enterprise Edition releases by following the process described in [Working with Enterprise](https://docs.alfresco.com/5.2/concepts/sdk-using-enterprise.html)
### Alfresco Artifacts Repository
#### Alfresco Releases
You can use the following snippet in your pom.xml to access releases on Alfresco Artifact repository:
You can use the following snippet in your pom.xml to access releases from the Alfresco Artifact repository:
```xml
<repository>

View File

@@ -6,13 +6,13 @@
<artifactId>activiti-jar-archetype</artifactId>
<packaging>maven-archetype</packaging>
<name>Alfresco SDK - Activiti JAR Archetype</name>
<description>Sample project with full support for lifecycle and rapid development of Activiti JARs</description>
<name>DEPRECATED - UNSUPPORTED - EXPERIMENTAL: Alfresco SDK - Activiti JAR Archetype</name>
<description>DEPRECATED - UNSUPPORTED - EXPERIMENTAL</description>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -5,10 +5,15 @@
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<name>${artifactId} Activiti Jar Module - SDK 3</name>
<description>Activiti JAR Module that produces a JAR file with Java extensions such as service task delegates. It also produces an application ZIP with workflow definition, forms etc that can be deployed via /activiti-app - SDK 3</description>
<name>DEPRECATED - UNSUPPORTED - EXPERIMENTAL ${artifactId} Activiti Jar Module - SDK 3</name>
<description>DEPRECATED - UNSUPPORTED - EXPERIMENTAL Activiti JAR Module that produces a JAR file with Java extensions such as service task delegates. It also produces an application ZIP with workflow definition, forms etc that can be deployed via /activiti-app - SDK 3</description>
<packaging>jar</packaging>
<!-- DEPRECATION NOTICE -->
<!-- This archetype has been deprecated in SDK 3.1 and will be removed or replaced in SDK 4.0 -->
<!-- This archetype was introduced as experimental support for Activiti 1.5 Enterprise. -->
<!-- The archetype and Activiti/APS features present in the SDK is NOT supported, use at your own risk -->
<properties>
<!-- Alfresco Maven Plugin version to use -->
<alfresco.sdk.version>@@alfresco.sdk.parent.version@@</alfresco.sdk.version>

View File

@@ -6,12 +6,12 @@
<artifactId>alfresco-allinone-archetype</artifactId>
<packaging>maven-archetype</packaging>
<name>Alfresco SDK - All-in-One Archetype</name>
<description>Sample multi-module project for All-in-One development on the Alfresco plaftorm. Includes modules for Platform/Repository JAR and Share JAR</description>
<description>Sample multi-module project for All-in-One development on the Alfresco platform. Includes modules for Platform/Repository JAR and Share JAR</description>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -35,6 +35,11 @@
<source>src/main/assembly/file-mapping.properties</source>
<filtered>false</filtered>
</file>
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
<file>
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
<filtered>false</filtered>
</file>
</files>
<fileSets>

View File

@@ -35,6 +35,11 @@
<source>src/main/assembly/file-mapping.properties</source>
<filtered>false</filtered>
</file>
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
<file>
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
<filtered>false</filtered>
</file>
</files>
<fileSets>

View File

@@ -55,10 +55,9 @@ public class DemoComponentIT extends AbstractAlfrescoIT {
DemoComponent demoComponent = (DemoComponent) getApplicationContext().getBean("${package}.DemoComponent");
NodeRef companyHome = demoComponent.getCompanyHome();
assertNotNull(companyHome);
String companyHomeName = (String) getServiceRegistry().getNodeService().getProperty(
companyHome, ContentModel.PROP_NAME);
assertNotNull(companyHomeName);
assertEquals("Company Home", companyHomeName);
String companyHomePath = getServiceRegistry().getNodeService().getPath(companyHome).toPrefixString(getServiceRegistry().getNamespaceService());
assertNotNull(companyHomePath);
assertEquals("/app:company_home", companyHomePath);
}
@Test

View File

@@ -336,6 +336,56 @@
</configuration>
</plugin>
<!-- Compress JavaScript files and store as *-min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
</executions>
</plugin>
<!-- Hot reloading with JRebel -->
<plugin>
<groupId>org.zeroturnaround</groupId>

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -162,6 +162,56 @@
</configuration>
</plugin>
<!-- Compress JavaScript files and store as *-min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
</executions>
</plugin>
<!--
Build an AMP if 3rd party libs are needed by the extensions
JARs are the default artifact produced in your modules, if you want to build an amp for each module

View File

@@ -35,6 +35,11 @@
<source>src/main/assembly/file-mapping.properties</source>
<filtered>false</filtered>
</file>
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
<file>
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
<filtered>false</filtered>
</file>
</files>
<fileSets>

View File

@@ -0,0 +1 @@
# Add here module-specific custom log4j.properties configuration

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -95,6 +95,56 @@
</configuration>
</plugin>
<!-- Compress JavaScript files and store as *-min.js -->
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<!-- Compress the JS files under the assembly folder -->
<execution>
<id>compress-assembly</id>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<sourceDirectory>${project.basedir}/src/main/assembly/web</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/assembly/web</outputDirectory>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/META-INF/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
<!-- Compress the JS files under the resources folder -->
<execution>
<id>compress-resources</id>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<excludes>
<exclude>**/webscripts/**</exclude>
<exclude>**/site-webscripts/**</exclude>
<exclude>**/*.lib.js</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*-min.js</exclude>
<exclude>**/*-min.css</exclude>
</excludes>
<force>true</force>
<jswarn>false</jswarn>
</configuration>
</execution>
</executions>
</plugin>
<!-- Build an AMP if 3rd party libs are needed by the extension -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>

View File

@@ -35,6 +35,11 @@
<source>src/main/assembly/file-mapping.properties</source>
<filtered>false</filtered>
</file>
<!-- Add module-specific log4j.properties configuration at top level in the AMP -->
<file>
<source>src/main/resources/alfresco/module/${project.artifactId}/log4j.properties</source>
<filtered>false</filtered>
</file>
</files>
<fileSets>

View File

@@ -0,0 +1 @@
# Add here module-specific custom log4j.properties configuration

View File

@@ -10,7 +10,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -51,7 +51,7 @@ public class SpringContextHolder implements ApplicationContextAware {
/**
* Return the singleton instance
*
* @return
* @return the singleton instance
*/
public static SpringContextHolder Instance() {
return springContextHolderInstance;

View File

@@ -46,6 +46,7 @@ import javax.xml.parsers.ParserConfigurationException;
import java.io.*;
/**
* <p>
* This is a JUnit test runner that is designed to work with an Alfresco repository.
* It detects if it's executing a test inside of a running Alfresco instance. If that
* is the case the tests are all run normally. If however the test is being run from
@@ -54,14 +55,15 @@ import java.io.*;
* test an HTTP request is made to a Web Script in a running Alfresco instance. This
* Web Script runs the test and returns enough information to this class so we can
* emulate having run the test locally.
* <p/>
* </p>
* <p>
* By doing this, we are able to create Integration Tests (IT) using standard JUnit
* capabilities. These can then be run from our IDEs with the associated visualizations,
* support for re-running failed tests, etc.
* <p/>
* </p>
* Integration testing framework donated by Zia Consulting
*
* @author Bindu Wavell <bindu@ziaconsulting.com>
* @author Bindu Wavell (bindu@ziaconsulting.com)
* @author martin.bergljung@alfresco.com (some editing)
* @since 3.0
*/
@@ -104,13 +106,13 @@ public class AlfrescoTestRunner extends BlockJUnit4ClassRunner {
* Call a remote Alfresco server and have the test run there.
*
* @param method the test method to run
* @param notifier
* @param desc
* @param notifier given @{@link RunNotifier} to notify the result of the test
* @param desc given @{@link Description} of the test to run
*/
protected void callProxiedChild(FrameworkMethod method, RunNotifier notifier, Description desc) {
notifier.fireTestStarted(desc);
String className = method.getMethod().getDeclaringClass().getCanonicalName();
String className = this.getTestClass().getJavaClass().getCanonicalName();
String methodName = method.getName();
if (null != methodName) {
className += "#" + methodName;
@@ -232,8 +234,8 @@ public class AlfrescoTestRunner extends BlockJUnit4ClassRunner {
* Check the @Remote config on the test class to see where the
* Alfresco Repo is running
*
* @param method
* @return
* @param method given @{@link FrameworkMethod} to be executed
* @return the ACS endpoint
*/
protected String getContextRoot(FrameworkMethod method) {
Class<?> declaringClass = method.getMethod().getDeclaringClass();

View File

@@ -24,14 +24,15 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>
* By default the ${@link AlfrescoTestRunner} will attempt to find a
* running Alfresco instance at http://localhost:8080/alfresco
* This annotation can be applied to a test class to have the
* proxy calls go to a different host/port.
* <p/>
* </p>
* Integration testing framework donated by Zia Consulting.
*
* @author Bindu Wavell <bindu@ziaconsulting.com>
* @author Bindu Wavell (bindu@ziaconsulting.com)
* @since 3.0
*/
@Target(ElementType.TYPE)

View File

@@ -35,14 +35,15 @@ import java.util.List;
import java.util.Map;
/**
* <p>
* This Web Script works in consort with the ${@link AlfrescoTestRunner}. When a test is run from an IDE or
* command line, the Alfresco test runner sends a proxied request to perform the test to this script. This runs
* the test and wraps the results up so that the test initiator can be fooled into thinking they are
* running the tests locally.
* <p/>
* </p>
* Integration testing framework donated by Zia Consulting.
*
* @author Bindu Wavell <bindu@ziaconsulting.com>
* @author Bindu Wavell (bindu@ziaconsulting.com)
* @author martin.bergljung@alfresco.com (some editing)
* @since 3.0
*/

View File

@@ -25,7 +25,7 @@
<#if failures??>
<#list failures as failure>
<div id="testHeader"><b>${failure.getTestHeader()?html}</b></div>
<div id="message"><a href="#" onclick="showdiv('trace');return false;">${failure.getMessage()?html}</a></div>
<div id="message"><a href="#" onclick="showdiv('trace');return false;">${failure.getMessage()!""?html}</a></div>
<div id="trace" style="display:none;"><pre>${failure.getTrace()?html}</pre></div>
<br/>
</#list>

View File

@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<response>
<test>${test?html}</test>
<result>${result?html}</result>
<test>${test?xml}</test>
<result>${result?xml}</result>
<#if failures??>
<failures>
<#list failures as failure>
<trace>${failure.getTrace()?html}</trace>
<exception>${failure.getException()?html}</exception>
<message>${failure.getMessage()?html}</message>
<testHeader>${failure.getTestHeader()?html}</testHeader>
<trace>${failure.getTrace()?xml}</trace>
<exception>${failure.getException()?xml}</exception>
<message>${failure.getMessage()!?xml}</message>
<testHeader>${failure.getTestHeader()?xml}</testHeader>
</#list>
</failures>
</#if>
<failureCount>${failureCount?html}</failureCount>
<ignoreCount>${ignoreCount?html}</ignoreCount>
<runCount>${runCount?html}</runCount>
<runTime>${runTime?html}</runTime>
<failureCount>${failureCount?xml}</failureCount>
<ignoreCount>${ignoreCount?xml}</ignoreCount>
<runCount>${runCount?xml}</runCount>
<runTime>${runTime?xml}</runTime>
<#if throwables??>
<throwables>
<#list throwables as throwable>
<throwable>${throwable?html}</throwable>
<throwable>${throwable?xml}</throwable>
</#list>
</throwables>
</#if>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -140,6 +140,11 @@
<artifactId>zt-zip</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-kernel</artifactId>
<version>7.7.9</version>
</dependency>
</dependencies>
<reporting>

View File

@@ -164,6 +164,8 @@ public abstract class AbstractRefreshWebappMojo extends AbstractMojo {
/**
* Perform a Refresh of Web Scripts container in webapp.
* Called by specific refresh mojo implementation.
*
* @param url the relative path to refresh webscripts
*/
protected void refreshWebScripts(String url) {
// Create the Refresh URL for the Alfresco Tomcat server
@@ -184,6 +186,8 @@ public abstract class AbstractRefreshWebappMojo extends AbstractMojo {
/**
* Perform a Clear Dependency Caches call on Share webapp.
* Called by specific refresh mojo implementation, currently only applicable to Share webapp.
*
* @param url the relative path to clear cache
*/
protected void clearDependencyCaches(String url) {
// Create the Clear Cache URL for the Alfresco Tomcat server

View File

@@ -17,9 +17,13 @@
*/
package org.alfresco.maven.plugin;
import com.google.common.collect.ImmutableSet;
import de.schlichtherle.truezip.file.TVFS;
import de.schlichtherle.truezip.fs.FsSyncException;
import org.alfresco.maven.plugin.config.ModuleDependency;
import org.alfresco.maven.plugin.config.TomcatDependency;
import org.alfresco.maven.plugin.config.TomcatWebapp;
import org.alfresco.util.Pair;
import org.apache.commons.lang.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -40,6 +44,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.twdata.maven.mojoexecutor.MojoExecutor.*;
@@ -57,7 +62,6 @@ public abstract class AbstractRunMojo extends AbstractMojo {
public static final String MAVEN_INSTALL_PLUGIN_VERSION = "2.5.2";
public static final String MAVEN_REPLACER_PLUGIN_VERSION = "1.5.3";
public static final String MAVEN_RESOURCE_PLUGIN_VERSION = "2.7";
public static final String MAVEN_TOMCAT7_PLUGIN_VERSION = "2.2";
public static final String MAVEN_BUILD_HELPER_PLUGIN_VERSION = "1.12";
public static final String PLATFORM_WAR_PREFIX_NAME = "platform";
@@ -67,6 +71,31 @@ public abstract class AbstractRunMojo extends AbstractMojo {
public static final String ALFRESCO_ENTERPRISE_EDITION = "enterprise";
public static final String ALFRESCO_COMMUNITY_EDITION = "community";
private static final String TOMCAT_GROUP_ID = "org.apache.tomcat";
private static final String TOMCAT_EMBED_GROUP_ID = "org.apache.tomcat.embed";
private static final Set<Pair<String, String>> TOMCAT_DEPENDENCIES = new ImmutableSet.Builder<Pair<String, String>>()
.add(new Pair(TOMCAT_EMBED_GROUP_ID,"tomcat-embed-core"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-util"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-coyote"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-api"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-jdbc"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-dbcp"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-servlet-api"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-jsp-api"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-jasper"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-jasper-el"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-el-api"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-catalina"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-tribes"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-catalina-ha"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-annotations-api"))
.add(new Pair(TOMCAT_GROUP_ID,"tomcat-juli"))
.add(new Pair(TOMCAT_EMBED_GROUP_ID,"tomcat-embed-logging-juli"))
.add(new Pair(TOMCAT_EMBED_GROUP_ID,"tomcat-embed-logging-log4j"))
.build();
private static final String AMP_LOCATION_PATTERN = "%s/%s-%s.amp";
@Component
protected MavenProject project;
@@ -186,6 +215,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
protected boolean enableApiExplorer;
/**
* Deprecated as of SDK 3.1
* Switch to enable/disable Alfresco Activiti Workflow Engine (activiti-app.war) when running embedded Tomcat.
* This contains the Alfresco Activiti webapp, including the workflow engine.
* This webapp is also the user interface for people involved in the task and processes
@@ -197,6 +227,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
protected boolean enableActivitiApp;
/**
* Deprecated as of SDK 3.1
* Switch to enable/disable Alfresco Activiti Admin (activiti-admin.war) when running embedded Tomcat.
* This contains the Alfresco Activiti Administrator webapp. You use this to administer and monitor your
* Alfresco Activiti engines.
@@ -242,6 +273,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
protected List<ModuleDependency> shareModules;
/**
* Deprecated as of SDK 3.1
* JARs that should be overlayed/applied to the Activiti App WAR (i.e. activiti-app.war)
*/
@Parameter(property = "maven.activiti.modules", defaultValue = "")
@@ -296,6 +328,9 @@ public abstract class AbstractRunMojo extends AbstractMojo {
@Parameter(property = "alfresco.groupId", defaultValue = "org.alfresco")
protected String alfrescoGroupId;
/**
* Deprecated as of SDK 3.1
*/
@Parameter(property = "activiti.groupId", defaultValue = "com.activiti")
protected String activitiGroupId;
@@ -311,9 +346,16 @@ public abstract class AbstractRunMojo extends AbstractMojo {
@Parameter(property = "alfresco.api.explorer.artifactId", defaultValue = "api-explorer")
protected String alfrescoApiExplorerArtifactId;
/**
* Deprecated as of SDK 3.1
*/
@Parameter(property = "activiti.app.war.artifactId", defaultValue = "activiti-app")
protected String activitiAppWarArtifactId;
/**
* Deprecated as of SDK 3.1
*/
@Parameter(property = "activiti.admin.war.artifactId", defaultValue = "activiti-admin")
protected String activitiAdminWarArtifactId;
@@ -326,6 +368,9 @@ public abstract class AbstractRunMojo extends AbstractMojo {
@Parameter(property = "alfresco.api.explorer.version", defaultValue = "5.2.e")
protected String alfrescoApiExplorerVersion;
/**
* Deprecated as of SDK 3.1
*/
@Parameter(property = "activiti.version", defaultValue = "1.5.3")
protected String activitiVersion;
@@ -335,6 +380,32 @@ public abstract class AbstractRunMojo extends AbstractMojo {
@Parameter(property = "solr.home", defaultValue = "${project.basedir}/${alfresco.data.location}/solr")
protected String solrHome;
/**
* Solr indexation frequency. It is customizable to speed up integration tests execution.
*/
@Parameter(property = "solr.alfresco.cron", defaultValue = "0/15 * * * * ? *")
protected String solrCron;
/**
* Tomcat version to be used in the Maven Tomcat Plugin. If this parameter is not set, then the
* default Tomcat version will be used (it depends on the version of the Tomcat Maven Plugin).
*/
@Parameter(property = "maven.alfresco.tomcat.version")
protected String tomcatVersion;
/**
* Tomcat Maven Plugin version to be used when running the project. If this parameter is not set, then the
* default Tomcat Maven Plugin version will be used (2.2).
*/
@Parameter(property = "maven.alfresco.tomcat.maven.plugin.version", defaultValue = "2.2")
protected String tomcatMavenPluginVersion;
/**
* Location of a custom context file to use in the deployment of the platform war in Tomcat.
*/
@Parameter(property = "maven.alfresco.platform.custom.context.file")
protected String platformCustomContextFile;
/**
* Maven GAV properties for customized alfresco.war, share.war, activiti-app.war
* Used by the Maven Tomcat 7 Plugin
@@ -356,6 +427,8 @@ public abstract class AbstractRunMojo extends AbstractMojo {
/**
* Get the Tomcat port. By default the port is changed by using the maven.alfresco.tomcat.port property
* but for legacy and external configuration purposes maven.tomcat.port will override if defined
*
* @return the Tomcat port
*/
protected String getPort() {
String port = tomcatPort;
@@ -368,7 +441,9 @@ public abstract class AbstractRunMojo extends AbstractMojo {
}
/**
* Check if Tomcat is already running.
*
* @return <code>true</code> if Tomcat is already running, <code>false</code> otherwise
*/
protected boolean tomcatIsRunning() {
@@ -393,7 +468,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Download and unpack the Solr 4 configuration as we don't have it in the project.
* It will reside under /alf_data_dev/solr
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears unpacking the Solr configuration
*/
protected void unpackSolrConfig() throws MojoExecutionException {
getLog().info("Unpacking Solr config");
@@ -426,7 +501,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* For windows paths, convert single \ to / for the ${alfresco.solr.data.dir} path,
* by default it will be c:\bla\, we need forward slash or double backslash.
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears fixing the Solr home path
*/
protected void fixSolrHomePath() throws MojoExecutionException {
getLog().info("Fix Solr Home Path to work in Windows");
@@ -449,11 +524,40 @@ public abstract class AbstractRunMojo extends AbstractMojo {
);
}
/**
* Copy custom solr configuration files over, so a
* developer can overwrite any files needed
*
* @throws MojoExecutionException when any problem appears copying the Solr custom configuration
*/
protected void copySolrCustomConfig() throws MojoExecutionException {
getLog().info("Copying custom Solr config");
executeMojo(
plugin(
groupId("org.apache.maven.plugins"),
artifactId("maven-resources-plugin"),
version(MAVEN_RESOURCE_PLUGIN_VERSION)
),
goal("copy-resources"),
configuration(
element(name("outputDirectory"), solrHome),
element(name("overwrite"), "true"),
element(name("resources"),
element(name("resource"),
element(name("directory"), "src/test/resources/solr"),
element(name("filtering"), "true")
)
)
),
execEnv
);
}
/**
* Replace property placeholders in configuration files for the cores, so the
* index files can be found for each core when Solr starts up.
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears replacing the Solr configuration properties
*/
protected void replaceSolrConfigProperties() throws MojoExecutionException {
getLog().info("Replacing Solr config properties");
@@ -486,8 +590,11 @@ public abstract class AbstractRunMojo extends AbstractMojo {
element(name("replacement"),
element(name("token"), "alfresco.secureComms=https"),
element(name("value"), "alfresco.secureComms=none")
),
element(name("replacement"),
element(name("token"), "alfresco.cron=0/15 * * * * ? *"),
element(name("value"), "alfresco.cron=" + solrCron)
)
)
),
execEnv
@@ -498,7 +605,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* If we are in Alfresco version 4.2 or younger the Solr 1.0 WAR is not available as Maven artifact, just
* as part of a ZIP file, so install it locally so we can deploy from embedded tomcat
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears installing Solr10 in the local repository
*/
protected void installSolr10InLocalRepo() throws MojoExecutionException {
if (isPlatformVersionLtOrEqTo42()) {
@@ -612,12 +719,13 @@ public abstract class AbstractRunMojo extends AbstractMojo {
}
/**
* <p>
* Replaces web.xml where applicable in platform webapp (alfresco.war),
* commenting out the security-constraints.
* <p/>
* </p>
* This is only needed for 4.2, 5.0 (5.1 handles it automatically when turning off ssl via props)
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears commenting out the security configuration
*/
protected void commentOutSecureCommsInPlatformWebXml() throws MojoExecutionException {
if (isPlatformVersionGtOrEqTo51()) {
@@ -661,7 +769,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* enterprise db config) that will be used when running Alfresco. It contains database connection parameters and
* other general configuration for Alfresco Repository (alfresco.war)
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears copying the Alfresco global properties file
*/
protected void copyAlfrescoGlobalProperties() throws MojoExecutionException {
getLog().info("Copying and filtering alfresco-global-*.properties files to target/test-classes");
@@ -753,7 +861,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Rename the configured database specific alfresco-global-*.properties file to
* alfresco-global.properties so it will be used during Tomcat run.
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears renaming the alfresco global properties
*/
protected void renameAlfrescoGlobalProperties() throws MojoExecutionException {
String alfrescoGlobalFilePath = project.getBuild().getTestOutputDirectory() + "/alfresco-global-";
@@ -801,7 +909,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Copy the Alfresco Enterprise license to its correct place in the Platform WAR, if it exists.
* It is not enough to have it on the test classpath, then it will start up as Trial license...
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears copying the Alfresco license
*/
protected void copyAlfrescoLicense() throws MojoExecutionException {
if (alfrescoEdition.equals(ALFRESCO_COMMUNITY_EDITION)) {
@@ -840,7 +948,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
/**
* Copy the Activiti Log4J Dev config into the activitiApp-war/WEB-INF/classes dir.
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears copying the activity Log4J dev configuration
*/
protected void copyActivitiLog4JDevConfig() throws MojoExecutionException {
final String warOutputDir = getWarOutputDir(ACTIVITI_APP_WAR_PREFIX_NAME);
@@ -875,7 +983,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
/**
* Copy Share Config Custom in order to have global overrides for development and dynamic port
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears copying share config custom file
*/
protected void copyShareConfigCustom() throws MojoExecutionException {
final String warOutputDir = getWarOutputDir(SHARE_WAR_PREFIX_NAME);
@@ -916,7 +1024,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* There is no custom classpath resolve mechanism for Share log4j,
* to log custom stuff overriding standard log4j.properties is needed.
*
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears copying the share log4j configuration
*/
protected void copyShareLog4jConfig() throws MojoExecutionException {
if (!useCustomShareLog4jConfig) {
@@ -956,7 +1064,9 @@ public abstract class AbstractRunMojo extends AbstractMojo {
/**
* Copy and Build hotswap-agent.properties
*
* @throws MojoExecutionException
* @param warPrefix path to the war root directory
*
* @throws MojoExecutionException when any problem appears copying hotswap agent properties
*/
protected void copyHotswapAgentProperties(String warPrefix) throws MojoExecutionException {
if ( copyHotswapAgentConfig == false ) {
@@ -990,6 +1100,8 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Build the customized Platform webapp (i.e. the Repository, alfresco.war)
* that should be deployed by Tomcat by applying all AMPs and JARs from
* the {@code <platformModules> } configuration.
*
* @throws MojoExecutionException when any problem appears building the platform war
*/
protected void buildPlatformWar() throws MojoExecutionException {
buildCustomWarInDir(PLATFORM_WAR_PREFIX_NAME, platformModules,
@@ -1011,6 +1123,8 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Build the customized Share webapp (i.e. the share.war)
* that should be deployed by Tomcat by applying all AMPs and JARs from
* the {@code <shareModules> } configuration.
*
* @throws MojoExecutionException when any problem appears building the share war
*/
protected void buildShareWar() throws MojoExecutionException {
buildCustomWarInDir(SHARE_WAR_PREFIX_NAME, shareModules,
@@ -1033,6 +1147,8 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* Build the customized Activiti App webapp (i.e. the activiti-app.war)
* that should be deployed by Tomcat by applying all JARs from
* the {@code <activitiModules> } configuration.
*
* @throws MojoExecutionException when any problem appears building the activity war
*/
protected void buildActivitiAppWar() throws MojoExecutionException {
buildCustomWarInDir(ACTIVITI_APP_WAR_PREFIX_NAME, activitiModules,
@@ -1057,7 +1173,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* @param originalWarGroupId the Maven groupId for the original war file that should be customized
* @param originalWarArtifactId the Maven artifactId for the original war file that should be customized
* @param originalWarVersion the Maven version for the original war file that should be customized
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears building the custom war
*/
protected void buildCustomWarInDir(String warName,
List<ModuleDependency> modules,
@@ -1147,18 +1263,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
);
// Then apply all these amps to the unpacked war
// Call the Alfresco Maven Plugin Install Mojo directly, so we don't have to keep SDK version info here
String ampsLocation = project.getBuild().getDirectory() + "/" + ampsModuleDir;
String warLocation = project.getBuild().getDirectory() + "/" + getWarName(warName);
InstallMojo installMojo = new InstallMojo();
installMojo.setAmpLocation(new File(ampsLocation));
installMojo.setWarLocation(new File(warLocation));
installMojo.setForce(true);
try {
installMojo.execute();
} catch (MojoFailureException e) {
e.printStackTrace();
}
applyAMPs(warName, modules);
}
// Then copy all JAR dependencies to the unpacked war /target/<warName>-war/WEB-INF/lib
@@ -1177,6 +1282,13 @@ public abstract class AbstractRunMojo extends AbstractMojo {
execEnv
);
}
// Force the unmount of all the files mounted with TrueZIP to avoid an exception in the FsSyncShutdownHook
try {
TVFS.umount();
} catch (final FsSyncException e) {
getLog().error(e);
}
}
/**
@@ -1184,7 +1296,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
*
* @param warName the name of the custom war
* @return the customized war file artifactId, to be used by the tomcat7 plugin
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears packaging or installing the custom war
*/
protected String packageAndInstallCustomWar(String warName) throws MojoExecutionException {
final String warArtifactId = "${project.artifactId}-" + warName;
@@ -1219,6 +1331,8 @@ public abstract class AbstractRunMojo extends AbstractMojo {
/**
* Check that a database configuration has been supplied correctly
*
* @throws MojoExecutionException when any problem appears checking the database configuration
*/
protected void checkDatabaseConfig() throws MojoExecutionException {
// Only do this check if we are running alfresco.war or activiti-app.war that needs a database.
@@ -1249,7 +1363,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
* configured in the SDK project.
*
* @param fork true if tomcat process should be forked
* @throws MojoExecutionException
* @throws MojoExecutionException when any problem appears starting tomcat
*/
protected void startTomcat(boolean fork) throws MojoExecutionException {
getLog().info("Starting Tomcat, fork = " + fork);
@@ -1296,10 +1410,16 @@ public abstract class AbstractRunMojo extends AbstractMojo {
dependency("org.postgresql", "postgresql", "9.4-1201-jdbc41"));
}
// If a custom version of Tomcat is required add the corresponding dependencies
if(StringUtils.isNotBlank(tomcatVersion)) {
addTomcatDependencies(tomcatPluginDependencies);
}
if (enablePlatform) {
String platformContextFile = StringUtils.isNotBlank(platformCustomContextFile) ? platformCustomContextFile : null;
webapps2Deploy.add(createWebAppElement(
runnerAlfrescoGroupId, runnerAlfrescoPlatformWarArtifactId, runnerAlfrescoPlatformVersion,
"/alfresco", null));
"/alfresco", platformContextFile));
}
if (enableShare) {
@@ -1367,7 +1487,7 @@ public abstract class AbstractRunMojo extends AbstractMojo {
plugin(
groupId("org.apache.tomcat.maven"),
artifactId("tomcat7-maven-plugin"),
version(MAVEN_TOMCAT7_PLUGIN_VERSION),
version(tomcatMavenPluginVersion),
tomcatPluginDependencies
),
goal("run"),
@@ -1742,4 +1862,68 @@ public abstract class AbstractRunMojo extends AbstractMojo {
private String getWarName(String baseWarName) {
return baseWarName + "-war";
}
/**
* Add all the required maven dependencies to execute a specific version of Tomcat set by the property <code>tomcatVersion</code> to the list of
* dependencies of the Tomcat Maven Plugin.
*
* @param tomcatPluginDependencies current list of dependencies of the Tomcat Maven Plugin
*/
private void addTomcatDependencies(List<Dependency> tomcatPluginDependencies) {
for(Pair<String, String> tomcatDependency : TOMCAT_DEPENDENCIES) {
tomcatPluginDependencies.add(dependency(tomcatDependency.getFirst(),tomcatDependency.getSecond(),tomcatVersion));
}
}
/**
* Apply a list of AMPs to a specific war file.
*
* @param warName the name of the war file to apply the AMPs to
* @param modules the list of proposed modules to be applied to the war file. Only the AMP files will be applied
* @throws MojoExecutionException when any problem appears applying the AMPs to the war
*/
private void applyAMPs(String warName, List<ModuleDependency> modules) throws MojoExecutionException {
final String ampsModuleDir = "modules/" + warName + "/amps";
final String ampsLocation = project.getBuild().getDirectory() + "/" + ampsModuleDir;
final String warLocation = project.getBuild().getDirectory() + "/" + getWarName(warName);
// Apply one AMP module each time to preserve the order applying the AMPs to the war
for(ModuleDependency module : modules) {
if(module.isAmp()) {
applyAMP(ampsLocation, warLocation, module);
}
}
}
/**
* Apply an AMP to a specific war file.
*
* @param ampsLocation the location of the folder where the AMP is located
* @param warLocation the location of the war file to apply the AMP to
* @param ampModule the module that represents the AMP to apply
* @throws MojoExecutionException when any problem appears applying the AMP to the war
*/
private void applyAMP(String ampsLocation, String warLocation, ModuleDependency ampModule) throws MojoExecutionException {
// Call the Alfresco Maven Plugin Install Mojo directly, so we don't have to keep SDK version info here
InstallMojo installMojo = new InstallMojo();
installMojo.setAmpLocation(new File(getAMPLocation(ampsLocation, ampModule)));
installMojo.setWarLocation(new File(warLocation));
installMojo.setForce(true);
try {
installMojo.execute();
} catch (MojoFailureException e) {
getLog().error(e);
}
}
/**
* Build the location of an AMP file.
*
* @param ampsLocation the location of the folder where the AMPs are located
* @param ampModule the {@link ModuleDependency} of the AMP to build its location
* @return the location of the AMP file
*/
private String getAMPLocation(String ampsLocation, ModuleDependency ampModule) {
return String.format(AMP_LOCATION_PATTERN, ampsLocation, ampModule.getArtifactId(), ampModule.getVersion());
}
}

View File

@@ -0,0 +1,96 @@
/**
* Copyright (C) 2019 Alfresco Software Limited.
* <p/>
* This file is part of the Alfresco SDK.
* <p/>
* Licensed 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* 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.
*/
package org.alfresco.maven.plugin;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import static org.twdata.maven.mojoexecutor.MojoExecutor.executionEnvironment;
/**
* Alfresco Plugin mojo that is used when you want to build the Alfresco WARs without starting the server.
*
* @author Jose Luis Osorno - joseluis.osorno@ixxus.com
* @version 1.0
* @since 3.1.0
*/
@Mojo(name = "build-wars",
defaultPhase = LifecyclePhase.PACKAGE,
aggregator = true,
requiresDependencyResolution = ResolutionScope.TEST)
public class BuildWarsMojo extends AbstractRunMojo {
@Override
public void execute() throws MojoExecutionException {
execEnv = executionEnvironment(
project,
session,
pluginManager
);
if (enableActivitiApp || enableActivitiAdmin) {
getLog().warn("*************************************************************************************************************");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*\tWARNING" );
getLog().warn("*\tThe Activiti features in SDK 3.x are UNSUPPORTED.");
getLog().warn("*\tIt has been marked for deprecation (SDK 3.1) and will be removed in SDK 4.0.");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*************************************************************************************************************");
}
if (enableSolr) {
unpackSolrConfig();
fixSolrHomePath();
copySolrCustomConfig();
replaceSolrConfigProperties();
installSolr10InLocalRepo();
}
if (enableTestProperties && enablePlatform) {
copyAlfrescoGlobalProperties();
renameAlfrescoGlobalProperties();
}
if (enablePlatform) {
buildPlatformWar();
}
if (enableShare) {
buildShareWar();
}
if (enableActivitiApp) {
buildActivitiAppWar();
}
}
}

View File

@@ -26,9 +26,10 @@ import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
/**
* <p>
* Performs a AMP to WAR overlay invoking the Alfresco Repository ModuleManagementTool.
* It therefore wraps and emulates the same WAR overlay performed by Alfresco MMT.
* <p/>
* </p>
* This goal will install the AMP file(s) found in ${ampLocation} onto the WAR (or exploded WAR) found in ${warLocation}
*
* @version $Id:$

View File

@@ -35,12 +35,13 @@ import java.util.Properties;
import static org.twdata.maven.mojoexecutor.MojoExecutor.*;
/**
* <p>
* Alfresco Plugin mojo that are used when you want to run Integration Tests.
* It will package up all the Integration Test classes and execute contained
* tests with the Maven Failsafe plugin. The test classes will be added
* to the platform war so they can be executed remotely via
* the ${@link org.alfresco.rad.test.AlfrescoTestRunner}
* <p/>
* the AlfrescoTestRunner.
* </p>
* The Alfresco RAD module is also added to the Platform WAR so
* the Alfresco Test runner classes are available.
*

View File

@@ -21,11 +21,12 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
/**
* <p>
* Refresh Alfresco Repo and Share Mojo.
* Will refresh the Web Script container so new and changed
* Spring Surf Web Scripts are detected.
* Will also clear the dependency caches for web resources (CSS, JS, etc).
* <p/>
* </p>
* It is important to execute the refresh calls in the compile phase,
* otherwise the files will be copied after this and the refresh calls
* will not be recognized.

View File

@@ -21,10 +21,11 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
/**
* <p>
* Refresh Alfresco Repository (alfresco.war) Mojo.
* Will refresh the Web Script container so new and changed
* Web Scripts are detected.
* <p/>
* </p>
* It is important to execute the refresh calls in the compile phase,
* otherwise the files will be copied after this and the refresh calls
* will not be recognized.

View File

@@ -21,11 +21,12 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
/**
* <p>
* Refresh Alfresco Share (share.war) Mojo.
* Will refresh the Web Script container so new and changed
* Spring Surf Web Scripts are detected.
* Will also clear the dependency caches for web resources (CSS, JS, etc).
* <p/>
* </p>
* It is important to execute the refresh calls in the compile phase,
* otherwise the files will be copied after this and the refresh calls
* will not be recognized.

View File

@@ -46,9 +46,34 @@ public class RunMojo extends AbstractRunMojo {
pluginManager
);
if (enableActivitiApp || enableActivitiAdmin) {
getLog().warn("*************************************************************************************************************");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*\tWARNING" );
getLog().warn("*\tThe Activiti features in SDK 3.x are UNSUPPORTED.");
getLog().warn("*\tIt has been marked for deprecation (SDK 3.1) and will be removed in SDK 4.0.");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*");
getLog().warn("*************************************************************************************************************");
}
if (enableSolr) {
unpackSolrConfig();
fixSolrHomePath();
copySolrCustomConfig();
replaceSolrConfigProperties();
installSolr10InLocalRepo();
}

View File

@@ -28,8 +28,7 @@ import org.apache.maven.project.MavenProject;
/**
* Removes -SNAPSHOT suffix from the version number (if present), optionally replacing it with a timestamp.
* The result is provided in the Maven property ${noSnapshotVersion} (name can be changed using
* <propertyName>myCustomVersion</>).
* The result is provided in the Maven property ${noSnapshotVersion}.
* This feature is mostly needed to avoid Alfresco failing when installing AMP modules with non-numeric
* versions.
*
@@ -67,7 +66,7 @@ public class VersionMojo extends AbstractMojo {
/**
* Allows to append a custom (numeric) value to the current artifact's version,
* i.e. appending the SCM build number can be accomplished defining
* <customVersionSuffix>${buildnumber}</customVersionSuffix> in the plugin
* &lt;customVersionSuffix&gt;${buildnumber}&lt;/customVersionSuffix&gt; in the plugin
* configuration.
*
* @parameter property="maven.alfresco.customVersionSuffix"

View File

@@ -14,7 +14,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.util.xml.Xpp3Dom;
/**
* This class provides AMP unpacking support for projects depending on AMPs
* This allows for example AMPs to be specified as <overlay> in the maven-war-plugin
* This allows for example AMPs to be specified as &lt;overlay&gt; in the maven-war-plugin
* @author mindthegab
*
*/

View File

@@ -21,15 +21,18 @@ package org.alfresco.maven.plugin.config;
import org.apache.commons.lang.StringUtils;
/**
* <p>
* Defines an Alfresco extension module dependency (JAR or AMP) to be
* overlayed on an Alfresco webapp file.
* <p/>
* </p>
* <p>
* This is so we can skip the WAR projects in the AIO project,
* and so we can include the Share Services AMP when running
* with a simple platform JAR.
* <p/>
* </p>
* <p>
* This class is used by the RunMojo class.
* <p/>
* </p>
* Alfresco Maven Plugin config looks something like this:
* <pre>
* {@code

View File

@@ -19,8 +19,9 @@
package org.alfresco.maven.plugin.config;
/**
* <p>
* Tomcat Dependency used in Embedded Tomcat Maven plugin configuration.
* <p/>
* </p>
* Alfresco Maven Plugin config looks something like this:
* <pre>
* {@code

View File

@@ -18,11 +18,12 @@
package org.alfresco.maven.plugin.config;
/**
* <p>
* Tomcat Webapp used in Embedded Tomcat Maven plugin configuration.
* These are custom webapps that you would want to include for some reason
* (The {webapp artifact}.war need to be available in a Maven Repo).
* Note. the standard webapps are included with plugin properties such as enablePlatform and enableShare.
* <p/>
* </p>
* Alfresco Maven Plugin config looks something like this:
* <pre>
* {@code

59
pom.xml
View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<name>Alfresco SDK</name>
<description>This aggregator Project builds all modules required for the Alfresco SDK</description>
<packaging>pom</packaging>
@@ -30,7 +30,7 @@
<connection>scm:git:${scm.url.base}.git</connection>
<developerConnection>scm:git:${scm.url.base}</developerConnection>
<url>${scm.url.base}</url>
<tag>alfresco-sdk-aggregator-3.0.1</tag>
<tag>alfresco-sdk-aggregator-3.1.0</tag>
</scm>
<developers>
@@ -130,7 +130,7 @@
<!-- The following version is needed for alfresco-rad -->
<alfresco.community.default.version>5.2.f</alfresco.community.default.version>
<alfresco.enterprise.default.version>5.2.0</alfresco.enterprise.default.version>
<alfresco.enterprise.default.version>5.2.4</alfresco.enterprise.default.version>
<alfresco.sdk.default.edition>community</alfresco.sdk.default.edition>
<scm.url.base>https://github.com/Alfresco/alfresco-sdk</scm.url.base>
@@ -152,6 +152,59 @@
<skip>${skipTests}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<tags>
<tag>
<name>goal</name>
<placement>a</placement>
<head>Goal:</head>
</tag>
<tag>
<name>requiresDependencyResolution</name>
<placement>a</placement>
<head>Requires Dependency Resolution:</head>
</tag>
<tag>
<name>description</name>
<placement>a</placement>
<head>Description:</head>
</tag>
<tag>
<name>phase</name>
<placement>a</placement>
<head>Phase:</head>
</tag>
<tag>
<name>requiresProject</name>
<placement>a</placement>
<head>Requires Project:</head>
</tag>
<tag>
<name>threadSafe</name>
<placement>a</placement>
<head>Thread-Safe:</head>
</tag>
<tag>
<name>required</name>
<placement>a</placement>
<head>Required:</head>
</tag>
<tag>
<name>readonly</name>
<placement>a</placement>
<head>Read only:</head>
</tag>
<tag>
<name>parameter</name>
<placement>a</placement>
<head>Parameter:</head>
</tag>
</tags>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<extensions>