|
1 | 1 | <?xml version="1.0"?>
|
2 |
| -<!-- Author: Luca Cinquini Description: Maven descriptor that performs the following actions: 1. Downloads the Solr war file |
3 |
| - and copies it to the Tomcat distribution 2. --> |
4 |
| -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
5 |
| - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 2 | +<!-- Author: Luca Cinquini --> |
| 3 | +<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"> |
6 | 4 |
|
7 | 5 | <modelVersion>4.0.0</modelVersion>
|
8 | 6 |
|
9 | 7 | <artifactId>solr</artifactId>
|
10 | 8 | <packaging>pom</packaging>
|
11 |
| - <name>Apache Solr web application configured for LabCAS File Manager</name> |
| 9 | + <name>Apache Solr application configured for LabCAS File Manager</name> |
12 | 10 |
|
13 | 11 | <parent>
|
14 | 12 | <groupId>gov.nasa.jpl.edrn.labcas</groupId>
|
|
17 | 15 | <relativePath>../pom.xml</relativePath>
|
18 | 16 | </parent>
|
19 | 17 |
|
20 |
| - <!-- Solr webapp must be installed AFTER Tomcat is already installed --> |
21 |
| - <dependencies> |
22 |
| - <dependency> |
23 |
| - <groupId>gov.nasa.jpl.edrn.labcas</groupId> |
24 |
| - <artifactId>tomcat</artifactId> |
25 |
| - <version>${parent.version}</version> |
26 |
| - </dependency> |
27 |
| - </dependencies> |
28 |
| - |
29 | 18 | <build>
|
30 | 19 | <plugins>
|
31 | 20 |
|
32 |
| - <!-- download and install Solr web application into existing Tomcat installation including the needed logging jars --> |
| 21 | + <!-- download and install Solr full package (note: NOT available from Maven central) --> |
33 | 22 | <plugin>
|
34 |
| - <artifactId>maven-dependency-plugin</artifactId> |
| 23 | + <groupId>org.apache.maven.plugins</groupId> |
| 24 | + <artifactId>maven-antrun-plugin</artifactId> |
35 | 25 | <executions>
|
36 | 26 | <execution>
|
37 |
| - <id>install-solr</id> |
| 27 | + <id>download-solr</id> |
38 | 28 | <phase>install</phase>
|
39 | 29 | <goals>
|
40 |
| - <goal>copy</goal> |
| 30 | + <goal>run</goal> |
41 | 31 | </goals>
|
42 | 32 | <configuration>
|
43 |
| - <artifactItems> |
44 |
| - <artifactItem> |
45 |
| - <groupId>org.apache.solr</groupId> |
46 |
| - <artifactId>solr</artifactId> |
47 |
| - <version>${solr.version}</version> |
48 |
| - <type>war</type> |
49 |
| - <overWrite>true</overWrite> |
50 |
| - <outputDirectory>${install.dir}/apache-tomcat/webapps</outputDirectory> |
51 |
| - <destFileName>solr.war</destFileName> |
52 |
| - </artifactItem> |
53 |
| - <artifactItem> |
54 |
| - <groupId>org.slf4j</groupId> |
55 |
| - <artifactId>slf4j-api</artifactId> |
56 |
| - <version>${slf4j.version}</version> |
57 |
| - <type>jar</type> |
58 |
| - <outputDirectory>${install.dir}/apache-tomcat/lib</outputDirectory> |
59 |
| - </artifactItem> |
60 |
| - <artifactItem> |
61 |
| - <groupId>org.slf4j</groupId> |
62 |
| - <artifactId>jcl-over-slf4j</artifactId> |
63 |
| - <version>${slf4j.version}</version> |
64 |
| - <type>jar</type> |
65 |
| - <outputDirectory>${install.dir}/apache-tomcat/lib</outputDirectory> |
66 |
| - </artifactItem> |
67 |
| - <artifactItem> |
68 |
| - <groupId>org.slf4j</groupId> |
69 |
| - <artifactId>jul-to-slf4j</artifactId> |
70 |
| - <version>${slf4j.version}</version> |
71 |
| - <type>jar</type> |
72 |
| - <outputDirectory>${install.dir}/apache-tomcat/lib</outputDirectory> |
73 |
| - </artifactItem> |
74 |
| - <artifactItem> |
75 |
| - <groupId>org.slf4j</groupId> |
76 |
| - <artifactId>slf4j-log4j12</artifactId> |
77 |
| - <version>${slf4j.version}</version> |
78 |
| - <type>jar</type> |
79 |
| - <outputDirectory>${install.dir}/apache-tomcat/lib</outputDirectory> |
80 |
| - </artifactItem> |
81 |
| - <artifactItem> |
82 |
| - <groupId>log4j</groupId> |
83 |
| - <artifactId>log4j</artifactId> |
84 |
| - <version>${log4j.version}</version> |
85 |
| - <type>jar</type> |
86 |
| - <outputDirectory>${install.dir}/apache-tomcat/lib</outputDirectory> |
87 |
| - </artifactItem> |
88 |
| - </artifactItems> |
| 33 | + <target> |
| 34 | + <!-- run Ant "get" task to download the file --> |
| 35 | + <get src="${solr.repo}/${solr.version}/solr-${solr.version}.tgz" dest="." verbose="false" usetimestamp="true" /> |
| 36 | + </target> |
89 | 37 | </configuration>
|
90 | 38 | </execution>
|
91 |
| - </executions> |
92 |
| - </plugin> |
93 |
| - |
94 |
| - <plugin> |
95 |
| - <artifactId>maven-resources-plugin</artifactId> |
96 |
| - <executions> |
97 |
| - <!-- install customized log4j.properties into Tomcat --> |
98 | 39 | <execution>
|
99 |
| - <id>copy-log4j-properties</id> |
| 40 | + <id>unpack-solr</id> |
100 | 41 | <phase>install</phase>
|
101 | 42 | <goals>
|
102 |
| - <goal>copy-resources</goal> |
| 43 | + <goal>run</goal> |
103 | 44 | </goals>
|
104 | 45 | <configuration>
|
105 |
| - <outputDirectory>${install.dir}/apache-tomcat/lib</outputDirectory> |
106 |
| - <resources> |
107 |
| - <resource> |
108 |
| - <directory>${project.basedir}/src/main/resources</directory> |
109 |
| - <includes> |
110 |
| - <include>log4j.properties</include> |
111 |
| - </includes> |
112 |
| - </resource> |
113 |
| - </resources> |
| 46 | + <target> |
| 47 | + <!-- run Ant "untar" task to expand the file --> |
| 48 | + <untar src="./solr-${solr.version}.tgz" dest="${solr.dir}/" compression="gzip" overwrite="false" /> |
| 49 | + </target> |
114 | 50 | </configuration>
|
115 | 51 | </execution>
|
116 |
| - <!-- create and configure the SOLR_HOME directory --> |
| 52 | + <execution> |
| 53 | + <id>chmod-solr</id> |
| 54 | + <phase>install</phase> |
| 55 | + <goals> |
| 56 | + <goal>run</goal> |
| 57 | + </goals> |
| 58 | + <configuration> |
| 59 | + <target> |
| 60 | + <!-- run Ant "chmod" task to make the start/stop script executable --> |
| 61 | + <chmod file="${solr.dir}/solr-${solr.version}/bin/solr" perm="a+x"/> |
| 62 | + </target> |
| 63 | + </configuration> |
| 64 | + </execution> |
| 65 | + |
117 | 66 | <execution>
|
118 |
| - <id>copy-solr-xml</id> |
| 67 | + <id>symlink-solr</id> |
119 | 68 | <phase>install</phase>
|
120 | 69 | <goals>
|
121 |
| - <goal>copy-resources</goal> |
| 70 | + <goal>run</goal> |
122 | 71 | </goals>
|
123 | 72 | <configuration>
|
124 |
| - <outputDirectory>${solr.solr.home}</outputDirectory> |
125 |
| - <resources> |
126 |
| - <resource> |
127 |
| - <directory>${project.basedir}/src/main/resources</directory> |
128 |
| - <includes> |
129 |
| - <include>solr.xml</include> |
130 |
| - </includes> |
131 |
| - </resource> |
132 |
| - </resources> |
| 73 | + <target> |
| 74 | + <symlink resource="${solr.dir}/solr-${solr.version}" link="${solr.dir}/solr" overwrite="true" /> |
| 75 | + </target> |
133 | 76 | </configuration>
|
134 | 77 | </execution>
|
135 |
| - <!-- copy src/main/config/* to SOLR_HOME/${solr.solr.core}/conf/. --> |
| 78 | + </executions> |
| 79 | + </plugin> |
| 80 | + |
| 81 | + <!-- clone SOLR_HOME directory --> |
| 82 | + <plugin> |
| 83 | + <artifactId>maven-resources-plugin</artifactId> |
| 84 | + <executions> |
136 | 85 | <execution>
|
137 |
| - <id>copy-solr-config</id> |
| 86 | + <id>copy-solr-home</id> |
138 | 87 | <phase>install</phase>
|
139 | 88 | <goals>
|
140 | 89 | <goal>copy-resources</goal>
|
141 | 90 | </goals>
|
142 | 91 | <configuration>
|
143 |
| - <outputDirectory>${solr.solr.home}/oodt-fm/conf</outputDirectory> |
| 92 | + <outputDirectory>${solr.solr.home}</outputDirectory> |
144 | 93 | <resources>
|
145 | 94 | <resource>
|
146 |
| - <directory>${project.basedir}/src/main/config</directory> |
| 95 | + <directory>${project.basedir}/src/main/resources/solr-home</directory> |
| 96 | + <!-- enable filtering to replace value of ${solr.data.dir} in core.properties --> |
| 97 | + <filtering>true</filtering> |
147 | 98 | </resource>
|
148 | 99 | </resources>
|
149 | 100 | </configuration>
|
150 | 101 | </execution>
|
151 |
| - |
152 | 102 | </executions>
|
153 | 103 | </plugin>
|
154 |
| - |
155 |
| - <!-- clean up SOLR_HOME, SOLR_DATA_DIR --> |
156 |
| -<!-- <plugin> |
| 104 | + |
| 105 | + <!-- clean up Solr installation --> |
| 106 | + <plugin> |
157 | 107 | <artifactId>maven-clean-plugin</artifactId>
|
158 | 108 | <configuration>
|
159 | 109 | <filesets>
|
160 | 110 | <fileset>
|
161 |
| - <directory>${solr.solr.home}</directory> |
| 111 | + <directory>${solr.dir}/solr-${solr.version}</directory> |
162 | 112 | </fileset>
|
163 |
| - <fileset> |
| 113 | + <!-- <fileset> |
164 | 114 | <directory>${solr.data.dir}</directory>
|
165 |
| - </fileset> |
| 115 | + </fileset> --> |
| 116 | + <!-- <fileset> |
| 117 | + <directory>${solr.data.dir}</directory> |
| 118 | + </fileset> --> |
166 | 119 | </filesets>
|
167 | 120 | </configuration>
|
168 |
| - </plugin> --> |
| 121 | + </plugin> |
| 122 | + <plugin> |
| 123 | + <artifactId>maven-antrun-plugin</artifactId> |
| 124 | + <executions> |
| 125 | + <execution> |
| 126 | + <phase>clean</phase> |
| 127 | + <goals> |
| 128 | + <goal>run</goal> |
| 129 | + </goals> |
| 130 | + <id>unsymlink-solr</id> |
| 131 | + <configuration> |
| 132 | + <target> |
| 133 | + <symlink action="delete" link="${solr.dir}/solr" /> |
| 134 | + </target> |
| 135 | + </configuration> |
| 136 | + </execution> |
| 137 | + </executions> |
| 138 | + </plugin> |
169 | 139 |
|
170 | 140 | </plugins>
|
171 | 141 | </build>
|
|
0 commit comments