diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java index a8fd8aa2fd..267ec77472 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java @@ -45,6 +45,8 @@ public void contextInitialized(ServletContextEvent sce) { this.vitroHomeDir = VitroHomeDirectory.find(ctx); ss.info(this, vitroHomeDir.getDiscoveryMessage()); + this.vitroHomeDir.populate(); + locateApplicationConfigFile(); loadApplicationConfigFile(); createConfigurationBeanLoader(); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java index b55f9d87ed..be4a03c13b 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java @@ -4,16 +4,22 @@ import static edu.cornell.mannlib.vitro.webapp.application.BuildProperties.WEBAPP_PATH_BUILD_PROPERTIES; +import java.io.File; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import javax.naming.InitialContext; import javax.servlet.ServletContext; +import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -21,193 +27,238 @@ * Encapsulates some of the info relating to the Vitro home directory. */ public class VitroHomeDirectory { - private static final Log log = LogFactory.getLog(VitroHomeDirectory.class); - - public static VitroHomeDirectory find(ServletContext ctx) { - HomeDirectoryFinder finder = new HomeDirectoryFinder(ctx); - return new VitroHomeDirectory(ctx, finder.getPath(), - finder.getMessage()); - } - - private final ServletContext ctx; - private final Path path; - private final String discoveryMessage; - - public VitroHomeDirectory(ServletContext ctx, Path path, - String discoveryMessage) { - this.ctx = ctx; - this.path = path; - this.discoveryMessage = discoveryMessage; - } - - public ServletContext getCtx() { - return ctx; - } - - public Path getPath() { - return path; - } - - public String getDiscoveryMessage() { - return discoveryMessage; - } - - /** - * Find something that specifies the location of the Vitro home directory. - * Look in the JDNI environment, the system properties, and the - * build.properties file. - * - * If we don't find it, fail. If we find it more than once, use the first - * one (with a warning). If it is not an existing, readable directory, fail. - */ - private static class HomeDirectoryFinder { - /** JNDI path that defines the Vitro home directory */ - private static final String VHD_JNDI_PATH = "java:comp/env/vitro/home"; - - /** System property that defines the Vitro home directory */ - private static final String VHD_SYSTEM_PROPERTY = "vitro.home"; - - /** build.properties property that defines the Vitro home directory */ - private static final String VHD_BUILD_PROPERTY = "vitro.home"; - - private final ServletContext ctx; - private final List foundLocations = new ArrayList<>(); - - public HomeDirectoryFinder(ServletContext ctx) { - this.ctx = ctx; - - getVhdFromJndi(); - getVhdFromSystemProperties(); - getVhdFromBuildProperties(); - confirmExactlyOneResult(); - confirmValidDirectory(); - } - - public String getMessage() { - return foundLocations.get(0).getMessage(); - } - - public Path getPath() { - return foundLocations.get(0).getPath(); - } - - public void getVhdFromJndi() { - try { - String vhdPath = (String) new InitialContext() - .lookup(VHD_JNDI_PATH); - if (vhdPath == null) { - log.debug("Didn't find a JNDI value at '" + VHD_JNDI_PATH - + "'."); - } else { - log.debug("'" + VHD_JNDI_PATH + "' as specified by JNDI: " - + vhdPath); - String message = String.format( - "JNDI environment '%s' was set to '%s'", - VHD_JNDI_PATH, vhdPath); - foundLocations.add(new Found(Paths.get(vhdPath), message)); - } - } catch (Exception e) { - log.debug("JNDI lookup failed. " + e); - } - } - - private void getVhdFromSystemProperties() { - String vhdPath = System.getProperty(VHD_SYSTEM_PROPERTY); - if (vhdPath == null) { - log.debug("Didn't find a system property value at '" - + VHD_SYSTEM_PROPERTY + "'."); - } else { - log.debug("'" + VHD_SYSTEM_PROPERTY - + "' as specified by system property: " + vhdPath); - String message = String.format( - "System property '%s' was set to '%s'", - VHD_SYSTEM_PROPERTY, vhdPath); - foundLocations.add(new Found(Paths.get(vhdPath), message)); - } - } - - private void getVhdFromBuildProperties() { - try { - Map buildProps = new BuildProperties(ctx) - .getMap(); - String vhdPath = buildProps.get(VHD_BUILD_PROPERTY); - if (vhdPath == null) { - log.debug("build properties doesn't contain a value for '" - + VHD_BUILD_PROPERTY + "'."); - } else { - log.debug("'" + VHD_BUILD_PROPERTY - + "' as specified by build.properties: " + vhdPath); - String message = String.format( - "In resource '%s', '%s' was set to '%s'.", - WEBAPP_PATH_BUILD_PROPERTIES, VHD_BUILD_PROPERTY, - vhdPath); - foundLocations.add(new Found(Paths.get(vhdPath), message)); - } - } catch (Exception e) { - log.warn("Reading build properties failed. " + e); - } - } - - private void confirmExactlyOneResult() { - if (foundLocations.isEmpty()) { - String message = String.format("Can't find a value " - + "for the Vitro home directory. " - + "Looked in JNDI environment at '%s'. " - + "Looked for a system property named '%s'. " - + "Looked in 'WEB-INF/resources/build.properties' " - + "for '%s'.", VHD_JNDI_PATH, VHD_SYSTEM_PROPERTY, - VHD_BUILD_PROPERTY); - throw new IllegalStateException(message); - } else if (foundLocations.size() > 1) { - String message = "Found multiple values for the " - + "Vitro home directory: " + foundLocations; - log.warn(message); - } - } - - private void confirmValidDirectory() { - Path vhd = getPath(); - if (!Files.exists(vhd)) { - throw new IllegalStateException("Vitro home directory '" + vhd - + "' does not exist."); - } - if (!Files.isDirectory(vhd)) { - throw new IllegalStateException("Vitro home directory '" + vhd - + "' is not a directory."); - } - if (!Files.isReadable(vhd)) { - throw new IllegalStateException( - "Cannot read Vitro home directory '" + vhd + "'."); - } - if (!Files.isWritable(vhd)) { - throw new IllegalStateException( - "Can't write to Vitro home directory: '" + vhd + "'."); - } - } - - /** We found it: where and how. */ - private static class Found { - private final Path path; - private final String message; - - public Found(Path path, String message) { - this.path = path; - this.message = message; - } - - public Path getPath() { - return path; - } - - public String getMessage() { - return message; - } - - @Override - public String toString() { - return "Found[path=" + path + ", message=" + message + "]"; - } - } - } + private static final Log log = LogFactory.getLog(VitroHomeDirectory.class); + public static VitroHomeDirectory find(ServletContext ctx) { + HomeDirectoryFinder finder = new HomeDirectoryFinder(ctx); + return new VitroHomeDirectory(ctx, finder.getPath(), finder.getMessage()); + } + + private final ServletContext ctx; + private final Path path; + private final String discoveryMessage; + private Set excludedHomeFiles = new HashSet<>(Arrays.asList("rdf")); + private String homeSourcePath; + + public VitroHomeDirectory(ServletContext ctx, Path path, String discoveryMessage) { + this.ctx = ctx; + this.path = path; + this.discoveryMessage = discoveryMessage; + setHomeSourcePath(ctx); + } + + public ServletContext getCtx() { + return ctx; + } + + public Path getPath() { + return path; + } + + public String getDiscoveryMessage() { + return discoveryMessage; + } + + /** + * Get source home file directory path + * + * @return source home files directory path + */ + public String getSourcePath() { + return homeSourcePath; + } + + private void setHomeSourcePath(ServletContext context) { + String location = "/WEB-INF/resources/home-files"; + homeSourcePath = context.getRealPath(location); + if (homeSourcePath == null) { + throw new IllegalStateException(String.format("Application home files not found in: %s", location)); + } + } + + /** + * Find something that specifies the location of the Vitro home directory. Look in the JDNI environment, the system + * properties, and the build.properties file. + * + * If we don't find it, fail. If we find it more than once, use the first one (with a warning). If it is not an + * existing, readable directory, fail. + */ + private static class HomeDirectoryFinder { + /** JNDI path that defines the Vitro home directory */ + private static final String VHD_JNDI_PATH = "java:comp/env/vitro/home"; + + /** System property that defines the Vitro home directory */ + private static final String VHD_SYSTEM_PROPERTY = "vitro.home"; + + /** build.properties property that defines the Vitro home directory */ + private static final String VHD_BUILD_PROPERTY = "vitro.home"; + + private final ServletContext ctx; + private final List foundLocations = new ArrayList<>(); + + public HomeDirectoryFinder(ServletContext ctx) { + this.ctx = ctx; + + getVhdFromJndi(); + getVhdFromSystemProperties(); + getVhdFromBuildProperties(); + confirmExactlyOneResult(); + confirmValidDirectory(); + } + + public String getMessage() { + return foundLocations.get(0).getMessage(); + } + + public Path getPath() { + return foundLocations.get(0).getPath(); + } + + public void getVhdFromJndi() { + try { + String vhdPath = (String) new InitialContext().lookup(VHD_JNDI_PATH); + if (vhdPath == null) { + log.debug("Didn't find a JNDI value at '" + VHD_JNDI_PATH + "'."); + } else { + log.debug("'" + VHD_JNDI_PATH + "' as specified by JNDI: " + vhdPath); + String message = String.format("JNDI environment '%s' was set to '%s'", VHD_JNDI_PATH, vhdPath); + foundLocations.add(new Found(Paths.get(vhdPath), message)); + } + } catch (Exception e) { + log.debug("JNDI lookup failed. " + e); + } + } + + private void getVhdFromSystemProperties() { + String vhdPath = System.getProperty(VHD_SYSTEM_PROPERTY); + if (vhdPath == null) { + log.debug("Didn't find a system property value at '" + VHD_SYSTEM_PROPERTY + "'."); + } else { + log.debug("'" + VHD_SYSTEM_PROPERTY + "' as specified by system property: " + vhdPath); + String message = String.format("System property '%s' was set to '%s'", VHD_SYSTEM_PROPERTY, vhdPath); + foundLocations.add(new Found(Paths.get(vhdPath), message)); + } + } + + private void getVhdFromBuildProperties() { + try { + Map buildProps = new BuildProperties(ctx).getMap(); + String vhdPath = buildProps.get(VHD_BUILD_PROPERTY); + if (vhdPath == null) { + log.debug("build properties doesn't contain a value for '" + VHD_BUILD_PROPERTY + "'."); + } else { + log.debug("'" + VHD_BUILD_PROPERTY + "' as specified by build.properties: " + vhdPath); + String message = String.format("In resource '%s', '%s' was set to '%s'.", + WEBAPP_PATH_BUILD_PROPERTIES, VHD_BUILD_PROPERTY, vhdPath); + foundLocations.add(new Found(Paths.get(vhdPath), message)); + } + } catch (Exception e) { + log.warn("Reading build properties failed. " + e); + } + } + + private void confirmExactlyOneResult() { + if (foundLocations.isEmpty()) { + String message = String.format("Can't find a value " + + "for the Vitro home directory. " + + "Looked in JNDI environment at '%s'. " + + "Looked for a system property named '%s'. " + + "Looked in 'WEB-INF/resources/build.properties' " + + "for '%s'.", VHD_JNDI_PATH, VHD_SYSTEM_PROPERTY, VHD_BUILD_PROPERTY); + throw new IllegalStateException(message); + } else if (foundLocations.size() > 1) { + String message = "Found multiple values for the " + "Vitro home directory: " + foundLocations; + log.warn(message); + } + } + + private void confirmValidDirectory() { + Path vhd = getPath(); + if (!Files.exists(vhd)) { + createHomeDirectory(vhd); + } + if (!Files.isDirectory(vhd)) { + throw new IllegalStateException("Vitro home directory '" + vhd + "' is not a directory."); + } + if (!Files.isReadable(vhd)) { + throw new IllegalStateException("Cannot read Vitro home directory '" + vhd + "'."); + } + if (!Files.isWritable(vhd)) { + throw new IllegalStateException("Can't write to Vitro home directory: '" + vhd + "'."); + } + } + + /** We found it: where and how. */ + private static class Found { + private final Path path; + private final String message; + + public Found(Path path, String message) { + this.path = path; + this.message = message; + } + + public Path getPath() { + return path; + } + + public String getMessage() { + return message; + } + + @Override + public String toString() { + return "Found[path=" + path + ", message=" + message + "]"; + } + } + } + + /** + * Populates home directory with home files, excluding the rdf directory + */ + public void populate() { + File homeDestination = getPath().toFile(); + + if (!homeDestination.isDirectory() || homeDestination.list() == null) { + throw new IllegalStateException("Application home dir is not a directory! " + homeDestination); + } + if (!homeDestination.canWrite()) { + throw new IllegalStateException("Application home dir is not writable! " + homeDestination); + } + try { + copy(homeDestination); + } catch (Exception e) { + throw new IllegalStateException("Failed to copy home files! " + homeDestination, e); + } + log.info("Copied home files to " + homeDestination.toPath()); + } + + /** + * Create home directory + */ + private static void createHomeDirectory(Path homeDestination) { + try { + homeDestination.toFile().mkdirs(); + } catch (Exception e) { + throw new IllegalStateException("Failed to create home directory " + homeDestination, e); + } + } + + /** + * Copy file from home source to home destination + */ + private void copy(File homeDestination) throws IOException { + File homeSrcPath = new File(getSourcePath()); + File[] contents = homeSrcPath.listFiles(); + for (File child : contents) { + if (excludedHomeFiles.contains(child.getName())) { + continue; + } + if (child.isDirectory()) { + FileUtils.copyDirectoryToDirectory(child, homeDestination); + } else { + FileUtils.copyFileToDirectory(child, homeDestination); + } + } + } } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/migration/rel18/FauxPropertiesUpdater.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/migration/rel18/FauxPropertiesUpdater.java index fad60e9d06..28adf0b9e4 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/migration/rel18/FauxPropertiesUpdater.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/migration/rel18/FauxPropertiesUpdater.java @@ -78,8 +78,7 @@ private boolean isAlreadyUpdated() { } private boolean locateFile() { - String homePath = ApplicationUtils.instance().getHomeDirectory() - .getPath().toString(); + String homePath = ApplicationUtils.instance().getHomeDirectory().getSourcePath(); propertyConfigPath = Paths.get(homePath, PATH_TO_PROPERTY_CONFIG); if (Files.exists(propertyConfigPath)) { return true; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java index 80656403b9..41e858631b 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java @@ -32,7 +32,6 @@ import org.apache.jena.query.Dataset; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; - import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils; import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceDataset; import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; @@ -121,8 +120,8 @@ public void contextInitialized(ServletContextEvent sce) { private Set getFilegraphPaths(ServletContext ctx, String... strings) { StartupStatus ss = StartupStatus.getBean(ctx); - String homeDirProperty = ApplicationUtils.instance().getHomeDirectory().getPath().toString(); - Path filegraphDir = Paths.get(homeDirProperty, strings); + String homeDirPath = ApplicationUtils.instance().getHomeDirectory().getSourcePath(); + Path filegraphDir = Paths.get(homeDirPath, strings); Set paths = new TreeSet<>(); if (Files.isDirectory(filegraphDir)) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java index b3791f3fb7..d65f241b8b 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java @@ -31,7 +31,6 @@ import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; import org.apache.jena.rdf.model.StmtIterator; - import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils; import javax.servlet.ServletContext; @@ -81,7 +80,7 @@ public boolean accept(Path p) throws IOException { public static void loadFirstTimeFiles(ServletContext ctx, String modelPath, Model model, boolean firstTime) { if (firstTime) { - String home = locateHomeDirectory(); + String home = locateHomeDirectory(ctx); // Load common files Set paths = getPaths(home, RDF, modelPath, FIRST_TIME); @@ -113,7 +112,7 @@ public static void loadFirstTimeFiles(ServletContext ctx, String modelPath, Mode public static void loadEveryTimeFiles(ServletContext ctx, String modelPath, OntModel model) { OntModel everytimeModel = ModelFactory .createOntologyModel(OntModelSpec.OWL_MEM); - String home = locateHomeDirectory(); + String home = locateHomeDirectory(ctx); // Load common files Set paths = getPaths(home, RDF, modelPath, EVERY_TIME); @@ -220,9 +219,8 @@ else if (filename.endsWith("ttl")) return DEFAULT_RDF_FORMAT; } - private static String locateHomeDirectory() { - return ApplicationUtils.instance().getHomeDirectory().getPath() - .toString(); + private static String locateHomeDirectory(ServletContext ctx) { + return ApplicationUtils.instance().getHomeDirectory().getSourcePath(); } /** diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java index 1bce3fbad6..b943ee48b7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java @@ -13,6 +13,7 @@ import java.io.StringWriter; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -106,7 +107,7 @@ public void contextInitialized(ServletContextEvent sce) { settings.setInferenceOntModelSelector(ModelAccess.on(ctx).getOntModelSelector(INFERENCES_ONLY)); settings.setUnionOntModelSelector(ModelAccess.on(ctx).getOntModelSelector()); - Path homeDir = ApplicationUtils.instance().getHomeDirectory().getPath(); + Path homeDir = Paths.get(ApplicationUtils.instance().getHomeDirectory().getSourcePath()); settings.setDisplayModel(ModelAccess.on(ctx).getOntModel(DISPLAY)); OntModel oldTBoxModel = loadModelFromDirectory(ctx.getRealPath(oldTBoxModelDir())); settings.setOldTBoxModel(oldTBoxModel); diff --git a/api/src/test/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectoryTest.java b/api/src/test/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectoryTest.java new file mode 100644 index 0000000000..d78071e794 --- /dev/null +++ b/api/src/test/java/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectoryTest.java @@ -0,0 +1,50 @@ +package edu.cornell.mannlib.vitro.webapp.application; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import stubs.javax.servlet.ServletContextStub; + +public class VitroHomeDirectoryTest { + + private static final String FILE = "file"; + private static final String CONFIG = "config"; + private static final String RDF = "rdf"; + @Rule + public TemporaryFolder src = new TemporaryFolder(); + @Rule + public TemporaryFolder dst = new TemporaryFolder(); + + @Test + public void testGetHomeSrcPath() { + ServletContextStub sc = new ServletContextStub(); + String expectedPath = "/opt/tomcat/webapp/app/WEB-INF/resources/home-files"; + sc.setRealPath("/WEB-INF/resources/home-files", expectedPath); + VitroHomeDirectory vhd = new VitroHomeDirectory(sc, dst.getRoot().toPath(), ""); + String realPath = vhd.getSourcePath(); + assertEquals(expectedPath, realPath); + } + + @Test + public void testPopulate() throws Exception { + ServletContextStub sc = new ServletContextStub(); + src.newFolder(RDF); + src.newFile(FILE); + src.newFolder(CONFIG); + sc.setRealPath("/WEB-INF/resources/home-files", src.getRoot().getAbsolutePath()); + VitroHomeDirectory vhd = new VitroHomeDirectory(sc, dst.getRoot().toPath(), ""); + vhd.populate(); + Set files = new HashSet(Arrays.asList(dst.getRoot().list())); + assertTrue(files.contains(CONFIG)); + assertTrue(files.contains(FILE)); + assertFalse(files.contains(RDF)); + } +} diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index 5e4693a52b..89ca46a74d 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -48,7 +48,6 @@ - diff --git a/installer/home/pom.xml b/installer/home/pom.xml index 17ccc4bb47..aeab1cd506 100644 --- a/installer/home/pom.xml +++ b/installer/home/pom.xml @@ -2,101 +2,40 @@ 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/xsd/maven-4.0.0.xsd"> - 4.0.0 - org.vivoweb vitro-installer-home 1.15.1-SNAPSHOT pom - org.vivoweb vitro-installer 1.15.1-SNAPSHOT .. - Vitro Install Home - vitro - - - install - - vitro-dir - - - - - maven-assembly-plugin - - - src/main/assembly/home.xml - - false - - - - package - - single - - - - - - maven-antrun-plugin - - - remove-webapp - verify - - run - - - - - - - - - - - maven-resources-plugin - - - install - install - - copy-resources - - - ${vitro-dir} - - - ${project.build.directory}/${project.build.finalName} - - - - - - - - - - - - maven-install-plugin + maven-assembly-plugin - true + + src/main/assembly/home.xml + + false + + + package + + single + + + diff --git a/installer/home/src/main/assembly/home.xml b/installer/home/src/main/assembly/home.xml index 6de97e21d7..755b02745d 100644 --- a/installer/home/src/main/assembly/home.xml +++ b/installer/home/src/main/assembly/home.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> home - dir + tar false diff --git a/installer/webapp/pom.xml b/installer/webapp/pom.xml index bac4187eec..1f400f639e 100644 --- a/installer/webapp/pom.xml +++ b/installer/webapp/pom.xml @@ -28,6 +28,34 @@ ${app-name} + + org.apache.maven.plugins + maven-dependency-plugin + + false + + + + include-home + process-resources + + unpack + + + + + org.vivoweb + vitro-installer-home + ${project.version} + tar + + target/${app-name}/WEB-INF/resources/home-files + + + + + + org.apache.maven.plugins maven-war-plugin @@ -57,53 +85,19 @@ - install + deploy tomcat-dir - - maven-antrun-plugin - - - remove-webapp - verify - - run - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - install - install - - unpack - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - war - true - ${tomcat-dir}/webapps/${project.build.finalName} - - - - - + maven-war-plugin + 3.2.1 + + ${tomcat-dir}/webapps/ +