[java-identity-provider] 02/02: IDP-1815 Recast IDP Installer to use the CLI infrastructure

Rod Widdowson rdw at steadingsoftware.com
Fri May 19 12:59:15 UTC 2023


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=8aa65a07dd2ddafb9ddb48ced5bb9ace3ced037b

commit 8aa65a07dd2ddafb9ddb48ced5bb9ace3ced037b
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu May 18 20:15:27 2023 +0100

    IDP-1815 Recast IDP Installer to use the CLI infrastructure
    
    https://shibboleth.atlassian.net/browse/IDP-1815
    
    "Build" is now run via runclass (and not ant).
    Remove the ant support from the Core module,
    from the jar file and (during Core enable)
    from the installation.
---
 .../net/shibboleth/idp/module/core/impl/Core.java  |  32 ++++--
 .../net/shibboleth/idp/module/bin/ant.bat          |  40 -------
 .../resources/net/shibboleth/idp/module/bin/ant.sh |  84 ---------------
 .../net/shibboleth/idp/module/bin/build.bat        |   3 +-
 .../net/shibboleth/idp/module/bin/build.sh         |   3 +-
 .../net/shibboleth/idp/module/bin/build.xml        |  29 -----
 .../idp/module/core/impl/module.properties         |  18 +---
 .../idp/installer/ant/impl/V4InstallTask.java      |   2 +-
 .../shibboleth/idp/installer/impl/BuildWar.java    |  19 +---
 .../idp/installer/impl/IdPBuildArguments.java      |  53 +++++++++
 .../shibboleth/idp/installer/impl/IdPBuildWar.java | 120 +++++++++++++++++++++
 .../shibboleth/idp/installer/impl/Installer.java   |  73 -------------
 .../java/net/shibboleth/idp/installer/Test.java    |   2 +-
 13 files changed, 210 insertions(+), 268 deletions(-)

diff --git a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java
index 197920c87..140525ca7 100644
--- a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java
+++ b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java
@@ -17,6 +17,7 @@
 
 package net.shibboleth.idp.module.core.impl;
 
+import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -24,6 +25,8 @@ import java.util.Map;
 
 import javax.annotation.Nonnull;
 
+import org.springframework.util.ResourceUtils;
+
 import net.shibboleth.idp.module.IdPModule;
 import net.shibboleth.idp.module.ModuleContext;
 import net.shibboleth.idp.module.ModuleException;
@@ -60,13 +63,28 @@ public final class Core extends CoreIdPModule {
         
         // First we need to ensure the basic directory layout is in place. On upgrade this won't have any effect.
         try {
-            final Path home = Path.of(moduleContext.getInstallLocation());
-            Files.createDirectories(home.resolve("conf"));
-            Files.createDirectories(home.resolve("credentials"));
-            Files.createDirectories(home.resolve("metadata"));
-            Files.createDirectories(home.resolve("flows"));
-            Files.createDirectories(home.resolve("messages"));
-            Files.createDirectories(home.resolve("views"));
+            if (!moduleContext.getInstallLocation().startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) {
+                final Path home = Path.of(moduleContext.getInstallLocation());
+                Files.createDirectories(home.resolve("conf"));
+                Files.createDirectories(home.resolve("credentials"));
+                Files.createDirectories(home.resolve("metadata"));
+                Files.createDirectories(home.resolve("flows"));
+                Files.createDirectories(home.resolve("messages"));
+                Files.createDirectories(home.resolve("views"));
+                // Tidy up files we no longer need in V5
+                Path antFile = home.resolve("bin").resolve("build.xml");
+                if (Files.exists(antFile)) {
+                    Files.delete(antFile);
+                }
+                antFile = home.resolve("bin").resolve("ant.bat");
+                if (Files.exists(antFile)) {
+                    Files.delete(antFile);
+                }
+                antFile = home.resolve("bin").resolve("ant.sh");
+                if (Files.exists(antFile)) {
+                    Files.delete(antFile);
+                }
+            }
         } catch (final Exception e) {
             throw new ModuleException(e);
         }
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/ant.bat b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/ant.bat
deleted file mode 100644
index c08a94822..000000000
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/ant.bat
+++ /dev/null
@@ -1,40 +0,0 @@
- at echo off
-setlocal
-
-REM Find the necessary resources
-set ANT_HOME=%~dp0
-
-REM strip trailing backslash - it confuses java.
-REM do it like this because embedding the strip inside an if causes problems if the name has a ")" in it. 
-if "%ANT_HOME:~-1%" NEQ "\" (
-   goto nostrip
-)
-set ANT_HOME=%ANT_HOME:~0,-1%
-:nostrip
-
-if defined INSTALL_LOG_FILE (
-   goto got_log
-)
-set INSTALL_LOG_FILE=%ANT_HOME%\install-log.xml
-:got_log
-
-REM We need a JVM
-if not defined JAVA_HOME  (
-  echo Error: JAVA_HOME is not defined.
-  exit /b
-)
-
-if not defined JAVACMD (
-  set JAVACMD="%JAVA_HOME%\bin\java.exe"
-)
-
-if not exist %JAVACMD% (
-  echo Error: JAVA_HOME is not defined correctly.
-  echo Cannot execute %JAVACMD%
-  exit /b
-)
-
-REM add in the dependency .jar files
-set LOCALCLASSPATH=%ANT_HOME%\..\bin\lib\*;%ANT_HOME%\..\webapp\WEB-INF\lib\*;%ANT_HOME%\..\dist\webapp\WEB-INF\lib\*;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\classes.zip;%CLASSPATH%
-
-%JAVACMD% -cp "%LOCALCLASSPATH%" -Dlogback.configurationFile="%INSTALL_LOG_FILE%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main -e -f "%ANT_HOME%/build.xml" %*
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/ant.sh b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/ant.sh
deleted file mode 100755
index 658f20702..000000000
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/ant.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#! /bin/sh
-
-# OS specific support.  $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-case "`uname`" in
-  CYGWIN*) cygwin=true ;;
-  Darwin*) darwin=true ;;
-esac
-
-#Find the necessary resources
-ANT_HOME=$0
-ANT_HOME=${ANT_HOME%/*}
-
-if [ -z "$JAVACMD" ] ; then 
-  if [ -n "$JAVA_HOME"  ] ; then
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 
-      # IBM's JDK on AIX uses strange locations for the executables
-      JAVACMD=$JAVA_HOME/jre/sh/java
-    else
-      JAVACMD=$JAVA_HOME/bin/java
-    fi
-  else
-    JAVACMD=$(which java)
-  fi
-fi
-
-if [ -z "$INSTALL_LOG_FILE" ] ; then
-    INSTALL_LOG_FILE=$ANT_HOME/install-log.xml
-fi
- 
-if [ ! -x "$JAVACMD" ] ; then
-  echo "Error: JAVA_HOME is not defined correctly."
-  echo "  We cannot execute $JAVACMD"
-  exit 1
-fi
-
-if [ -n "$CLASSPATH" ] ; then
-  LOCALCLASSPATH=$CLASSPATH
-fi
-
-# add in the dependency .jar files
-LOCALCLASSPATH="${ANT_HOME}/../webapp/WEB-INF/lib/*":$LOCALCLASSPATH
-LOCALCLASSPATH="${ANT_HOME}/../dist/webapp/WEB-INF/lib/*":$LOCALCLASSPATH
-LOCALCLASSPATH="${ANT_HOME}/../bin/lib/*":$LOCALCLASSPATH
-
-if [ -n "$JAVA_HOME" ] ; then
-  if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
-    LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
-  fi
-
-  if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
-    LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
-  fi
-
-  # OSX hack to make Ant work with jikes
-  if $darwin ; then
-    OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
-    if [ -d ${OSXHACK} ] ; then
-      for i in ${OSXHACK}/*.jar
-      do
-        JIKESPATH=$JIKESPATH:$i
-      done
-    fi
-  fi
-fi
-
-# supply JIKESPATH to Ant as jikes.class.path
-if [ -n "$JIKESPATH" ] ; then
-  if [ -n "$ANT_OPTS" ] ; then
-    ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
-  else
-    ANT_OPTS=-Djikes.class.path=$JIKESPATH
-  fi
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
-  ANT_HOME=`cygpath --path --windows "$ANT_HOME"`
-  JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
-  LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
-fi
-
-"$JAVACMD" -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" -Dlogback.configurationFile=$INSTALL_LOG_FILE $ANT_OPTS org.apache.tools.ant.Main -e -f "${ANT_HOME}/build.xml" "$@"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.bat b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.bat
index d3ae089aa..2e04c7d93 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.bat
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.bat
@@ -1,4 +1,5 @@
 @echo off
 setlocal
 
-"%~dp0\ant.bat" %* build-war
+"%~dp0\runclass.bat" net.shibboleth.idp.installer.impl.IdPBuildWar --home "%~dp0\.." %*
+
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.sh b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.sh
index 8ea33ad5c..bd703f9e4 100755
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.sh
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.sh
@@ -4,4 +4,5 @@ declare LOCATION
 
 LOCATION=$(dirname $0)
 
-$LOCATION/ant.sh "$@" build-war
+$LOCATION/runclass.sh net.shibboleth.idp.installer.impl.IdPBuildWar --ansi --home "$LOCATION/.." "$@"
+
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.xml
deleted file mode 100644
index 000c84a38..000000000
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/bin/build.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="Shibboleth Identity Provider V4" default="install">  
-
-    <taskdef resource="net/shibboleth/idp/installer/ant.xml" />
-
-    <!--  TARGETS:
-
-        The following top level targets are implemented and supported.  These in turn call subsidiary targets,
-        whose use outside this file is not supported.
-
-        install-nocopy:  Does the installation/upgrade on a layout that has been copied (ie, the important
-                         stuff has been copied or overwritten from the distribution)
-                         A V2 upgrade will be performed if a V2 site is detected.
-        build-war:       Create the war file
-        install:         Copies files from the distribution to the specified target and then
-                         invokes install-nocopy
-    -->
-	
-    <target name="install">
-        <v4install task="install"/>
-    </target>
-    <target name="install-nocopy">
-    	<v4install task="install-nocopy"/>
-    </target>
-    <target name="build-war">
-        <v4install task="build-war"/>
-    </target>
-
-</project>
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/core/impl/module.properties b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/core/impl/module.properties
index 2528d6f53..7d20f0995 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/core/impl/module.properties
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/core/impl/module.properties
@@ -239,22 +239,12 @@ idp.Core.45.src = /net/shibboleth/idp/module/bin/module.bat
 idp.Core.45.dest = bin/module.bat
 idp.Core.45.nonwindows = false
 
-idp.Core.46.src = /net/shibboleth/idp/module/bin/ant.sh
-idp.Core.46.dest = bin/ant.sh
+idp.Core.46.src = /net/shibboleth/idp/module/bin/build.sh
+idp.Core.46.dest = bin/build.sh
 idp.Core.46.exec = true
 idp.Core.46.windows = false
-idp.Core.47.src = /net/shibboleth/idp/module/bin/ant.bat
-idp.Core.47.dest = bin/ant.bat
+idp.Core.47.src = /net/shibboleth/idp/module/bin/build.bat
+idp.Core.47.dest = bin/build.bat
 idp.Core.47.nonwindows = false
 
-idp.Core.48.src = /net/shibboleth/idp/module/bin/build.sh
-idp.Core.48.dest = bin/build.sh
-idp.Core.48.exec = true
-idp.Core.48.windows = false
-idp.Core.49.src = /net/shibboleth/idp/module/bin/build.bat
-idp.Core.49.dest = bin/build.bat
-idp.Core.49.nonwindows = false
-
-idp.Core.50.src = /net/shibboleth/idp/module/bin/build.xml
-idp.Core.50.dest = bin/build.xml
 
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java
index eceb66731..16df4edf9 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/ant/impl/V4InstallTask.java
@@ -98,7 +98,7 @@ public class V4InstallTask extends Task {
                 inst.execute();
             }
 
-            final BuildWar bw = new BuildWar(ip, is);
+            final BuildWar bw = new BuildWar(ip.getTargetDir());
             bw.initialize();
             bw.execute();
         } catch (final ComponentInitializationException e) {
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/BuildWar.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/BuildWar.java
index edd1d2a6a..14126bd30 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/BuildWar.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/BuildWar.java
@@ -32,8 +32,8 @@ import net.shibboleth.idp.Version;
 import net.shibboleth.idp.installer.InstallerSupport;
 import net.shibboleth.shared.component.AbstractInitializableComponent;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.UninitializedComponentException;
 import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.primitive.LoggerFactory;
 
 /**
  * Code to build the war file during an install or on request.
@@ -51,25 +51,11 @@ import net.shibboleth.shared.logic.Constraint;
 public final class BuildWar extends AbstractInitializableComponent {
 
     /** Log. */
-    private final Logger log = InstallationLogger.getLogger(BuildWar.class);
+    @Nonnull private final Logger log = LoggerFactory.getLogger(BuildWar.class);
 
     /** Location of the install for the job. */
     private final Path targetDir;
 
-    /** Constructor.
-     * @param props The environment for the work.
-     * @param installState  Where we are right now.
-     */
-    public BuildWar(@Nonnull final InstallerProperties props, @Nonnull final CurrentInstallState installState) {
-        if (!props.isInitialized()) {
-            throw new UninitializedComponentException("Installer Properties not initialized");
-        }
-        if (!installState.isInitialized()) {
-            throw new UninitializedComponentException("Current Install Srare not initialized");
-        }
-        targetDir = props.getTargetDir();
-    }
-
     /** Constructor.
      * @param idpHome Where to install to.
      */
@@ -77,7 +63,6 @@ public final class BuildWar extends AbstractInitializableComponent {
         targetDir = Constraint.isNotNull(idpHome, "IdPHome should not be null");
     }
 
-
     /** Method to do a single overlay into webapp.
      *
      * @param from Where to copy from.
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPBuildArguments.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPBuildArguments.java
new file mode 100644
index 000000000..ccd35fe6d
--- /dev/null
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPBuildArguments.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.installer.impl;
+
+import java.io.PrintStream;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.slf4j.Logger;
+
+import net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLineArguments;
+
+/**
+ * Command line arguments for the "build" verb.
+ */
+public class IdPBuildArguments extends AbstractIdPHomeAwareCommandLineArguments {
+
+    /** Logger. */
+    @Nullable private Logger log;
+
+    /** {@inheritDoc} */
+    public @Nonnull Logger getLog() {
+        if (log == null) {
+            log = InstallationLogger.getLogger(IdPBuildArguments.class);
+        }
+        assert log != null;
+        return log;
+    }
+    
+    /** {@inheritDoc} */
+    @Override public void printHelp(final @Nonnull PrintStream out) {
+        out.println("Build");
+        out.println("Rebuilds the IdP war");
+        out.println();
+    }
+
+}
\ No newline at end of file
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPBuildWar.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPBuildWar.java
new file mode 100644
index 000000000..d86a4c59c
--- /dev/null
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/IdPBuildWar.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.installer.impl;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import org.slf4j.Logger;
+
+import net.shibboleth.idp.Version;
+import net.shibboleth.shared.cli.AbstractCommandLine;
+import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.primitive.LoggerFactory;
+
+/**
+ * Command line for 'build'
+ */
+public class IdPBuildWar extends AbstractCommandLine<IdPBuildArguments> {
+
+    @Nullable private Logger log;
+    
+    /** {@inheritDoc} */
+    @Override
+    @Nonnull
+    protected Class<IdPBuildArguments> getArgumentClass() {
+        return IdPBuildArguments.class;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    @Nonnull
+    protected String getVersion() {
+        final String result = Version.getVersion();
+        assert result != null;
+        return result;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    @Nonnull
+    protected Logger getLogger() {
+        Logger localLog = log;
+        if (localLog == null) {
+            localLog = log = LoggerFactory.getLogger(IdPBuildWar.class);
+        }
+        return localLog;
+    }
+
+    /** {@inheritDoc} 
+     * NOTE that we do not call the super classe
+     * */
+    protected int doRun(@Nonnull final IdPBuildArguments args) {
+
+        super.doRun(args);
+        
+        getLogger().debug("{}", args);
+        getLogger().info("{}", args);
+
+        if (args.getIdPHome() == null) {
+            getLogger().error("--home must be specified");
+            return RC_INIT;
+        }
+
+        final Path idpHome = Path.of(args.getIdPHome());
+        if (!Files.exists(idpHome)) {
+            getLogger().error("Could not find {}", idpHome);
+            return RC_INIT;
+        }
+        final BuildWar build = new BuildWar(idpHome);
+        try {
+            build.initialize();
+        } catch (ComponentInitializationException e) {
+            getLogger().error("Internal error", e);
+            return RC_INIT;
+        }
+        build.execute();
+
+        return RC_OK;
+    }
+
+    /** Shim for CLI entry point: Allows the code to be run from a test.
+    *
+    * @return one of the predefines {@link AbstractCommandLine#RC_INIT},
+    * {@link AbstractCommandLine#RC_IO}, {@link AbstractCommandLine#RC_OK}
+    * or {@link AbstractCommandLine#RC_UNKNOWN}
+    *
+    * @param args arguments
+    */
+   public static int runMain(@Nonnull final String[] args) {
+       final IdPBuildWar cli = new IdPBuildWar();
+
+       return cli.run(args);
+   }
+
+   /**
+    * CLI entry point.
+    * @param args arguments
+    */
+   public static void main(@Nonnull final String[] args) {
+       System.exit(runMain(args));
+   }
+}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java
deleted file mode 100644
index 0c8340311..000000000
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/Installer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements.  See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID licenses this file to You under the Apache
- * License, Version 2.0 (the "License"); you may not use this file except in
- * compliance with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package net.shibboleth.idp.installer.impl;
-
-import org.slf4j.Logger;
-
-import net.shibboleth.shared.component.ComponentInitializationException;
-
-/**
- * Entry point to run the main classes.
- */
-public final class Installer {
-
-    /** hidden  Constructor. */
-    private Installer() {}
-
-    /** simulate the ant tasks.
-     * @param args what
-     * @throws ComponentInitializationException if badness occurrs
-     */
-    public static void main(final String[] args) throws ComponentInitializationException {
-        final Logger log = InstallationLogger.getLogger(Installer.class);
-        if (args.length !=1) {
-            log.error("One Parameter only {}", (Object[]) args);
-            return;
-        }
-        boolean copyInstall = false;
-        boolean doInstall = false;
-        if ("install".equals(args[0])) {
-            copyInstall = true;
-            doInstall = true;
-        } else if ("install-nocopy".equals(args[0])) {
-            doInstall = true;
-        } else if (!"build-war".equals(args[0])) {
-            log.error("Parameter must be \"install\", \"install-nocopy\" or \"build-war\" was \"{}\"", args[0]);
-            return;
-        }
-        final InstallerProperties ip = new InstallerProperties(!copyInstall);
-        ip.initialize();
-        final CurrentInstallState is = new CurrentInstallState(ip);
-        is.initialize();
-
-        if (copyInstall) {
-            final CopyDistribution dist = new CopyDistribution(ip, is);
-            dist.execute();
-        }
-
-        if (doInstall) {
-            final V5Install inst = new V5Install(ip, is);
-            inst.execute();
-        }
-
-        final BuildWar bw = new BuildWar(ip, is);
-        bw.execute();
-
-    }
-
-}
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java
index a594909e4..97d625e3c 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/Test.java
@@ -62,7 +62,7 @@ public class Test {
         inst.initialize();
         inst.execute();
 
-        final BuildWar bw = new BuildWar(ip, is);
+        final BuildWar bw = new BuildWar(ip.getTargetDir());
         bw.initialize();
         bw.execute();
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list