From 561aa10ff797c53fffa4b57e97f3064b6e7dd11b Mon Sep 17 00:00:00 2001 From: mindthegab Date: Mon, 8 Sep 2014 20:31:43 -0400 Subject: [PATCH] fixes issue #200 fixes issue #213 - refactored solr pom to properly be a WAR project (no more POM) - removed ANTRUN for good. using maven-war-plugin to pacakge a proper solr customized war - added packaging of the -config.zip customized artifact for solr - updated archetypes to include the new files - updated runner configuration to run also solr as webapp - added root webapp with index.html so that opening localhost:8080 points easily to the installed webapps - aded context for solr - fixed Solr INFO logging by adding delegate=false in the context-solr.xml so that slf4j is NOT duplicated - minor naming updates --- .../META-INF/maven/archetype-metadata.xml | 12 + .../archetype-resources/runner/pom.xml | 20 +- .../runner/src/main/webapp/index.html | 22 ++ .../runner/tomcat/context-solr.xml | 12 + .../archetype-resources/solr/pom.xml | 352 +++++++++--------- .../src/assembly/solr-config-assembly.xml | 19 + 6 files changed, 262 insertions(+), 175 deletions(-) create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/src/main/webapp/index.html create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/tomcat/context-solr.xml create mode 100644 archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/assembly/solr-config-assembly.xml diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index 7c4047b3..21feb7b1 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -127,6 +127,12 @@ ** + + src/assembly + + ** + + src/main/resources @@ -160,6 +166,12 @@ ** + + src/main/webapp + + ** + + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml index ae63acaf..e9ccc8a8 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/pom.xml @@ -15,10 +15,6 @@ run - - - ${project.basedir}/../solr - @@ -56,17 +52,22 @@ - ${project.parent.basedir}/solr/target/solr-overlay - /solr - false true true + / ${project.parent.basedir}/solr/solr_home - ${project.build.directory} - true + + ${project.groupId} + solr + ${project.version} + war + true + /solr + ${project.build.directory}/contexts/context-solr.xml + ${project.groupId} repo @@ -92,4 +93,5 @@ + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/src/main/webapp/index.html b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/src/main/webapp/index.html new file mode 100644 index 00000000..d843aa84 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/src/main/webapp/index.html @@ -0,0 +1,22 @@ + + + Alfresco SDK 2.x - Running Alfresco ${alfresco.version} + + + Maven Alfresco SDK +

Welcome to the Alfresco SDK powered by Apache Maven! You can access the Alfresco components running embedded below:

+ +

Resources:

+ + + + \ No newline at end of file diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/tomcat/context-solr.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/tomcat/context-solr.xml new file mode 100644 index 00000000..d8de816b --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/runner/tomcat/context-solr.xml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml index e34eed4e..6776a41d 100644 --- a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/pom.xml @@ -2,8 +2,8 @@ 4.0.0 ${artifactId} - Alfresco Apache Solr Customization Module - pom + Alfresco Apache Solr Customization Project + war Alfresco Apache Solr Customization @@ -12,171 +12,191 @@ ${version} - - ${project.basedir}/solr_home - ${project.build.directory}/${project.artifactId}-overlay - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-alfresco-community-lib - unpack - generate-resources - - ${alfresco.solr.dir} - - - alfresco-solr - ${alfresco.groupId} - config - ${alfresco.version} - zip - - - - - - copy-alfresco-solr - unpack - generate-resources - - ${alfresco.solr.war.overlay} - - - alfresco-solr - ${alfresco.groupId} - ${alfresco.version} - war - - - - + + + ${project.basedir}/solr_home + - - - - - - com.google.code.maven-replacer-plugin - replacer - - - disable-securecomms - process-resources - - replace - - - - - true - ${alfresco.solr.war.overlay}/WEB-INF/web.xml - - - ]]> - ]]> - - - -->]]> - ]]> - - - ]]> - ]]> - - - ]]> - -->]]> - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - create-solr-war - package - - run - - - - - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - overlay-web-xml - generate-resources - copy-resources - - ${alfresco.solr.war.overlay}/WEB-INF - true - - - src/main/resources - true - classes - - - - - - copy-solr-resources - package - copy-resources - - ${alfresco.solr.dir} - - - src/main/solr-properties/archive - true - ${alfresco.solr.dir}/archive-SpacesStore/conf - - - src/main/solr-properties/workspace - true - ${alfresco.solr.dir}/workspace-SpacesStore/conf - - - src/main/solr-properties - true - - log4j-solr.properties - - - - - - - - - + + + + org.apache.maven.plugins + maven-resources-plugin + + + + copy-solr-properties + prepare-package + + copy-resources + + + ${alfresco.solr.dir} + + + src/main/solr-properties/archive + true + ${alfresco.solr.dir}/archive-SpacesStore/conf + + + src/main/solr-properties/workspace + true + ${alfresco.solr.dir}/workspace-SpacesStore/conf + + + src/main/solr-properties + true + + log4j-solr.properties + + + + + + + + + + maven-assembly-plugin + 2.4.1 + + + make-assembly + package + + single + + + + src/assembly/solr-config-assembly.xml + + + + + + + + - - - ${alfresco.groupId} - alfresco-solr - config - ${alfresco.version} - zip - - + + + + ${alfresco.groupId} + alfresco-solr + ${alfresco.version} + war + + + + ${alfresco.groupId} + alfresco-solr + ${alfresco.version} + classes + jar + provided + + + + ${alfresco.groupId} + alfresco-solr + config + ${alfresco.version} + zip + + + + + + + run + + ${project.build.directory}/${project.build.finalName}-patches + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-alfresco-config + + unpack + + generate-resources + + ${alfresco.solr.dir} + + + alfresco-solr + ${alfresco.groupId} + config + ${alfresco.version} + zip + + + + + + + + maven-war-plugin + + + unpack-solr-war + prepare-package + + exploded + + + + default-war + + ${app.solr.patches.folder}/WEB-INF/web.xml + + + + + + + com.google.code.maven-replacer-plugin + replacer + + + disable-securecomms + prepare-package + + replace + + + + + ${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml + ${app.solr.patches.folder}/WEB-INF + false + + + ]]> + ]]> + + + -->]]> + ]]> + + + ]]> + ]]> + + + ]]> + -->]]> + + + + + + + + diff --git a/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/assembly/solr-config-assembly.xml b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/assembly/solr-config-assembly.xml new file mode 100644 index 00000000..4153b373 --- /dev/null +++ b/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/solr/src/assembly/solr-config-assembly.xml @@ -0,0 +1,19 @@ + + config + + zip + + false + + + ${project.basedir}/solr_home + + + archive/** + workspace/** + + + + \ No newline at end of file