From 495820dbc13248d28464c88a9b27a93d629af3f0 Mon Sep 17 00:00:00 2001 From: mindthegab Date: Wed, 27 Aug 2014 01:09:40 -0400 Subject: [PATCH 1/6] first take at intgration of the ATV. Getting 'Divide by Zero' exception so stopping for now --- plugins/alfresco-maven-plugin/pom.xml | 13 +++++ .../alfresco/maven/plugin/ValidateMojo.java | 55 +++++++++++++++++++ poms/alfresco-sdk-parent/pom.xml | 48 ++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java diff --git a/plugins/alfresco-maven-plugin/pom.xml b/plugins/alfresco-maven-plugin/pom.xml index 3d3c92c0..f165a5bf 100644 --- a/plugins/alfresco-maven-plugin/pom.xml +++ b/plugins/alfresco-maven-plugin/pom.xml @@ -81,6 +81,11 @@ alfresco-mmt 5.0.a + + org.alfrescolabs.alfresco-technical-validation + org.alfrescolabs.alfresco-technical-validation + 0.4.0 + @@ -92,4 +97,12 @@ + + + + + clojars.org + http://clojars.org/repo + + diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java new file mode 100644 index 00000000..50c12fa0 --- /dev/null +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java @@ -0,0 +1,55 @@ +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.skipValidation" default-value="true" + * @required + */ + protected boolean skip; + + /** + * [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(project.getBuild().getSourceDirectory(), project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName() + ".amp", "http://localhost:7474/db/data"); + } + } +} diff --git a/poms/alfresco-sdk-parent/pom.xml b/poms/alfresco-sdk-parent/pom.xml index 63f09a3b..79bd4e78 100644 --- a/poms/alfresco-sdk-parent/pom.xml +++ b/poms/alfresco-sdk-parent/pom.xml @@ -760,5 +760,53 @@ + + + atv + + false + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + run-atv + verify + + validate + + + + + + de.herschke + neo4j-maven-plugin + 2.0.2-20140827 + + + start-neo4j-server + post-integration-test + + start-server + + + + stop-neo4j-server + verify + + stop-server + + + + + 7474 + + + + + From 11a75c823afa97e649a92b908517a4c4a932f66d Mon Sep 17 00:00:00 2001 From: mindthegab Date: Fri, 29 Aug 2014 10:26:12 -0400 Subject: [PATCH 2/6] - fixed issue #210 --- .../properties/local/alfresco-global.properties | 15 ++++----------- .../properties/local/alfresco-global.properties | 12 +++--------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/src/main/properties/local/alfresco-global.properties b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/src/main/properties/local/alfresco-global.properties index 95592642..fd2e581c 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/src/main/properties/local/alfresco-global.properties +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/src/main/properties/local/alfresco-global.properties @@ -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 diff --git a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties index 81be215f..42f4f756 100644 --- a/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties +++ b/archetypes/alfresco-amp-archetype/src/main/resources/archetype-resources/src/test/properties/local/alfresco-global.properties @@ -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 \ No newline at end of file From 2718581d23095290183144965fc418571af39006 Mon Sep 17 00:00:00 2001 From: mindthegab Date: Fri, 29 Aug 2014 10:27:44 -0400 Subject: [PATCH 3/6] archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml --- .../archetype-resources/repo/pom.xml | 46 ++++++++++++++++++ .../archetype-resources/share/pom.xml | 48 +++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/pom.xml index 9d9ba42a..70a4ed97 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo/pom.xml @@ -149,5 +149,51 @@ + + rm + + alfresco-rm + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + get-rm-repo + package + + copy + + + ${app.rm.artifact} + ${app.rm.amps.location} + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + install-rm-repo + package + + install + + + + + ${app.rm.amps.location} + ${app.rm.war.location} + + + + + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml index 60cd1d2e..82b63dbe 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/share/pom.xml @@ -60,4 +60,52 @@ + + + rm + + alfresco-rm-share + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + get-rm-share + package + + copy + + + ${app.rm.artifact} + ${app.rm.amps.location} + + + + + + + org.alfresco.maven.plugin + alfresco-maven-plugin + + + install-rm-share + package + + install + + + + + ${app.rm.amps.location} + ${app.rm.war.location} + + + + + + From 4a6c98d2a45357b9e5d5fec2b93dd6c207090f28 Mon Sep 17 00:00:00 2001 From: mindthegab Date: Fri, 29 Aug 2014 10:28:27 -0400 Subject: [PATCH 4/6] first pass at issue #194 - integrated -Prm profile --- .../src/main/resources/archetype-resources/pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml index 3bad8104..14a4e597 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/pom.xml @@ -67,6 +67,15 @@ false + + + rm + + 2.3.a.1 + ${project.build.directory}/rm-amps + ${project.build.directory}/${project.build.finalName} + org.alfresco:${alfresco.rm.artifactId}:${alfresco.rm.version}:amp + + - From 9b712d83e2ed3f8544e2acf867302974ac860884 Mon Sep 17 00:00:00 2001 From: mindthegab Date: Fri, 29 Aug 2014 10:30:04 -0400 Subject: [PATCH 5/6] 2nd pass on issue #188 --- .../alfresco/maven/plugin/ValidateMojo.java | 29 ++++++++++++++-- poms/alfresco-sdk-parent/pom.xml | 33 ++++++++++++++++--- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java index 50c12fa0..c8aa268a 100644 --- a/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java +++ b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/ValidateMojo.java @@ -29,10 +29,35 @@ public class ValidateMojo extends AbstractMojo { /** * This parameter skips validation (the feature is experimental so disabled by default) * - * @parameter property="maven.alfresco.skipValidation" default-value="true" + * @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. @@ -49,7 +74,7 @@ public class ValidateMojo extends AbstractMojo { if(!skip) { AlfrescoTechnicalValidation atv = new AlfrescoTechnicalValidationImpl(); - atv.validate(project.getBuild().getSourceDirectory(), project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName() + ".amp", "http://localhost:7474/db/data"); + atv.validate(sourceLocation, binaryLocation, neo4jUrl); } } } diff --git a/poms/alfresco-sdk-parent/pom.xml b/poms/alfresco-sdk-parent/pom.xml index 79bd4e78..623ab816 100644 --- a/poms/alfresco-sdk-parent/pom.xml +++ b/poms/alfresco-sdk-parent/pom.xml @@ -56,7 +56,7 @@ alf_dev alfresco alfresco - MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=TRUE + MODE=PostgreSQL;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=FALSE;LOCK_MODE=0 jdbc:h2:./${alfresco.data.location}/h2_data/${alfresco.db.name};${alfresco.db.params} org.h2.jdbcx.JdbcDataSource @@ -655,7 +655,7 @@ run - integration-test + pre-integration-test false true @@ -760,14 +760,39 @@ - + atv - false + false + ${project.build.directory}/${project.build.finalName}-src + + maven-resources-plugin + + + isolate-project-src + generate-resources + + copy-resources + + + ${maven.alfresco.validation.sourceLocation} + + + ${project.basedir} + + target + + ${app.filtering.enabled} + + + + + + org.alfresco.maven.plugin alfresco-maven-plugin From 701c3e87d437ee5ef2e0280aadf8bc7da7d0686d Mon Sep 17 00:00:00 2001 From: mindthegab Date: Fri, 29 Aug 2014 13:51:11 -0400 Subject: [PATCH 6/6] completed rm integration --- .../archetype-resources/repo-amp/pom.xml | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo-amp/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo-amp/pom.xml index 449f9a14..ae698e46 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo-amp/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/repo-amp/pom.xml @@ -29,11 +29,20 @@ alfresco - - - - - + + + + rm + + + ${alfresco.groupId} + alfresco-rm + ${alfresco.rm.version} + jar + classes + + + +