This commit is contained in:
mindthegab 2014-08-29 19:00:06 -04:00
commit b4da819901
9 changed files with 294 additions and 29 deletions

View File

@ -67,6 +67,15 @@
<maven.alfresco.includeWebResources>false</maven.alfresco.includeWebResources>
</properties>
</profile>
<!-- RM profile, manually activated, automatically adds support for RM development (dependencies) and install the RM amps in the WARs -->
<profile>
<id>rm</id>
<properties>
<alfresco.rm.version>2.3.a.1</alfresco.rm.version>
<app.rm.amps.location>${project.build.directory}/rm-amps</app.rm.amps.location>
<app.rm.war.location>${project.build.directory}/${project.build.finalName}</app.rm.war.location>
<app.rm.artifact>org.alfresco:${alfresco.rm.artifactId}:${alfresco.rm.version}:amp</app.rm.artifact>
</properties>
</profile>
</profiles>
</project>

View File

@ -29,11 +29,20 @@
<!-- Defines the target WAR artifactId to run this amp, only used with the -Pamp-to-war switch
. | Allowed values: alfresco | share. Defaults to a repository AMP, but could point to your custom corporate Alfresco WAR -->
<alfresco.client.war>alfresco</alfresco.client.war>
<!-- Defines the target WAR groupId to run this amp, only used with the -Pamp-to-war profile
. | Could be org.alfresco or your corporate groupId -->
<!-- <alfresco.client.war.groupId>org.alfresco</alfresco.client.war.groupId> -->
<!-- Defines the target WAR version to run this amp, only used with the -Pamp-to-war profile -->
<!-- <alfresco.client.war.version>${alfresco.version}</alfresco.client.war.version> -->
</properties>
<profiles>
<!-- RM profile, manually activated, automatically adds support for RM development (dependencies) and install the RM amps in the WARs -->
<profile>
<id>rm</id>
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-rm</artifactId>
<version>${alfresco.rm.version}</version>
<type>jar</type>
<classifier>classes</classifier>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

View File

@ -149,5 +149,51 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>rm</id>
<properties>
<alfresco.rm.artifactId>alfresco-rm</alfresco.rm.artifactId>
</properties>
<build>
<plugins>
<!-- Fetch Alfresco RM repo AMP -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-rm-repo</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifact>${app.rm.artifact}</artifact>
<outputDirectory>${app.rm.amps.location}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- The current AMP artifact is installed into the Alfresco folder using alfresco-maven-plugin -->
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<executions>
<execution>
<id>install-rm-repo</id>
<phase>package</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
<configuration>
<ampLocation>${app.rm.amps.location}</ampLocation>
<warLocation>${app.rm.war.location}</warLocation>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -227,18 +227,11 @@ alfresco.rmi.services.host=0.0.0.0
# upgrading to a new version, this can be disabled.
#db.schema.update=true
# File servers related properties
# File servers related properties
# For local builds we disable CIFS and FTP. Edit the following property to reenable them
smb.server.enabled=false
smb.server.name=CFS_SHARE_LOCAL
smb.server.domain=mycompany.com
smb.server.bindto=127.0.0.1
smb.tcpip.port=1445
netbios.session.port=1139
netbios.name.port=1137
netbios.datagram.port=1138
ftp.server.enabled=false
cifs.enabled=false
ftp.enabled=false
ftp.port=1121
ftp.authenticator=alfresco

View File

@ -60,4 +60,52 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>rm</id>
<properties>
<alfresco.rm.artifactId>alfresco-rm-share</alfresco.rm.artifactId>
</properties>
<build>
<plugins>
<!-- Fetch Alfresco RM repo AMP -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-rm-share</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifact>${app.rm.artifact}</artifact>
<outputDirectory>${app.rm.amps.location}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- The current AMP artifact is installed into the Alfresco folder using alfresco-maven-plugin -->
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<executions>
<execution>
<id>install-rm-share</id>
<phase>package</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
<configuration>
<ampLocation>${app.rm.amps.location}</ampLocation>
<warLocation>${app.rm.war.location}</warLocation>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -46,14 +46,8 @@ db.pool.max=100
# File servers related properties
# For local builds we disable CIFS and FTP. Edit the following property to reenable them
smb.server.enabled=false
smb.server.name=CFS_SHARE_LOCAL
smb.server.domain=mycompany.com
smb.server.bindto=127.0.0.1
smb.tcpip.port=1445
netbios.session.port=1139
netbios.name.port=1137
netbios.datagram.port=1138
ftp.server.enables=false
cifs.enabled=false
ftp.enabled=false
ftp.port=1121
ftp.authenticator=alfresco

View File

@ -81,6 +81,11 @@
<artifactId>alfresco-mmt</artifactId>
<version>5.0.a</version>
</dependency>
<dependency>
<groupId>org.alfrescolabs.alfresco-technical-validation</groupId>
<artifactId>org.alfrescolabs.alfresco-technical-validation</artifactId>
<version>0.4.0</version>
</dependency>
</dependencies>
<reporting>
@ -92,4 +97,12 @@
</plugin>
</plugins>
</reporting>
<repositories>
<!-- Used for the ATV donwload -->
<repository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
</repository>
</repositories>
</project>

View File

@ -0,0 +1,80 @@
package org.alfresco.maven.plugin;
import java.io.File;
import org.alfrescolabs.technical.validation.AlfrescoTechnicalValidation;
import org.alfrescolabs.technical.validation.impl.AlfrescoTechnicalValidationImpl;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
/**
* This goal provides the EXPERIMENTAL feature of validating your AMP module (source and binaries)
* against Alfresco (Repository and Share) development best practices, providing validation and
* alerts that can be used to improve quality, longevity and supportability of your code.
*
* It uses the ATV (Alfresco Technical Validation https://github.com/AlfrescoLabs/technical-validation)
*
* @version $Id:$
* @goal validate
* @phase verify
* @requiresProject
* @since 2.0.0-beta-2
* @threadSafe
* @description Invokes the Alfresco Technical Validation (https://github.com/AlfrescoLabs/technical-validation) of your customization
*/
public class ValidateMojo extends AbstractMojo {
/**
* This parameter skips validation (the feature is experimental so disabled by default)
*
* @parameter property="maven.alfresco.validation.skip" default-value="true"
* @required
*/
protected boolean skip;
//
/**
* The directory where the source project is stored. Should not include /target otherwise checks will be duplicated.
*
* @parameter property="maven.alfresco.validation.sourceLocation" default-value="${project.build.directory}/${project.build.finalName}-src"
* @required
*/
protected String sourceLocation;
/**
* The directory where the binary AMP package is to be found
*
* @parameter property="maven.alfresco.validation.binaryLocation" default-value="${project.build.directory}/${project.build.finalName}.amp"
* @required
*/
protected String binaryLocation;
/**
* The directory where the binary AMP package is to be found
*
* @parameter property="maven.alfresco.validation.neo4jUrl" default-value="http://localhost:7474/db/data/"
* @required
*/
protected String neo4jUrl;
/**
* [Read Only] The Maven project.
*
* @parameter default-value="${project}"
* @required
* @readonly
*/
protected MavenProject project;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if(!skip)
{
AlfrescoTechnicalValidation atv = new AlfrescoTechnicalValidationImpl();
atv.validate(sourceLocation, binaryLocation, neo4jUrl);
}
}
}

View File

@ -56,7 +56,7 @@
<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>MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=TRUE</alfresco.db.params>
<alfresco.db.params>MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=FALSE;LOCK_MODE=0</alfresco.db.params>
<!-- By default the H2 embedded database datafile is created under the alfresco.data.location folder -->
<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>
@ -655,7 +655,7 @@
<goals>
<goal>run</goal>
</goals>
<phase>integration-test</phase>
<phase>pre-integration-test</phase>
<configuration>
<useTestClasspath>false</useTestClasspath>
<ignorePackaging>true</ignorePackaging>
@ -760,5 +760,78 @@
</plugins>
</build>
</profile>
<!-- Invokes the Alfresco Technical Validation tool at https://github.com/AlfrescoLabs/technical-validation -->
<profile>
<id>atv</id>
<properties>
<maven.alfresco.validation.skip>false</maven.alfresco.validation.skip>
<maven.alfresco.validation.sourceLocation>${project.build.directory}/${project.build.finalName}-src</maven.alfresco.validation.sourceLocation>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>isolate-project-src</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${maven.alfresco.validation.sourceLocation}</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}</directory>
<excludes>
<exclude>target</exclude>
</excludes>
<filtering>${app.filtering.enabled}</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<executions>
<execution>
<id>run-atv</id>
<phase>verify</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.herschke</groupId>
<artifactId>neo4j-maven-plugin</artifactId>
<version>2.0.2-20140827</version>
<executions>
<execution>
<id>start-neo4j-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
</execution>
<execution>
<id>stop-neo4j-server</id>
<phase>verify</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
<configuration>
<port>7474</port>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>