Skip to content

Instantly share code, notes, and snippets.

@ohej
Created June 16, 2014 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohej/816b770b08ce633c13ea to your computer and use it in GitHub Desktop.
Save ohej/816b770b08ce633c13ea to your computer and use it in GitHub Desktop.
<?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>
<artifactId>solr</artifactId>
<name>Alfresco Apache Solr customization</name>
<packaging>pom</packaging>
<description>Alfresco Apache Solr Customization</description>
<parent>
<groupId>dk.ohej</groupId>
<artifactId>all-in-one</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<properties>
<alfresco.solr.dir>${project.basedir}/solr_home</alfresco.solr.dir>
<alfresco.solr.war.overlay>${project.build.directory}/${project.artifactId}-overlay</alfresco.solr.war.overlay>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-alfresco-community-lib</id>
<goals><goal>unpack</goal></goals>
<phase>generate-resources</phase>
<configuration>
<outputDirectory>${alfresco.solr.dir}</outputDirectory>
<artifactItems>
<artifactItem>
<artifactId>alfresco-solr</artifactId>
<groupId>${alfresco.groupId}</groupId>
<classifier>config</classifier>
<version>${alfresco.version}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>copy-alfresco-solr</id>
<goals><goal>unpack</goal></goals>
<phase>generate-resources</phase>
<configuration>
<outputDirectory>${alfresco.solr.war.overlay}</outputDirectory>
<artifactItems>
<artifactItem>
<artifactId>alfresco-solr</artifactId>
<groupId>${alfresco.groupId}</groupId>
<version>${alfresco.version}</version>
<type>war</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>overlay-web-xml</id>
<phase>process-resources</phase>
<goals><goal>copy-resources</goal></goals>
<configuration>
<outputDirectory>${alfresco.solr.war.overlay}/WEB-INF</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<targetPath>classes</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Replaces web.xml where applicable, commenting out the security-constraints -->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<id>disable-securecomms</id>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<ignoreErrors>true</ignoreErrors>
<file>${alfresco.solr.war.overlay}/WEB-INF/web.xml</file>
<replacements>
<replacement>
<token><![CDATA[<security-constraint>]]></token>
<value><![CDATA[<!-- <security-constraint>]]></value>
</replacement>
<replacement>
<token><![CDATA[</security-role>]]></token>
<value><![CDATA[</security-role> -->]]></value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>create-solr-war</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="Packaging Apache Solr WAR overlay" />
<zip basedir="${alfresco.solr.war.overlay}" destfile="${alfresco.solr.dir}/apache-solr-1.4.1-overlay.war" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-lib</id>
<phase>package</phase>
<goals><goal>copy-resources</goal></goals>
<configuration>
<outputDirectory>${alfresco.solr.dir}</outputDirectory>
<resources>
<resource>
<directory>src/main/solr-properties/archive</directory>
<filtering>true</filtering>
<targetPath>${alfresco.solr.dir}/archive-SpacesStore/conf</targetPath>
</resource>
<resource>
<directory>src/main/solr-properties/workspace</directory>
<filtering>true</filtering>
<targetPath>${alfresco.solr.dir}/workspace-SpacesStore/conf</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-solr</artifactId>
<classifier>config</classifier>
<version>${alfresco.version}</version>
<type>jar</type>
</dependency>
</dependencies>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment