Changeset 757
- Timestamp:
- 14/11/08 14:27:26 (2 months ago)
- Files:
-
- trunk/dist/dist-assembly.xml (modified) (2 diffs)
- trunk/dist/src/main/resources/service-wrapper-common.conf (added)
- trunk/dist/src/main/wrapper (added)
- trunk/dist/src/main/wrapper/README.txt (added)
- trunk/dist/src/main/wrapper/bin (added)
- trunk/dist/src/main/wrapper/bin/wrapper-aix-ppc-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-aix-ppc-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-hpux-ia-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-hpux-ia-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-hpux-parisc-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-hpux-parisc-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-linux-ia-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-linux-ppc-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-linux-ppc-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-linux-x86-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-linux-x86-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-macosx-universal-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-macosx-universal-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-solaris-sparc-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-solaris-sparc-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-solaris-x86-32 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-solaris-x86-64 (added)
- trunk/dist/src/main/wrapper/bin/wrapper-windows-x86-32.exe (added)
- trunk/dist/src/main/wrapper/lib (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-aix-ppc-32.a (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-aix-ppc-64.a (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-hpux-ia-32.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-hpux-ia-64.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-hpux-parisc-32.sl (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-hpux-parisc-64.sl (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-linux-ia-64.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-linux-ppc-32.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-linux-ppc-64.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-linux-x86-32.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-linux-x86-64.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-macosx-universal-32.jnilib (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-macosx-universal-64.jnilib (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-solaris-sparc-32.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-solaris-sparc-64.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-solaris-x86-32.so (added)
- trunk/dist/src/main/wrapper/lib/libwrapper-solaris-x86-64.so (added)
- trunk/dist/src/main/wrapper/lib/wrapper-windows-x86-32.dll (added)
- trunk/dist/src/main/wrapper/lib/wrapper.jar (added)
- trunk/dist/src/main/wrapper/lib/wrappertest.jar (added)
- trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging (moved) (moved from trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/webapp) (1 prop)
- trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging/AbstractPackageMojo.java (modified) (4 diffs)
- trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging/KauriPackageMojo.java (copied) (copied from trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/webapp/KauriPackageMojo.java) (4 diffs)
- trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging/KauriWebappMojo.java (copied) (copied from trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/webapp/KauriWebappMojo.java) (1 diff)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging (moved) (moved from trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/webapp) (1 prop)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/HOW_TO_RUN.txt (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/kauri-log4j.properties (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service/README.txt (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service/install-kauri-service.bat (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service/kauri-service (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service/kauri-service.bat (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service/service-wrapper.conf (added)
- trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging/service/uninstall-kauri-service.bat (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dist/dist-assembly.xml
r745 r757 51 51 <outputDirectory>/bin/</outputDirectory> 52 52 </file> 53 <file> 54 <source>target/classes/service-wrapper-common.conf</source> 55 <outputDirectory>/wrapper/conf</outputDirectory> 56 </file> 57 <file> 58 <source>src/main/wrapper/README.txt</source> 59 <outputDirectory>wrapper/README.txt</outputDirectory> 60 </file> 53 61 </files> 54 62 … … 67 75 --> 68 76 </fileSet> 77 <fileSet> 78 <directory>src/main/wrapper/lib</directory> 79 <outputDirectory>/wrapper/lib</outputDirectory> 80 <useDefaultExcludes>true</useDefaultExcludes> 81 </fileSet> 82 <fileSet> 83 <directory>src/main/wrapper/bin</directory> 84 <outputDirectory>/wrapper/bin</outputDirectory> 85 <useDefaultExcludes>true</useDefaultExcludes> 86 <fileMode>755</fileMode> 87 </fileSet> 69 88 </fileSets> 70 89 trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging
- Property svn:mergeinfo set
trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging/AbstractPackageMojo.java
r753 r757 1 package org.kauriproject.tools.plugin. webapp;1 package org.kauriproject.tools.plugin.packaging; 2 2 3 3 import org.apache.maven.project.MavenProjectBuilder; … … 98 98 protected void determineKauriVersion() throws MojoExecutionException { 99 99 String pomPropsPath = "META-INF/maven/org.kauriproject/kauri-package-plugin/pom.properties"; 100 InputStream is = KauriWebappMojo.class.getClassLoader().getResourceAsStream(pomPropsPath);100 InputStream is = getClass().getClassLoader().getResourceAsStream(pomPropsPath); 101 101 if (is == null) { 102 102 throw new MojoExecutionException("Could not find the resource containing the Kauri version information at " + pomPropsPath); … … 139 139 destFos.close(); 140 140 } catch (Throwable t) { 141 throw new MojoExecutionException("Failed to copy file from " + fromFile + " to " + toFile); 141 throw new MojoExecutionException("Failed to copy file from " + fromFile + " to " + toFile, t); 142 } 143 } 144 145 protected void copyResource(String path, File toFile) throws MojoExecutionException { 146 String fullPath = "org/kauriproject/tools/plugin/packaging/" + path; 147 InputStream is = getClass().getClassLoader().getResourceAsStream(fullPath); 148 if (is == null) 149 throw new MojoExecutionException("Classpath resource does not exist: " + fullPath); 150 151 try { 152 OutputStream os = new FileOutputStream(toFile); 153 byte[] buffer = new byte[8012]; 154 int read; 155 while ((read = is.read(buffer)) != -1) { 156 os.write(buffer, 0, read); 157 } 158 is.close(); 159 os.close(); 160 } catch (Throwable t) { 161 throw new MojoExecutionException("Failed to copy classpath resource " + path + " to file " + toFile, t); 142 162 } 143 163 } … … 247 267 } 248 268 269 protected void setExecutable(File file) throws MojoExecutionException { 270 // rough check to see if it's a unix-type system 271 if (System.getProperty("path.separator").equals(":")) { 272 try { 273 Process process = Runtime.getRuntime().exec(new String[] {"chmod", "u+x", file.getAbsolutePath()}); 274 process.waitFor(); 275 int exitValue = process.exitValue(); 276 if (exitValue != 0) { 277 getLog().warn("Could not make the following file executable, you might want to do it yourself: " + file.getAbsolutePath()); 278 } 279 } catch (Exception e) { 280 throw new MojoExecutionException("Error trying to make file executable: " + file, e); 281 } 282 } 283 } 249 284 } trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging/KauriPackageMojo.java
r756 r757 1 package org.kauriproject.tools.plugin. webapp;1 package org.kauriproject.tools.plugin.packaging; 2 2 3 3 import org.apache.maven.plugin.MojoExecutionException; … … 49 49 } 50 50 51 createRepository(allArtifacts, packageDirectory + "/ repository/");51 createRepository(allArtifacts, packageDirectory + "/lib/"); 52 52 53 53 // … … 56 56 getLog().info("Including the kauri.xml file."); 57 57 copyFile(new File(kauriConfigLocation), new File(packageDirectory + "/kauri.xml")); 58 59 // 60 // Include the service wrapper stuff 61 // 62 addServiceWrapper(); 63 64 // 65 // Include logging setup 66 // 67 addLogSetup(); 68 69 // 70 // 71 // 72 copyResource("HOW_TO_RUN.txt", new File(packageDirectory + "/HOW_TO_RUN.txt")); 58 73 } 59 74 … … 67 82 } 68 83 } 84 85 private void addServiceWrapper() throws MojoExecutionException { 86 new File(packageDirectory, "service").mkdirs(); 87 88 copyResource("service/service-wrapper.conf", new File(packageDirectory + "/service/service-wrapper.conf")); 89 copyResource("service/README.txt", new File(packageDirectory + "/service/README.txt")); 90 91 // unix scripts 92 File kauriServiceDest = new File(packageDirectory + "/service/kauri-service"); 93 copyResource("service/kauri-service", kauriServiceDest); 94 setExecutable(kauriServiceDest); 95 96 // windows scripts 97 copyResource("service/install-kauri-service.bat", new File(packageDirectory + "/service/install-kauri-service.bat")); 98 copyResource("service/uninstall-kauri-service.bat", new File(packageDirectory + "/service/uninstall-kauri-service.bat")); 99 copyResource("service/kauri-service.bat", new File(packageDirectory + "/service/kauri-service.bat")); 100 } 101 102 private void addLogSetup() throws MojoExecutionException { 103 new File(packageDirectory, "logs").mkdir(); 104 copyResource("kauri-log4j.properties", new File(packageDirectory + "/kauri-log4j.properties")); 105 } 69 106 } trunk/tools/kauri-package-plugin/src/main/java/org/kauriproject/tools/plugin/packaging/KauriWebappMojo.java
r756 r757 1 package org.kauriproject.tools.plugin. webapp;1 package org.kauriproject.tools.plugin.packaging; 2 2 3 3 import org.apache.maven.plugin.MojoExecutionException; trunk/tools/kauri-package-plugin/src/main/resources/org/kauriproject/tools/plugin/packaging
- Property svn:mergeinfo set
