pom.xml
6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?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-config</artifactId>
<packaging>pom</packaging>
<name>Alfresco Solr 4 Configuration</name>
<description>Apache Solr 4 Configuration Customization</description>
<!-- Setup the parent extension project, which contain all the Alfresco Maven SDK stuff -->
<parent>
<groupId>org.alfresco.skype</groupId>
<artifactId>alfresco-skype-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<!-- Build Solr Configuration only when we run an embedded Tomcat (i.e. profile run is enabled).
We assume that there is no need to customize Apache Solr 4 itself. -->
<profiles>
<profile>
<id>run</id>
<properties>
<alfresco.solr.dir>${alfresco.data.location}/solr4</alfresco.solr.dir>
<alfresco.solr.home.dir>${alfresco.solr.dir}/config</alfresco.solr.home.dir>
<alfresco.solr.data.dir>${alfresco.solr.dir}/data</alfresco.solr.data.dir>
</properties>
<dependencies>
<!-- Download the default Solr4-config.zip Configuration files,
they will be updated so we can run locally over HTTP -->
<dependency>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-solr4</artifactId>
<version>${alfresco.version}</version>
<classifier>config</classifier>
<type>zip</type>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Run goal unpack and unzip the content of the downloaded default solr-config.zip file into the
alfresco-maven-sdk2-test/alf_data_dev/solr4/config directory
(The solr-config.zip is brought in via the dependency section) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-alfresco-config</id>
<goals>
<goal>unpack</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<outputDirectory>${alfresco.solr.home.dir}</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>${alfresco.groupId}</groupId>
<artifactId>alfresco-solr4</artifactId>
<version>${alfresco.version}</version>
<classifier>config</classifier>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- For windows paths, convert single \ to / for the ${alfresco.solr.data.dir} path,
by default it will be c:\bla\, we need forward slash or double backslash. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>regexp-property</id>
<phase>generate-resources</phase>
<goals>
<goal>regex-property</goal>
</goals>
</execution>
</executions>
<configuration>
<name>solrDataDir</name>
<value>${alfresco.solr.data.dir}</value>
<regex>\\</regex>
<replacement>/</replacement>
<failIfNoMatch>false</failIfNoMatch>
</configuration>
</plugin>
<!-- Run the goal replace and update configuration files for the
Solr cores to reflect our build structure -->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<executions>
<execution>
<id>setup-solr-config</id>
<phase>generate-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<regex>false</regex>
<includes>
<include>${alfresco.solr.home.dir}/archive-SpacesStore/conf/solrcore.properties</include>
<include>${alfresco.solr.home.dir}/workspace-SpacesStore/conf/solrcore.properties</include>
</includes>
<replacements>
<replacement>
<token>@@ALFRESCO_SOLR4_DATA_DIR@@</token>
<value>${solrDataDir}/index</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>