Platform JAR Maven Archetype for SKD 3.0

This commit is contained in:
Martin Bergljung 2016-08-16 14:52:42 +01:00
parent 6eb8903562
commit 101a04e309
96 changed files with 513 additions and 1173 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="All In One Archetype for Alfresco. Provides rapid development, IDE integration, and running embedded of Alfresco Repo, Share and Solr"
name="Alfresco All In One (AIO) Archetype."
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>
@ -39,12 +39,14 @@
</includes>
<excludes>
<exclude>**/*-context.xml</exclude>
<exclude>**/log4j.properties</exclude>
</excludes>
</fileSet>
<fileSet encoding="UTF-8" filtered="true" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>**/*-context.xml</include>
<include>**/log4j.properties</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8" filtered="false">
@ -123,6 +125,7 @@
<includes>
<include>run.sh</include>
<include>run.bat</include>
<include>README.md</include>
</includes>
</fileSet>
</fileSets>

View File

@ -0,0 +1,34 @@
# Alfresco AIO Project - SDK 3
This is an All-In-One (AIO) project for Alfresco SDK 3.0.
Run with `mvn clean install -DskipTests=true alfresco:run` or `./run.sh` and verify that it
* Runs the embedded Tomcat + H2 DB
* Runs Alfresco Platform (Repository)
* Runs Alfresco Solr4
* Runs Alfresco Share
* Packages both as JAR and AMP assembly for modules
# Few things to notice
* No parent pom
* No WAR projects, all handled by the Alfresco Maven Plugin
* No runner project - it's all in the Alfresco Maven Plugin
* Standard JAR packaging and layout
* Works seamlessly with Eclipse and IntelliJ IDEA
* JRebel for hot reloading, JRebel maven plugin for generating rebel.xml, agent usage: `MAVEN_OPTS=-Xms256m -Xmx1G -agentpath:/home/martin/apps/jrebel/lib/libjrebel64.so`
* AMP as an assembly
* [Configurable Run mojo](https://github.com/Alfresco/alfresco-sdk/blob/sdk-3.0/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RunMojo.java) in the `alfresco-maven-plugin`
* No unit testing/functional tests just yet
* Resources loaded from META-INF
* Web Fragment (this includes a sample servlet configured via web fragment)
# TODO
* Abstract assembly into a dependency so we don't have to ship the assembly in the archetype
* Purge
* Functional/remote unit tests

View File

@ -13,6 +13,6 @@ public class Demo
{
public void init()
{
System.out.println("SDK Demo AMP class has been loaded");
System.out.println("Platform JAR Module class has been loaded");
}
}

View File

@ -55,7 +55,7 @@ public class DemoComponent extends AbstractModuleComponent {
@Override
protected void executeInternal() throws Throwable {
System.out.println("DemoComponent has been executed");
log.debug("Test debug logging. Congratulation your AMP is working");
log.debug("Test debug logging. Congratulation your JAR Module is working");
log.info("This is only for information purposed. Better remove me from the log in Production");
}

View File

@ -1,39 +0,0 @@
------
Alfresco All-in-One Archetype Advanced Usage
------
Gabriele Columbro
------
Aug 2014
------
All-in-One Archetype properties
In each of the modules of the archetype (as in the whole Alfresco SDK\x99) properties are configurable at many levels:
* as POM properties
* direclty in *.properties, particularly
* For the <<<repo>>> project
* <<<src/main/properties/<env>/alfresco-global.properties>>> (environment dependent <<<alfresco-global.properties>>> packaged in the WAR when running directly within the AMP project)
* For Alfresco/Share AMP projects
* <<<src/test/properties/<env>/alfresco-global.properties>>> (environment dependent <<<alfresco-global.properties>>> for test WAR run)
Build Environment (e.g. local, test, staging, prod) can be easily switched by setting the <<<<env>>>> property in your POM or
adding <<<-Denv=yourEnv>>> on the command line.
* Common properties
Archetype behavior can mostly be controlled directly in the POM, via common properties provided by the parent POM.
See {{{../../poms/alfresco-sdk-parent/sdk-properties.html} SDK properties reference}} for details.
Parent POM and behavior customization
To customize the behavior of your project, check out full set of the properties and plugin configurations defined in the
{{{./poms/alfresco-sdk-parent/index.html}single entry point parent POM}}.
One quick way to do that is to use the <<<maven-help-plugin:effective-pom>>> to analyze your POM at runtime.

View File

@ -1,67 +0,0 @@
------
Building AMPs (Alfresco Module Packages) with Maven
------
Gabriele Columbro
------
Nov 2012
------
Introduction
The Alfresco All-in-One Archetype is a multi-module project,
leveraging Alfresco SDK\x99 powerful capabilities to customize and run the full Alfresco platform embedded and all it's components.
The archetype does not require additional download and provides a perfect starting point for full-blown Alfresco projects.
* Features
Amongst other features, this archetype provides support for:
* <<<amp>>> packaging support for your projects
* AMP Dependency management and overlay in an Alfresco Repository or Share WAR
* Embedded run in Tomcat and embedded H2 database of the full Alfresco suite, including Repository, Share, Solr
* Support for unit and integration testing and rapid development (using spring-loaded, see run.sh)
* Seamless IDE integration with Eclipse and Idea
How to create a project:
As of version 2.0-beta-3, you can create a project with the latest released archetype with the following command directly from Maven Central:
+---+
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:alfresco-allinone-archetype
+---+
For previous versions, you need to use the Alfresco Artifacts repository:
+---+
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:alfresco-allinone-archetype -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog.xml
+---+
You should then:
[[1]] Select the <<<alfresco-allinone-archetype>>> version
[[2]] Specify the <<<groupId>>> and <<<artifactId>>> for the project you want to create
[[3]] (<Optionally>) Select Alfresco Version / Edition (current default is: Alfresco Community 5.0.c)
You can find new Alfresco All-in-One project ready to go in the <<<artifactId>>> folder.
Quickstart
Once your project is created:
* Enter the project folder and run <<<./run.sh>>> (you might need to <<<chmod u+x run.sh>>> to make it executable). This will setup the SDK and start Alfresco, Share and Solr in embedded mode.
* Wait for the startup of the webapps and then go <<<http://localhost:8080>>>.
* Import the projects in your favorite IDE (with Maven integration) and start developing right away.
Usage
Full instructions on how to use the Alfresco All in One archetype can be found on the {{{./usage.html}usage page}}, while
for more advanced use cases refer to the {{{./advanced-usage.html}advanced usage page}}

View File

@ -1,85 +0,0 @@
------
Maven Alfresco All-in-One Archetype Usage
------
Gabriele Columbro
------
Sep 2013
------
Prerequisites
See {{{../../prerequisites.html} SDK Pre-Requisites}} to successfully run this archetype.
Project layout
The archetype generated multi-module project should look like:
+---+
pom.xml
|-> rootArtifactid-repo-amp
|-> rootArtifactid-share-amp
|-> repo
|-> share
|-> solr
|-> runner (a Tomcat embedded runner / integration test runner)
+---+
* Modules
The All-in-One Alfresco project is composed by the following modules:
* <<<rootArtifactid-repo-amp>>>: An Repository Tier AMP project, demonstrating sample project structure and demo component loading
* <<<repo>>>: An <<<alfresco.war>>> Repository Extension, overlaying the Alfresco WAR with custom resources / classes
and depending on the <<<amp>>> project
* <<<rootArtifactid-share-amp>>>: A Share Tier AMP project, demonstrating sample project structure and demo component loading
* <<<share>>>: A <<<share.war>>> extension, overlaying the Share WAR with the custom developed <<<rootArtifactid-share-amp>>>
* <<<solr>>>: An Alfresco <<<alfresco-*-*-solr.zip>>> overlay / customization to configure {{{http://solr.apache.org}Apache Solr}} cores properties
* <<<runner>>>: A Tomcat + H2 runner, capable of running all the aforementioned projects in embedded mode for demo / integration-testing purposes
Usage
The project provides support for typical development lifecycle use cases like
* Rapid development, in full IDE integration, and with hot classes reloading (using spring-loaded, check {{{../../prerequisites.html}prerequisites}}).
* AMP/WAR packaging
* AMP Unit testing and rapid development
* run embedded in Tomcat + H2 database.
(<<NOTE>>: this is not a {{{http://www.alfresco.com/services/subscription/supported-platforms/} supported stack}} so use <<only for development purposes>>)
* Integration testing
* AMP to WAR installation and overlay (embedding {{{http://wiki.alfresco.com/wiki/Module_Management_Tool}Alfresco Module Managment Tool}})
* release and distribution
for all the components of the Alfresco landscape. For more information, check the See the {{{./advanced-usage.html}advanced usage page}} page.
<<NOTE>>: AMPs produced with this project are fully compatible with Alfresco MMT,in fact the Maven Alfresco plugin - used to manage AMPs in this SDK - embeds the official Alfresco MMT to install depended AMPs.
Commands
<<<run.sh>>> will automatically set up the SDK and run the webapps embedded to enable rapid development
Additional common Maven lifecycle commands you want to run from the aggregator are:
* <<<mvn package>>>: Runs unit tests and packages all customized modules in their respective <<<$\{project.build.directory\}/$\{project.build.finalName\}.amp>>>
* <<<mvn install>>>: Like <<<mvn package>>> but also installs all modules in local Maven repository to be depended upon
* <<<mvn install -Dmaven.test.skip=true>>>: Like <<<mvn install>>> but skips unit tests
* <<<mvn install -Prun>>>: Like <<<mvn install>>> but also trigger the <<<runner>>> project to run Alfresco, Share, Solr and Web Quick Start in Jetty (with H2 embedded database)
* <<<mvn clean -Ppurge>>>: Removes DB, alf_data and log files
* Commands from from the <<<runner>>> project
* <<<mvn install -Prun'>>> or <<<'mvn integration-test -Prun'>>> to quickly run already packaged webapps

View File

@ -1,49 +0,0 @@
<project>
<body>
<!-- <menu ref="parent" inherit="bottom"/> -->
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '${gaTrackingId}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<menu name="Alfresco All-in-One Archetype">
<item name="Introduction" href="index.html"/>
<item name="Usage" href="usage.html"/>
<item name="Advanced Usage" href="advanced-usage.html"/>
</menu>
<menu name="SDK components">
<item name="Maven Alfresco SDK" href="../../index.html" />
<item name="Alfresco AMP Archetype" href="../alfresco-amp-archetype/index.html" />
<item name="Share AMP Archetype" href="../share-amp-archetype/index.html" />
<item name="Alfresco All-in-One Archetype" href="./index.html" />
<item name="Maven Alfresco SDK Parent POM" href="../../poms/alfresco-sdk-parent/index.html" />
<item name="Alfresco Platform Distribution POM" href="https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-platform-distribution/latest/index.html" />
<item name="Maven Alfresco Plugin" href="../../plugins/alfresco-maven-plugin/index.html" />
</menu>
<menu name="Alfresco Documentation">
<item name="Official Maven Alfresco SDK docs" href="http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html" />
<item name="Maven Alfresco Wiki Documentation" href="http://wiki.alfresco.com/wiki/Maven_Alfresco_SDK" />
<item name="Alfresco with Maven for Dummies" href="https://wiki.alfresco.com/wiki/Maven_For_Dummies" />
<item name="Developer Access (Google Code)" href="http://code.google.com/p/maven-alfresco-archetypes/" />
<item name="Gabriele Columbro's blog" href="http://www.mindthegab.com/" />
<item name="Maurizio Pillitu's blog" href="http://www.session.it/" />
<item name="Carlo Sciolla's blog" href="http://skuro.tk/" />
<item name="Enterprise adoption" href="http://www.slideshare.net/guest67a9ba/maven-application-lifecycle-management-for-alfresco" />
</menu>
<!--<menu ref="reports"/>-->
</body>
</project>

View File

@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<name>${artifactId} Repository AMP project</name>
<packaging>amp</packaging>
<description>Manages the lifecycle of the ${artifactId} Repository AMP (Alfresco Module Package)</description>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>@@alfresco.sdk.parent.version@@</version>
</parent>
<!--
SDK properties have sensible defaults in the SDK parent,
but you can override the properties below to use another version.
For more available properties see the alfresco-sdk-parent POM.
-->
<properties>
<!-- The following are default values for data location and Alfresco Community version.
Uncomment if you need to change (Note. current default version for Enterprise edition is @@alfresco.enterprise.default.version@@)
<alfresco.version>@@alfresco.community.default.version@@</alfresco.version>
<alfresco.data.location>/absolute/path/to/alf_data_dev</alfresco.data.location> -->
<!-- This control the root logging level for all apps uncomment and change, defaults to WARN
<app.log.root.level>WARN</app.log.root.level>
-->
<!-- Set the enviroment to use, this controls which properties will be picked in src/test/properties
for embedded run, defaults to the 'local' environment. See SDK Parent POM for more info.
<env>local</env>
-->
</properties>
<!-- Here we realize the connection with the Alfresco selected platform
(e.g.version and edition) -->
<dependencyManagement>
<dependencies>
<!-- Setup what versions of the different Alfresco artifacts that will be used (depends on alfresco.version),
so we don't have to specify version in any of the dependency definitions in our POM.
For more info see:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies
-->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-platform-distribution</artifactId>
<version>${alfresco.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Following dependencies are needed for compiling Java code in src/main/java;
<scope>provided</scope> is inherited for each of the following;
for more info, please refer to alfresco-platform-distribution POM -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
</dependency>
</dependencies>
<profiles>
<!--
Brings in the extra Enterprise specific repository classes,
if the 'enterprise' profile has been activated, needs to be activated manually.
-->
<profile>
<id>enterprise</id>
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-enterprise-repository</artifactId>
<version>${alfresco.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<!--
If the 'amp-to-war' profile is enabled then make sure to bring in the alfresco-rad module,
which has the H2 scripts and other RAD features.
TODO: TO INVESTIGATE: This dependency is already defined in the parent SDK pom in the 'amp-to-war' profile
but this does not work, it is not include...
<profile>
<id>amp-to-war</id>
<dependencies>
<dependency>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-rad</artifactId>
<version>${maven.alfresco.version}</version>
</dependency>
</dependencies>
</profile> -->
</profiles>
</project>

View File

@ -1,19 +0,0 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dev environment startup script for Alfresco Community. ::
:: ::
:: Downloads the spring-loaded lib if not existing and ::
:: runs the Repo AMP applied to Alfresco WAR. ::
:: Note. the Share WAR is not deployed. ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set springloadedfile=%HOME%\.m2\repository\org\springframework\springloaded\@@springloaded.version@@\springloaded-@@springloaded.version@@.jar
if not exist %springloadedfile% (
mvn validate -Psetup
)
set MAVEN_OPTS=-javaagent:"%springloadedfile%" -noverify -Xms256m -Xmx2G
mvn integration-test -Pamp-to-war -nsu
:: mvn integration-test -Pamp-to-war

View File

@ -1,11 +0,0 @@
#!/bin/bash
# Downloads the spring-loaded lib if not existing and
# runs the Repo AMP applied to Alfresco WAR.
# Note. the Share WAR is not deployed.
springloadedfile=~/.m2/repository/org/springframework/springloaded/@@springloaded.version@@/springloaded-@@springloaded.version@@.jar
if [ ! -f $springloadedfile ]; then
mvn validate -Psetup
fi
MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G" mvn integration-test -Pamp-to-war

View File

@ -1,41 +0,0 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
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.
-->
<beans>
<!-- A simple class that is initialized by Spring -->
<bean id="${package}.exampleBean" class="${package}.demoamp.Demo" init-method="init" />
<!-- A simple module component that will be executed once.
Note. this module component will only be executed once, and then there will be an entry for it in the Repo.
So doing for example $ mvn clean install -Pamp-to-war twice will only execute this component the first time.
You need to remove /alf_data_dev for it to be executed again. -->
<bean id="${package}.exampleComponent" class="${package}.demoamp.DemoComponent" parent="module.baseComponent" >
<property name="moduleId" value="${artifactId}" /> <!-- See module.properties -->
<property name="name" value="exampleComponent" />
<property name="description" value="A demonstration component" />
<property name="sinceVersion" value="1.0" />
<property name="appliesFromVersion" value="1.0" />
<property name="nodeService" ref="NodeService" />
<property name="nodeLocatorService" ref="nodeLocatorService" />
</bean>
</beans>

View File

@ -1,16 +0,0 @@
/*
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.
*/

View File

@ -1,17 +0,0 @@
<!--
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.
-->
This is a demo JSP. When running with -Pamp-to-war, just change this text and it will be automatically reloaded!

View File

@ -1,2 +0,0 @@
This folder (root in the AMP) gets mapped automagically in WEB-INF/licenses
by the MMT or the alfresco-maven-plugin

View File

@ -1,16 +0,0 @@
/*
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.
*/

View File

@ -1,86 +0,0 @@
#set($symbol_pound='#')
#set($symbol_dollar='$')
#set($symbol_escape='\' )
package ${package}.demoamp.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import ${package}.demoamp.DemoComponent;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.tradeshift.test.remote.Remote;
import com.tradeshift.test.remote.RemoteTestRunner;
/**
* A simple class demonstrating how to run out-of-container tests
* loading Alfresco application context.
*
* This class uses the RemoteTestRunner to try and connect to
* localhost:4578 and send the test name and method to be executed on
* a running Alfresco. One or more hostnames can be configured in the @Remote
* annotation.
*
* If there is no available remote server to run the test, it falls
* back on local running of JUnits.
*
* For proper functioning the test class file must match exactly
* the one deployed in the webapp (either via JRebel or static deployment)
* otherwise "incompatible magic value XXXXX" class error loading issues will arise.
*
* @author Gabriele Columbro
* @author Maurizio Pillitu
*
*/
@RunWith(RemoteTestRunner.class)
@Remote(runnerClass=SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:alfresco/application-context.xml")
public class DemoComponentTest {
private static final String ADMIN_USER_NAME = "admin";
static Logger log = Logger.getLogger(DemoComponentTest.class);
@Autowired
protected DemoComponent demoComponent;
@Autowired
@Qualifier("NodeService")
protected NodeService nodeService;
@Test
public void testWiring() {
assertNotNull(demoComponent);
}
@Test
public void testGetCompanyHome() {
AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER_NAME);
NodeRef companyHome = demoComponent.getCompanyHome();
assertNotNull(companyHome);
String companyHomeName = (String) nodeService.getProperty(companyHome, ContentModel.PROP_NAME);
assertNotNull(companyHomeName);
assertEquals("Company Home", companyHomeName);
}
@Test
public void testChildNodesCount() {
AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER_NAME);
NodeRef companyHome = demoComponent.getCompanyHome();
int childNodeCount = demoComponent.childNodesCount(companyHome);
assertNotNull(childNodeCount);
// There are 7 folders by default under Company Home
assertEquals(7, childNodeCount);
}
}

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================================================================
This context file is used only in a development IDE for rapid development,
it is never released with the Alfresco.war
=================================================================================================================-->
<!-- Setup docBase to something like repo-amp/target/repo-amp-war
and path to /alfresco
The Alfresco.war 5.0 does not have a webapp (it used to have Alfresco Explorer but not anymore)
that we will access, so this docBase might not be needed
-->
<Context docBase="${app.amp.client.war.folder}" path="${alfresco.client.contextPath}">
<Resources className="org.apache.naming.resources.VirtualDirContext"
extraResourcePaths="/=${project.build.directory}/${project.build.finalName}/web" />
<!-- Setup the virtual class path like this:
1) target/classes
2) target/${project.build.finalName}/config
3) target/test-classes
This way mvn compile can be invoked and all changes will be picked up
-->
<Loader searchVirtualFirst="true"
className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath="${project.build.outputDirectory};${project.build.directory}/${project.build.finalName}/config;${project.build.testOutputDirectory}" />
<!-- This enables hot reloading of web resources from uncompressed jars (while in prod they would be loaded from WEB-INF/lib/{\*.jar}/META-INF/resources -->
<JarScanner scanAllDirectories="true" />
</Context>

View File

@ -1,62 +0,0 @@
------
Maven Alfresco AMP Archetype Advanced Usage
------
Gabriele Columbro
------
Nov 2012
------
AMP Unit Testing
Unit test your AMP customization is as easy as adding your tests in <<<src/test/java>>>. The current module in development
will be added to the test classpath together with all necessary Alfresco Spring contexts.
Running <<<mvn test>>> will results in your unit tests to be run. You can skip this (<<<not recommended>>>)
adding <<<-DskipTests>>> to your command line.
AMP Archetype properties
In the AMP archetype (as in the whole Part of the Maven Alfresco SDK\x99) properties are configurable at many levels:
* as POM properties
* direclty in *.properties, particularly
* <<<src/main/amp/module.properties>>> (filtered and packaged in the AMP)
* <<<src/test/properties/<env>/alfresco-global.properties>>> (environment dependent properties for WAR run embedded)
* Common properties
Archetype behavior can mostly be controlled directly in the POM, via common properties provided by the parent POM.
See {{{../../poms/alfresco-sdk-parent/sdk-properties.html} SDK properties reference}} for details.
* AMP specific properties
In addition to the common properties, the following properties are specific of the AMP archetype. You can change
these properties to select a different WAR to install your AMP to (e.g. a pre-customized Alfresco or Share instance):
+---+
<project>
...
<properties>
<!--
Determines the coordinates of target WAR for this AMP
Allowed values: alfresco (default) | share
-->
<alfresco.client.war>alfresco</alfresco.client.war>
<alfresco.client.war.groupId>${alfresco.groupId}</alfresco.client.war.groupId>
<alfresco.client.war.version>${alfresco.version}</alfresco.client.war.version>
</properties>
...
</project>
+---+
Parent POM and behavior customization
To customize the behavior of your project, check out full set of the properties and plugin configurations defined in the
{{{../../poms/alfresco-sdk-parent/index.html}single entry point parent POM}}.
One quick way to do that is to use the <<<maven-help-plugin:effective-pom>>> to analyze your POM at runtime.

View File

@ -1,73 +0,0 @@
------
Building AMPs (Alfresco Module Packages) with Maven
------
Gabriele Columbro
------
Sept 2014
------
Introduction
The Alfresco AMP Archetype is a sample fully featured project to manage AMP (Alfresco Module Package) projects.
This archetype can be used for Alfresco Repository. For Share, please refer to the {{{../share-amp-archetype/index.html}Share AMP archetype}}
* Features
Amongst other features, this archetype provides support for:
* <<<amp>>> packaging support for your projects
* AMP dependency management in Maven
* Installation of AMPs in an Alfresco WAR
* AMP Unit Testing support. Just run the standard <<<mvn test>>> and see your <<<src/test/java>>> Alfresco unit tests run.
An sample Unit Test is provided in this archetype.
* Embedded run in Tomcat and embedded H2 database for demo purposes, rapid application development and integration testing
(<<NOTE>>: this is not a {{{http://www.alfresco.com/services/subscription/supported-platforms/} supported stack}} so use <<only for development purposes>>)
* Support for (remote) Junit and integration testing and rapid development (using spring-loaded, see run.sh)
* Seamless IDE integration with Eclipse and Idea
How to create a project:
As of version 2.0-beta-3, you can create a project with the latest released archetype with the following command directly from Maven Central:
+---+
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:alfresco-amp-archetype
+---+
For previous versions, you need to use the Alfresco Artifacts repository:
+---+
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:alfresco-amp-archetype -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog.xml
+---+
You should then:
[[1]] Select the <<<alfresco-amp-archetype>>> version
[[2]] Specify the <<<groupId>>> and <<<artifactId>>> for the project you want to create
[[3]] (<Optionally>) Select Alfresco Version / Edition (current default is: Alfresco Community 4.2.c)
You can find new Alfresco AMP project ready to go in the <<<artifactId>>> folder.
Quickstart
Once your project is created:
* Enter the project folder and run <<<./run.sh>>> (you might need to <<<chmod u+x run.sh>>> to make it executable).
This will setup the SDK and the Alfresco repository (not Share or Solr).
* Wait for the startup of the webapp and then go <<<http://localhost:8080/alfresco>>>.
* Import the project in your favorite IDE (with Maven integration) and start developing right away.
Usage
Full instructions on how to use the Alfresco AMP archetype can be found on the {{{./usage.html}usage page}}, while
for more advanced use cases refer to the {{{./advanced-usage.html}advanced usage page}}

View File

@ -1,76 +0,0 @@
------
Alfresco AMP Archetype Usage
------
Gabriele Columbro
------
Sept 2014
------
Prerequisites
See {{{../../prerequisites.html}SDK Pre-Requisites}} to successfully run this archetype.
Project layout
The archetype generated project should look like:
+---+
pom.xml
src/main/amp
|-> module.properties
|-> file-mapping.properties (optional)
|-> config/
|-> web/
|-> licenses/
src/main/java //Java classes to be packaged in the AMP embedded JAR)
src/main/resources //resources to the packaged in the AMP embedded JAR
src/main/resources/META-INF/resources //web resources to the packaged in the AMP embedded JAR, mapped to the root of the webapp as of Servlet 3.0)
src/test/java // Unit tests
src/test/resources // Unit test resources
src/test/properties/<env> // Environment aware alfresco-global.properties. By default <env>=local
+---+
Basically by default the folder <<<src/main/amp>>> maps the {{{https://wiki.alfresco.com/wiki/AMP_Files#The_structure_of_an_AMP_file}AMP structure}} and it's where you can build your module.
Usage
This project manages an AMP and provides support for typical development lifecycle use cases like:
* packaging
* rapid development
* testing (unit and integration)
* run embedded
* integration testing
* release and distribution of your AMP artifact.
The AMPs produced with this project are fully compatible with Alfresco MMT, in fact the Maven Alfresco plugin used to manage AMPs in this SDK embeds the official Alfresco MMT to install depdended AMPs.
Commands
<<<run.sh>>> will automatically set up the SDK and run the AMP on an Alfresco repo embedded to enable rapid development
Also, common AMP Maven lifecycle commands you want to run are:
* <<<mvn package>>>: Runs unit tests and packages AMP in <<<$\{project.build.directory\}/$\{project.build.finalName\}.amp>>>
* <<<mvn install>>>: Like <<<mvn package>>> but also installs AMP in local Maven repository to be depended upon
* <<<mvn install -Dmaven.test.skip=true>>>: Like <<<mvn install>>> but skips unit tests
* <<<mvn install -Pamp-to-war>>>: Like <<<mvn package -Pamp-to-war>>>
but also installs and runs the resulting WAR+AMP in Tomcat + H2 embedded from running and development.
This also enables rapid application development features, like hot reloading and remote JUnit running.
When you run this command then you can access in your browser <<< {{{http://localhost:8080/alfresco}}} >>>.
* <<<mvn clean -Ppurge>>>: Removes DB, alf_data, indexes and log files. Useful to purge the development repo (by default self contained in <<<$\{project.basedir\}/alf_data_dev>>>

View File

@ -1,51 +0,0 @@
<project>
<body>
<!--<menu ref="parent" inherit="bottom"/>-->
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '${gaTrackingId}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<menu name="Alfresco AMP Archetype">
<item name="Introduction" href="index.html"/>
<item name="Usage" href="usage.html"/>
<item name="Advanced Usage" href="advanced-usage.html"/>
</menu>
<menu name="SDK components">
<item name="Maven Alfresco SDK" href="../../index.html" />
<item name="Alfresco AMP Archetype" href="./index.html" />
<item name="Share AMP Archetype" href="../share-amp-archetype/index.html" />
<item name="Alfresco All-in-One Archetype" href="../alfresco-allinone-archetype/index.html" />
<item name="Maven Alfresco SDK Parent POM" href="../../poms/alfresco-sdk-parent/index.html" />
<item name="Alfresco Platform Distribution POM" href="https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-platform-distribution/latest/index.html" />
<item name="Maven Alfresco Plugin" href="../../plugins/alfresco-maven-plugin/index.html" />
</menu>
<menu name="Alfresco Community">
<item name="Official Maven Alfresco SDK docs" href="http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html" />
<item name="Maven Alfresco Wiki Documentation" href="http://wiki.alfresco.com/wiki/Maven_Alfresco_SDK" />
<item name="Alfresco with Maven for Dummies" href="https://wiki.alfresco.com/wiki/Maven_For_Dummies" />
<item name="Developer Access (Google Code)" href="http://code.google.com/p/maven-alfresco-archetypes/" />
<item name="Gabriele Columbro's blog" href="http://www.mindthegab.com/" />
<item name="Maurizio Pillitu's blog" href="http://www.session.it/" />
<item name="Carlo Sciolla's blog" href="http://skuro.tk/" />
<item name="Enterprise adoption" href="http://www.slideshare.net/guest67a9ba/maven-application-lifecycle-management-for-alfresco" />
</menu>
<!-- maybe it's inherited? -->
<!--<menu ref="reports"/>-->
</body>
</project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="AMP Archetype for Alfresco. Provides rapid development, IDE integration, and running embedded an Alfresco Repo AMP"
name="Alfresco Platform JAR Archetype"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>
@ -9,7 +9,14 @@
<defaultValue>1.0-SNAPSHOT</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="false" packaged="false" encoding="UTF-8">
<directory>src/main/assembly</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
@ -23,7 +30,7 @@
</includes>
</fileSet>
<fileSet encoding="UTF-8" filtered="false">
<directory>src/main/amp</directory>
<directory>src/main/resources</directory>
<includes>
<include>**</include>
</includes>
@ -32,34 +39,23 @@
<exclude>**/log4j.properties</exclude>
</excludes>
</fileSet>
<fileSet encoding="UTF-8" filtered="true">
<directory>src/main/amp/config/alfresco/module/__artifactId__</directory>
<includes>
<include>log4j.properties</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8" filtered="true" packaged="false">
<directory>src/main/amp</directory>
<directory>src/main/resources</directory>
<includes>
<include>**/*-context.xml</include>
<include>**/log4j.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<fileSet encoding="UTF-8" filtered="false">
<directory>src/test/resources</directory>
<includes>
<include>**/*</include>
<include>**</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<fileSet encoding="UTF-8" filtered="false">
<directory>src/test/properties</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<directory>tomcat</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
@ -67,6 +63,7 @@
<includes>
<include>run.sh</include>
<include>run.bat</include>
<include>README.md</include>
</includes>
</fileSet>
</fileSets>

View File

@ -0,0 +1,35 @@
# Alfresco Platform JAR Module - SDK 3
To run use `mvn clean install -DskipTests=true alfresco:run` or `./run.sh` and verify that it
* Runs the embedded Tomcat + H2 DB
* Runs Alfresco Platform (Repository)
* Runs Alfresco Solr4
* Packages both as JAR and AMP assembly
Try cloning it, change the port and play with `enableShare`, `enablePlatform` and `enableSolr`.
Protip: This module will work just fine as a Share module if the files are changed and
if the enablePlatform and enableSolr is disabled.
# Few things to notice
* No parent pom
* WAR assembly is handled by the Alfresco Maven Plugin configuration
* Standard JAR packaging and layout
* Works seamlessly with Eclipse and IntelliJ IDEA
* JRebel for hot reloading, JRebel maven plugin for generating rebel.xml, agent usage: `MAVEN_OPTS=-Xms256m -Xmx1G -agentpath:/home/martin/apps/jrebel/lib/libjrebel64.so`
* AMP as an assembly
* [Configurable Run mojo](https://github.com/Alfresco/alfresco-sdk/blob/sdk-3.0/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RunMojo.java) in the `alfresco-maven-plugin`
* No unit testing/functional tests just yet
* Resources loaded from META-INF
* Web Fragment (this includes a sample servlet configured via web fragment)
# TODO
* Abstract assembly into a dependency so we don't have to ship the assembly in the archetype
* Purge,
* Functional/remote unit tests

View File

@ -0,0 +1,224 @@
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<name>${artifactId} Platform Jar Module - SDK 3</name>
<description>Platform JAR Module (to be included in the alfresco.war) - SDK 3</description>
<packaging>jar</packaging>
<properties>
<alfresco.sdk.version>3.0.0-SNAPSHOT</alfresco.sdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Alfresco Data directory, which will contain:
Content Store (i.e. the files we upload)
Database (i.e. the metadata for the uploaded files)
Search index (i.e. the indexed content and metadata)
Configured in alfresco-global.properties with the 'dir.root' property.
-->
<alfresco.data.location>${session.executionRootDirectory}/alf_data_dev</alfresco.data.location>
<!-- Duplicated with alfresco.solrHome in the plugin, we need them out here to do filtering -->
<solr.home>${alfresco.data.location}/solr</solr.home>
<solr.model.dir>${solr.home}/alfrescoModels</solr.model.dir>
<solr.content.dir>${solr.home}/index</solr.content.dir>
<!-- Alfresco webapp artifacts and versions, these are the original Alfresco webapps that will be
customized and then deployed and run by the tomcat maven plugin when
executing for example $ mvn clean install alfresco:run -->
<alfresco.groupId>org.alfresco</alfresco.groupId>
<alfresco.platform.war.artifactId>alfresco-platform</alfresco.platform.war.artifactId>
<alfresco.platform.version>5.1.g</alfresco.platform.version>
<alfresco.share.version>5.1.f</alfresco.share.version>
<!-- Alfresco Repo Database configuration.
By default it uses a flat file H2 database to be able to run embedded.
The H2 database implementation is brought in via the tomcat7-maven-plugin as a dependency.
The data files for the H2 database will be created in a relative path, such as alf_data_dev/h2_data/alf_dev,
see alfresco.db.url below.
For more information about the db parameters see:http://www.h2database.com/html/features.html
-->
<alfresco.db.name>alf_dev</alfresco.db.name>
<alfresco.db.username>alfresco</alfresco.db.username>
<alfresco.db.password>alfresco</alfresco.db.password>
<alfresco.db.params>AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=FALSE;LOCK_MODE=0
</alfresco.db.params>
<alfresco.db.url>jdbc:h2:${alfresco.data.location}/h2_data/${alfresco.db.name};${alfresco.db.params}
</alfresco.db.url>
<alfresco.db.datasource.class>org.h2.jdbcx.JdbcDataSource</alfresco.db.datasource.class>
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
<jrebel.version>1.1.6</jrebel.version>
<!-- Environment to use, Alfresco Maven Plugin will copy alfresco-global.properties from this directory -->
<env>local</env>
</properties>
<!-- This will import the dependencyManagement for all artifacts in the selected Alfresco platform.
NOTE: You still need to define dependencies in your POM,
but you can omit version as it's enforced by this dependencyManagement.
NOTE: It defaults to the latest version this SDK pom has been tested with,
but alfresco version can/should be overridden in your project's pom
-->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-platform-distribution</artifactId>
<version>${alfresco.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- The main Alfresco Repo dependency for compiling Java code in src/main/java -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-repository</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!--
The Alfresco Maven Plugin contains all the logic to run the extension
in an embedded Tomcat with the H2 database.
-->
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
<configuration>
<!-- We need the flat file H2 database to run the Repo -->
<enableH2>true</enableH2>
<!-- This is a platform extension JAR, so we need the platform webapp (alfresco.war) -->
<enablePlatform>true</enablePlatform>
<!-- Enable Solr so we can use search, our Repo extension probably need search -->
<enableSolr>true</enableSolr>
<!-- We don't need the share.war if we don't have any UI extensions -->
<enableShare>false</enableShare>
<!--
JARs and AMPs that should be overlayed/applied to the Platform/Repository WAR
(i.e. alfresco.war)
-->
<platformModules>
<!-- This AMP is needed if we are going to access the platform webapp from a Share webapp -->
<moduleDependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-share-services</artifactId>
<version>${alfresco.share.version}</version>
<type>amp</type>
</moduleDependency>
</platformModules>
</configuration>
</plugin>
<!-- Build an AMP if 3rd party libs are needed by the extension -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>build-amp-file</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/amp.xml</descriptor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
</dependency>
</dependencies>
</plugin>
<!-- Hot reloading with JRebel -->
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>${jrebel.version}</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<!--
addResourcesDirToRebelXml - default is false
Required if the resource directories are to be added to rebel.xml
-->
<addResourcesDirToRebelXml>true</addResourcesDirToRebelXml>
<!-- Always generate the rebel.xml file no matter what timestamps -->
<alwaysGenerate>true</alwaysGenerate>
</configuration>
</plugin>
</plugins>
<resources>
<!-- Filter the resource files in this project and do property substitutions -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<!-- Filter the test resource files in this project and do property substitutions -->
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
<!--
Alfresco Maven Repositories
-->
<repositories>
<repository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
<repository>
<id>alfresco-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>alfresco-plugin-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<id>alfresco-plugin-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -0,0 +1,8 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dev environment startup script for Alfresco Community ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set MAVEN_OPTS=-Xms256m -Xmx2G
mvn clean install -DskipTests=true alfresco:run

View File

@ -0,0 +1,3 @@
#!/bin/bash
MAVEN_OPTS="-Xms256m -Xmx2G" mvn clean install -DskipTests=true alfresco:run

View File

@ -0,0 +1,27 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>build-amp-file</id>
<formats>
<format>amp</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>src/main/resources/alfresco/module/${project.artifactId}/module.properties</source>
<filtered>true</filtered>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>

View File

@ -1,7 +1,7 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.demoamp;
package ${package}.platformsample;
/**
* This class does nothing except dump some output to <i>system.out</i>.
@ -13,6 +13,6 @@ public class Demo
{
public void init()
{
System.out.println("SDK Demo AMP class has been loaded");
System.out.println("Platform JAR Module class has been loaded");
}
}

View File

@ -17,7 +17,7 @@ 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 ${package}.demoamp;
package ${package}.platformsample;
import org.alfresco.repo.module.AbstractModuleComponent;
import org.alfresco.repo.nodelocator.NodeLocatorService;
@ -55,7 +55,7 @@ public class DemoComponent extends AbstractModuleComponent {
@Override
protected void executeInternal() throws Throwable {
System.out.println("DemoComponent has been executed");
log.debug("Test debug logging. Congratulation your AMP is working");
log.debug("Test debug logging. Congratulation your JAR Module is working");
log.info("This is only for information purposed. Better remove me from the log in Production");
}

View File

@ -17,7 +17,7 @@ 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 ${package}.demoamp;
package ${package}.platformsample;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.DeclarativeWebScript;

View File

@ -1,5 +1,5 @@
## This Alfresco Repo Configuration file should be used for custom properties that are introduced by this module.
## This Alfresco Platform Configuration file should be used for custom properties that are introduced by this module.
## Define default values for all properties here.
## System Administrators can override these values in environment specific configurations in
## alfresco/tomcat/shared/classes/alfresco-global.properties.
##
##

View File

@ -10,7 +10,6 @@
<!-- The bootstrap-context.xml file is used for patch definitions, importers,
workflow, and loading custom content models. -->
<!-- Registration of new models -->
<bean id="${package}.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
@ -20,7 +19,16 @@
</list>
</property>
</bean>
<bean id="${package}.sampleprocess.workflowBootstrap" parent="workflowDeployer">
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">activiti</prop>
<prop key="location">alfresco/module/${project.artifactId}/workflow/sample-process.bpmn20.xml</prop>
<prop key="mimetype">text/xml</prop>
</props>
</list>
</property>
</bean>
</beans>

View File

@ -0,0 +1,42 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
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.
-->
<beans>
<!-- A simple class that is initialized by Spring -->
<bean id="${package}.exampleBean" class="${package}.platformsample.Demo" init-method="init" />
<!-- A simple module component that will be executed once.
Note. this module component will only be executed once, and then there will be an entry for it in the Repo.
So doing for example $ mvn clean install -Prun twice will only execute this component the first time.
You need to remove /alf_data_dev for it to be executed again. -->
<bean id="${package}.exampleComponent" class="${package}.platformsample.DemoComponent" parent="module.baseComponent" >
<property name="moduleId" value="${artifactId}" /> <!-- See module.properties -->
<property name="name" value="exampleComponent" />
<property name="description" value="A demonstration component" />
<property name="sinceVersion" value="1.0" />
<property name="appliesFromVersion" value="1.0" />
<property name="nodeService" ref="NodeService" />
<property name="nodeLocatorService" ref="nodeLocatorService" />
</bean>
</beans>

View File

@ -20,8 +20,8 @@
limitations under the License.
-->
<beans>
<bean id="webscript.helloworld.get"
class="${package}.demoamp.HelloWorldWebScript"
<bean id="webscript.alfresco.tutorials.helloworld.get"
class="${package}.platformsample.HelloWorldWebScript"
parent="webscript">
</bean>
</beans>

View File

@ -40,4 +40,4 @@
# those in the webapp's main log4j.properties.
#
#-----------------------------------------------------------------------
log4j.logger.${package}.demoamp.DemoComponent=debug
log4j.logger.${package}.platformsample.DemoComponent=debug

View File

@ -24,4 +24,31 @@
Constraints, Types, and Aspects go here...
-->
<types>
<type name="myc:doc">
<title>Sample Document Type</title>
<parent>cm:content</parent>
<properties>
<property name="myc:property">
<title>Sample Property</title>
<type>d:text</type>
</property>
</properties>
<associations>
<association name="myc:association">
<title>Sample Association</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>myc:doc</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
</types>
</model>

View File

@ -24,7 +24,7 @@ module.id=${project.artifactId}
#module.aliases=myModule-123, my-module
module.title=${project.name}
module.description=${project.description}
module.version=${noSnapshotVersion}
module.version=${project.version}
# The following optional properties can be used to prevent the module from being added
# to inappropriate versions of the WAR file.

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="my-process">
<startEvent id="start" />
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask" />
<userTask id="someTask" name="Activiti is awesome!" />
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end" />
<endEvent id="end" />
</process>
</definitions>

View File

@ -37,11 +37,13 @@ share.host=localhost
share.port=8080
share.protocol=http
index.subsystem.name=solr4
solr.host=localhost
solr.port=8080
solr.secureComms=none
# Don't try and recover any index
index.recovery.mode=NONE
# As we run embedded, we set Lucene
# TODO: Find a better solution for indexing, as buildonly (embedded Lucene) is deprecated and going to be removed soon
index.subsystem.name=buildonly
# These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date
# See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597

View File

@ -1,8 +1,5 @@
# This is a full override of Alfresco 4.2.b log4j.properties
# This file overwrites the alfresco.war log4j.properties
# Set root logger level to error
log4j.rootLogger=${app.log.root.level}, Console, File
log4j.rootLogger=error, Console, File
###### Console appender definition #######
@ -16,11 +13,11 @@ log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t]
###### File appender definition #######
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=${app.log.dir}alfresco.log
log4j.appender.File.File=alfresco.log
log4j.appender.File.Append=true
log4j.appender.File.DatePattern='.'yyyy-MM-dd
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n
###### Hibernate specific appender definition #######
#log4j.appender.file=org.apache.log4j.FileAppender
@ -70,10 +67,10 @@ log4j.logger.org.hibernate.ps.PreparedStatementCache=info
# Alfresco
log4j.logger.org.alfresco=error
log4j.logger.org.alfresco.repo.admin=info
log4j.logger.org.alfresco.repo.transaction=warn
log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn
log4j.logger.org.alfresco.repo.model.filefolder=warn
log4j.logger.org.alfresco.repo.tenant=info
log4j.logger.org.alfresco.repo.avm=info
log4j.logger.org.alfresco.config=warn
log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn
log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn
@ -89,23 +86,18 @@ log4j.logger.org.alfresco.web=info
#log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug
#log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug
#log4j.logger.org.alfresco.web.bean.clipboard=debug
log4j.logger.org.alfresco.repo.webservice=info
log4j.logger.org.alfresco.service.descriptor.DescriptorService=info
#log4j.logger.org.alfresco.web.page=debug
log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error
#log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info
log4j.logger.org.alfresco.web.ui.common.Utils=error
#log4j.logger.org.alfresco.web.ui.common.Utils=info
log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info
log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info
# Specific patches
log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info
log4j.logger.org.alfresco.repo.version.VersionMigrator=info
log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info
log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info
log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info
@ -113,17 +105,17 @@ log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info
log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn
log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn
log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info
log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info
log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info
log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn
log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn
log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn
log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn
log4j.logger.org.alfresco.util.AbstractTriggerBean=warn
log4j.logger.org.alfresco.enterprise.repo.cache.cluster.KeepAliveHeartbeatReceiver=info
log4j.logger.org.alfresco.enterprise.repo.cluster=info
log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn
#log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug
log4j.logger.org.alfresco.repo.node.db.NodeStringLengthWorker=info
log4j.logger.org.alfresco.repo.workflow=info
@ -138,7 +130,7 @@ log4j.logger.org.alfresco.ftp.protocol=error
# WebDAV debugging
#log4j.logger.org.alfresco.webdav.protocol=debug
log4j.logger.org.alfresco.webdav.protocol=error
log4j.logger.org.alfresco.webdav.protocol=info
# NTLM servlet filters
#log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug
@ -154,9 +146,6 @@ log4j.logger.org.alfresco.fileserver=warn
# Repo filesystem debug logging
#log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug
# AVM filesystem debug logging
#log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug
# Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated
log4j.logger.org.alfresco.repo.node.integrity=ERROR
@ -172,18 +161,9 @@ log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=
# log4j.logger.org.alfresco.repo.audit=DEBUG
# log4j.logger.org.alfresco.repo.audit.model=DEBUG
# Forms debugging
# log4j.logger.org.alfresco.web.forms=debug
# log4j.logger.org.chiba.xml.xforms=debug
log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error
log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error
# Property sheet and modelling debugging
# change to error to hide the warnings about missing properties and associations
log4j.logger.alfresco.missingProperties=warn
log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn
log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn
#log4j.logger.org.alfresco.web.ui.repo.component.property=debug
# Dictionary/Model debugging
log4j.logger.org.alfresco.repo.dictionary=warn
@ -211,7 +191,6 @@ log4j.logger.org.alfresco.repo.usage=info
log4j.logger.org.alfresco.module.vti=info
# Forms Engine
log4j.logger.org.alfresco.repo.forms=info
log4j.logger.org.alfresco.web.config.forms=info
log4j.logger.org.alfresco.web.scripts.forms=info
@ -221,6 +200,8 @@ log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error
log4j.logger.org.alfresco.cmis=error
log4j.logger.org.alfresco.cmis.dictionary=warn
log4j.logger.org.apache.chemistry.opencmis=info
log4j.logger.org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet=OFF
log4j.logger.org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet=OFF
# IMAP
log4j.logger.org.alfresco.repo.imap=info
@ -246,7 +227,13 @@ log4j.logger.org.alfresco.repo.jscript=error
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn
log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info
log4j.logger.org.alfresco.repo.avm.actions=info
log4j.logger.org.alfresco.repo.domain.schema.script.ScriptBundleExecutorImpl=off
log4j.logger.org.alfresco.repo.domain.schema.script.ScriptExecutorImpl=info
log4j.logger.org.alfresco.repo.search.impl.solr.facet.SolrFacetServiceImpl=info
# Bulk Filesystem Import Tool
log4j.logger.org.alfresco.repo.bulkimport=warn
# Freemarker
# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler
@ -263,4 +250,15 @@ log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal
# no index support
log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal
log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal
log4j.logger.org.alfresco.demoamp.test=DEBUG
# lucene index warnings
log4j.logger.org.alfresco.repo.search.impl.lucene.index.IndexInfo=warn
# Warn about RMI socket bind retries.
log4j.logger.org.alfresco.util.remote.server.socket.HostConfigurableSocketFactory=warn
log4j.logger.org.alfresco.repo.usage.RepoUsageMonitor=info
# Authorization
log4j.logger.org.alfresco.enterprise.repo.authorization.AuthorizationService=info
log4j.logger.org.alfresco.enterprise.repo.authorization.AuthorizationsConsistencyMonitor=warn

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="${solr.home}" override="true"/>
<Environment name="solr/model/dir" type="java.lang.String" value="${solr.model.dir}" override="true"/>
<Environment name="solr/content/dir" type="java.lang.String" value="${solr.content.dir}" override="true"/>
</Context>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="Share AMP Archetype for Alfresco. Provides rapid development, IDE integration, and running embedded an Alfresco Share AMP"
name="Alfresco Share JAR Archetype."
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>

View File

@ -1,59 +0,0 @@
------
Alfresco Share AMP Archetype Advanced Usage
------
Gabriele Columbro
------
Nov 2012
------
Unit Testing
Unit test your AMP customization is as easy as adding your tests in <<<src/test/java>>>. The current module in development
will be added to the test classpath together with all necessary Alfresco Spring contexts.
Running <<<mvn test>>> will results in your unit tests to be run. You can skip this (<<<not recommended>>>)
adding <<<-DskipTests>>> to your command line.
Share AMP Archetype properties
In the AMP archetype (as in the whole Alfresco SDK\x99) properties are configurable at many levels:
* as POM properties
* direclty in *.properties, particularly
* <<<src/main/amp/module.properties>>> (filtered and packaged in the AMP)
* Common properties
Archetype behavior can mostly be controlled directly in the POM, via common properties provided by the parent POM.
See {{{../../poms/alfresco-sdk-parent/sdk-properties.html} SDK properties reference}} for details.
* AMP specific properties
In addition to the common properties, the following properties are specific of the AMP archetype:
+---+
<project>
...
<properties>
<!--
Determines the coordinates of target WAR for this AMP
Allowed values: alfresco (default) | share
-->
<alfresco.client.war>alfresco</alfresco.client.war>
<alfresco.client.war.groupId>${alfresco.groupId}</alfresco.client.war.groupId>
<alfresco.client.war.version>${alfresco.version}</alfresco.client.war.version>
</properties>
...
</project>
+---+
Parent POM and behavior customization
To customize the behavior of your project, check out full set of the properties and plugin configurations defined in the
{{{../../poms/alfresco-sdk-parent/index.html}single entry point parent POM}}.
One quick way to do that is to use the <<<maven-help-plugin:effective-pom>>> to analyze your POM at runtime.

View File

@ -1,68 +0,0 @@
------
Building AMPs (Alfresco Module Packages) with Maven
------
Gabriele Columbro
------
Sept 2014
------
Introduction
The Share AMP Archetype is a sample fully featured project to manage AMP (Alfresco Module Package) projects.
This archetype can be used for Alfresco Share AMPs.
* Features
Amongst other features, this archetype provides support for:
* <<<amp>>> packaging support for your projects
* AMP dependency management in Maven
* Installation of AMPs in an Alfresco or Share WAR
* AMP Unit Testing support. Just run the standard <<<mvn test>>> and see your <<<src/test/java>>> Alfresco unit tests run.
* Support for unit and integration testing and rapid development (using spring-loaded, see run.sh)
* Seamless IDE integration with Eclipse and Idea
How to create a project:
As of version 2.0-beta-3, you can create a project with the latest released archetype with the following command directly from Maven Central:
+---+
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:share-amp-archetype
+---+
For previous versions, you need to use the Alfresco Artifacts repository:
+---+
mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:share-amp-archetype -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public/archetype-catalog.xml
+---+
You should then:
[[1]] Select the <<<share-amp-archetype>>> version
[[2]] Specify the <<<groupId>>> and <<<artifactId>>> for the project you want to create
[[3]] (<Optionally>) Select Alfresco Version / Edition (current default is: Alfresco Community 5.0.c)
You can find new Share AMP project ready to go in the <<<artifactId>>> folder.
Quickstart
Once your project is created:
* Enter the project folder and run <<<./run.sh>>> (you might need to <<<chmod u+x run.sh>>> to make it executable).
This will setup the SDK and the Alfresco Share on port 8081 (not Alfresco Repository or Solr).
* Wait for the startup of the webapp and then go <<<http://localhost:8081/share>>>. <NOTE>: For this to work you need
to have an Alfresco previously running on port 8080, for example as provided by the {{{../alfresco-amp-archetype/index.html}Alfresco AMP archetype}}
* Import the project in your favorite IDE (with Maven integration) and start developing right away.
Usage
Instructions on how to use the Share AMP archetype can be found on the {{{./usage.html}usage page}}, while
for more advanced use cases refer to the {{{./advanced-usage.html}advanced usage page}}

View File

@ -1,77 +0,0 @@
------
Maven Alfresco AMP Archetype Usage
------
Gabriele Columbro
------
Nov 2012
------
Prerequisites
See {{{../../prerequisites.html}SDK Pre-Requisites}} to successfully run this archetype.
Project layout
The archetype generated project should look like:
+---+
pom.xml
src/main/amp
|-> module.properties
|-> file-mapping.properties (optional)
|-> config/
|-> web/
|-> licenses/
src/main/java //Java classes to be packaged in the AMP embedded JAR)
src/main/resources //resources to the packaged in the AMP embedded JAR)
src/main/resources/META-INF/resources //web resources to the packaged in the AMP embedded JAR, mapped to the root of the webapp as of Servlet 3.0)
src/test/java // Unit tests
src/test/resources // Unit test resources
src/test/properties/<env> // Environment aware alfresco-global.properties. By default <env>=local
+---+
Basically by default the folder <<<src/main/amp>>> maps the {{{https://wiki.alfresco.com/wiki/AMP_Files#The_structure_of_an_AMP_file}AMP structure}} and it's where you can build your module.
Usage
This project manages an AMP and provides support for typical development lifecycle use cases like:
* packaging
* testing
* rapid development
* run embedded
* integration testing
* release and distribution of your Share AMP artifact.
The AMPs produced with this project are fully compatible with Alfresco MMT, in fact the Maven Alfresco plugin used to manage AMPs in this SDK embeds the official Alfresco MMT to install depdended AMPs.
Commands
<<<run.sh>>> will automatically set up the SDK and run the AMP on Alfresco Share embedded to enable rapid development
Other common Share AMP project lifecycle commands you want to run are:
* <<<mvn package>>>: Runs unit tests and packages AMP in <<<$\{project.build.directory\}/$\{project.build.finalName\}.amp>>>
* <<<mvn install>>>: Like <<<mvn package>>> but also installs AMP in local Maven repository to be depended upon
* <<<mvn install -Dmaven.test.skip=true>>>: Like <<<mvn install>>> but skips unit tests
* <<<mvn install -Pamp-to-war>>> Like <<<mvn package -Pamp-to-war>>>
but also installs and runs the resulting WAR+AMP in Tomcat + H2 embedded for integration testing.
When you run this command then you can access in your browser <<< {{{http://localhost:8080/alfresco}}} >>> or <<< {{{http://localhost:8080/share}}} >>>
depending on the value of the property <<<alfresco.client.war>>>
* <<<mvn install -Pamp-to-war -Dalfresco.client.war=share>>>: Like <<<mvn install -Pamp-to-war>>> but installs the AMP and runs on the Share WAR in Tomcat embedded.
* <<<mvn clean -Ppurge>>>: Removes DB, alf_data, indexes and log files. Useful to purge the development repo (by default self contained in <<<$\{project.basedir\}/alf_data_dev>>>

View File

@ -1,50 +0,0 @@
<project>
<body>
<!--<menu ref="parent" inherit="bottom"/>-->
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '${gaTrackingId}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<menu name="Share AMP Archetype">
<item name="Introduction" href="index.html"/>
<item name="Usage" href="usage.html"/>
<item name="Advanced Usage" href="advanced-usage.html"/>
</menu>
<menu name="SDK components">
<item name="Maven Alfresco SDK" href="../../index.html" />
<item name="Alfresco AMP Archetype" href="../alfresco-amp-archetype/index.html" />
<item name="Share AMP Archetype" href="./index.html" />
<item name="Alfresco All-in-One Archetype" href="../alfresco-allinone-archetype/index.html" />
<item name="Maven Alfresco SDK Parent POM" href="../../poms/alfresco-sdk-parent/index.html" />
<item name="Alfresco Platform Distribution POM" href="https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-platform-distribution/latest/index.html" />
<item name="Maven Alfresco Plugin" href="../../plugins/alfresco-maven-plugin/index.html" />
</menu>
<menu name="Alfresco Community">
<item name="Maven Alfresco Wiki Documentation" href="http://wiki.alfresco.com/wiki/Maven_Alfresco_SDK" />
<item name="Alfresco with Maven for Dummies" href="https://wiki.alfresco.com/wiki/Maven_For_Dummies" />
<item name="Developer Access (Google Code)" href="http://code.google.com/p/maven-alfresco-archetypes/" />
<item name="Gabriele Columbro's blog" href="http://www.mindthegab.com/" />
<item name="Maurizio Pillitu's blog" href="http://www.session.it/" />
<item name="Carlo Sciolla's blog" href="http://skuro.tk/" />
<item name="Enterprise adoption" href="http://www.slideshare.net/guest67a9ba/maven-application-lifecycle-management-for-alfresco" />
</menu>
<!-- maybe it's inherited? -->
<!--<menu ref="reports"/>-->
</body>
</project>

View File

@ -77,7 +77,7 @@
<id>gravitonian</id>
<name>Martin Bergljung</name>
<email>martin.bergljung@alfresco.com</email>
<url>http://www.marversolutions.com</url>
<url>https://sites.google.com/site/gravitonian/</url>
<organization>Alfresco Software</organization>
<organizationUrl>http://www.alfresco.com</organizationUrl>
<timezone>+0</timezone>
@ -124,8 +124,8 @@
<!-- POM files -->
<module>poms/alfresco-sdk-parent</module>
<!-- Archetypes -->
<module>archetypes/alfresco-amp-archetype</module>
<module>archetypes/share-amp-archetype</module>
<module>archetypes/alfresco-platform-jar-archetype</module>
<module>archetypes/alfresco-share-jar-archetype</module>
<module>archetypes/alfresco-allinone-archetype</module>
</modules>