geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r547772 - in /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo: reporting/ReportingMojoSupport.java server/InstallerMojoSupport.java
Date Fri, 15 Jun 2007 19:59:15 GMT
Author: jdillon
Date: Fri Jun 15 12:59:14 2007
New Revision: 547772

URL: http://svn.apache.org/viewvc?view=rev&rev=547772
Log:
Make some files canonical

Modified:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/ReportingMojoSupport.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/ReportingMojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/ReportingMojoSupport.java?view=diff&rev=547772&r1=547771&r2=547772
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/ReportingMojoSupport.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/reporting/ReportingMojoSupport.java
Fri Jun 15 12:59:14 2007
@@ -124,11 +124,16 @@
     }
 
     protected File getLogFile() {
-        if ( logFile == null ) {
+        if (logFile == null) {
             return new File(logOutputDirectory, getFullClassName() + ".log");
         }
-
-        return logFile;
+        
+        try {
+            return logFile.getCanonicalFile();
+        }
+        catch (java.io.IOException e) {
+            throw new RuntimeException(e);
+        }
     }
 
     /**

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java?view=diff&rev=547772&r1=547771&r2=547772
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
Fri Jun 15 12:59:14 2007
@@ -112,7 +112,7 @@
     
     protected InstallType installType;
 
-    private File discoverGeronimoHome(final File archive) throws MojoExecutionException {
+    private File discoverGeronimoHome(final File archive) throws IOException, MojoExecutionException
{
         log.debug("Attempting to discover geronimoHome...");
 
         File dir = null;
@@ -140,45 +140,54 @@
             throw new MojoExecutionException("Archive does not contain a Geronimo assembly:
" + archive);
         }
 
-        return dir;
+        return dir.getCanonicalFile();
     }
 
     protected void init() throws MojoExecutionException, MojoFailureException {
         super.init();
+        
+        try {
+            // First check if geronimoHome is set, if it is, then we can skip this
+            if (geronimoHome != null) {
+                geronimoHome = geronimoHome.getCanonicalFile();
+                
+                // Quick sanity check
+                File file = new File(geronimoHome, "bin/server.jar");
+                if (!file.exists()) {
+                    throw new MojoExecutionException("When geronimoHome is set, it must point
to a directory that contains 'bin/server.jar'");
+                }
+                log.info("Using pre-installed assembly: " + geronimoHome);
 
-        // First check if geronimoHome is set, if it is, then we can skip this
-        if (geronimoHome != null) {
-            // Quick sanity check
-            File file = new File(geronimoHome, "bin/server.jar");
-            if (!file.exists()) {
-                throw new MojoExecutionException("When geronimoHome is set, it must point
to a directory that contains 'bin/server.jar'");
-            }
-            log.info("Using pre-installed assembly: " + geronimoHome);
-
-            installType = InstallType.ALREADY_EXISTS;
-        }
-        else {
-            if (assemblyArchive != null) {
-                log.info("Using non-artifact based assembly archive: " + assemblyArchive);
-
-                installType = InstallType.FROM_FILE;
+                installType = InstallType.ALREADY_EXISTS;
             }
             else {
-                Artifact artifact = getAssemblyArtifact();
+                if (assemblyArchive != null) {
+                    assemblyArchive = assemblyArchive.getCanonicalFile();
+                    
+                    log.info("Using non-artifact based assembly archive: " + assemblyArchive);
 
-                if (!"zip".equals(artifact.getType())) {
-                    throw new MojoExecutionException("Assembly file does not look like a
ZIP archive");
+                    installType = InstallType.FROM_FILE;
                 }
+                else {
+                    Artifact artifact = getAssemblyArtifact();
 
-                log.info("Using assembly artifact: " + artifact);
+                    if (!"zip".equals(artifact.getType())) {
+                        throw new MojoExecutionException("Assembly file does not look like
a ZIP archive");
+                    }
 
-                assemblyArchive = artifact.getFile();
+                    log.info("Using assembly artifact: " + artifact);
 
-                installType = InstallType.FROM_ARTIFACT;
-            }
+                    assemblyArchive = artifact.getFile();
+
+                    installType = InstallType.FROM_ARTIFACT;
+                }
 
-            geronimoHome = discoverGeronimoHome(assemblyArchive);
-            log.info("Using geronimoHome: " + geronimoHome);
+                geronimoHome = discoverGeronimoHome(assemblyArchive);
+                log.info("Using geronimoHome: " + geronimoHome);
+            }
+        }
+        catch (java.io.IOException e) {
+            throw new MojoExecutionException(e.getMessage(), e);
         }
     }
 



Mime
View raw message