Rewire the "installer" project to take a settings file rather than a profile activation

This commit is contained in:
Graham Triggs 2015-11-21 19:17:05 +00:00
parent 7f7c277da3
commit c9cb8aebfd
8 changed files with 262 additions and 202 deletions

18
default-settings.xml Normal file
View file

@ -0,0 +1,18 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<profiles>
<profile>
<id>defaults</id>
<properties>
<app-name>vivo</app-name>
<vivo-dir>/usr/local/vivo/home</vivo-dir>
<tomcat-dir>/usr/local/tomcat</tomcat-dir>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>defaults</activeProfile>
</activeProfiles>
</settings>

View file

@ -19,47 +19,60 @@
<name>VIVO Prepare Home</name>
<profiles>
<profile>
<id>install</id>
<activation>
<property><name>vivo-dir</name></property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/home.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${vivo-dir}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/home.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${home-dir}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>

View file

@ -12,64 +12,8 @@
<name>VIVO Installer</name>
<properties>
<app-name>vivo</app-name>
<home-dir>/usr/local/vivo/home</home-dir>
<tomcat-dir>/usr/local/tomcat</tomcat-dir>
</properties>
<build>
<plugins>
<!-- plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.16</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>unpack-home</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>vivo-home</includeArtifactIds>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<outputDirectory>target/home</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>install-home</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>/usr/local/vitro/test</outputDirectory>
<resources>
<resource>
<directory>target/home</directory>
<filtering>false</filtering>
</resource>
</resources>
<includeEmptyDirs>true</includeEmptyDirs>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin -->
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
@ -85,4 +29,65 @@
<module>solr</module>
<module>webapp</module>
</modules>
<profiles>
<profile>
<id>skip-install</id>
<activation>
<property><name>!vivo-dir</name></property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<executions>
<execution>
<id>default-compile</id>
<phase />
</execution>
<execution>
<id>default-testCompile</id>
<phase />
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-resources</id>
<phase />
</execution>
<execution>
<id>default-testResources</id>
<phase />
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<executions>
<execution>
<id>test</id>
<phase/>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-war</id>
<phase/>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View file

@ -19,59 +19,72 @@
<name>VIVO Prepare Solr App</name>
<profiles>
<profile>
<id>install</id>
<activation>
<property><name>vivo-dir</name></property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<archiveClasses>false</archiveClasses>
<overlays>
<overlay>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-solr</artifactId>
<type>war</type>
</overlay>
</overlays>
<webResources>
<resource>
<directory>src/main/webResources</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${tomcat-dir}/webapps/${app-name}solr</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<archiveClasses>false</archiveClasses>
<overlays>
<overlay>
<groupId>org.vivoweb</groupId>
<artifactId>vitro-solr</artifactId>
<type>war</type>
</overlay>
</overlays>
<webResources>
<resource>
<directory>src/main/webResources</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${tomcat-dir}/webapps/${app-name}solr</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>

View file

@ -2,7 +2,7 @@
<Environment
type="java.lang.String"
name="solr/home"
value="${home-dir}/solr" override="true"/>
value="${vivo-dir}/solr" override="true"/>
<!-- Disable persist sessions on shut down.-->
<Manager pathname="" />

View file

@ -19,63 +19,73 @@
<name>VIVO Prepare Web App</name>
<build>
<!-- filters>
<filter>${filters.file}</filter>
</filters -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<archiveClasses>false</archiveClasses>
<overlays>
<overlay>
<groupId>org.vivoweb</groupId>
<artifactId>vivo-webapp</artifactId>
<type>war</type>
</overlay>
</overlays>
<webResources>
<resource>
<directory>src/main/webResources</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>unpack</goal>
</goals>
<profiles>
<profile>
<id>install</id>
<activation>
<property><name>vivo-dir</name></property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<archiveClasses>false</archiveClasses>
<overlays>
<overlay>
<groupId>org.vivoweb</groupId>
<artifactId>vivo-webapp</artifactId>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${tomcat-dir}/webapps/${app-name}</outputDirectory>
</artifactItem>
</artifactItems>
</overlay>
</overlays>
<webResources>
<resource>
<directory>src/main/webResources</directory>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</execution>
</executions>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${tomcat-dir}/webapps/${app-name}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>

View file

@ -2,7 +2,7 @@
<Environment
type="java.lang.String"
name="vitro/home"
value="${home-dir}" override="true"/>
value="${vivo-dir}" override="true"/>
<!-- Disable persist sessions on shut down.-->
<Manager pathname="" />

View file

@ -22,6 +22,7 @@
<module>api</module>
<module>webapp</module>
<module>home</module>
<module>installer</module>
</modules>
<profiles>