├── .gitignore ├── CHANGELOG.md ├── Jenkinsfile ├── LICENSE.txt ├── README.md ├── TODO.txt ├── pom.xml ├── src └── site │ ├── fml │ └── faq.fml │ ├── site.xml │ └── xdoc │ ├── index.xml │ └── usage.xml ├── unix-ar ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── ar │ │ ├── Ar.java │ │ ├── ArCli.java │ │ ├── ArFile.java │ │ ├── ArReader.java │ │ ├── ArUtil.java │ │ ├── ArWriter.java │ │ ├── FileNameTooLongException.java │ │ ├── InvalidArchiveMagicException.java │ │ ├── InvalidFileMagicException.java │ │ ├── NoSuchFileInArchiveException.java │ │ └── ReadableArFile.java │ └── test │ ├── java │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── ar │ │ ├── ArTest.java │ │ └── ArWriterTest.java │ └── resources │ └── test.ar ├── unix-common ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ ├── BasicPackageFileSystemObject.java │ │ ├── EqualsIgnoreNull.java │ │ ├── FileAttributes.java │ │ ├── FileCollector.java │ │ ├── MissingSettingException.java │ │ ├── PackageFileSystem.java │ │ ├── PackageFileSystemFormatter.java │ │ ├── PackageFileSystemObject.java │ │ ├── PackageParameters.java │ │ ├── PackageVersion.java │ │ ├── PlainPackageFileSystemObject.java │ │ ├── UnixFileMode.java │ │ ├── UnixFsObject.java │ │ ├── UnixPackage.java │ │ ├── io │ │ ├── FileScanner.java │ │ ├── IncludeExcludeFilter.java │ │ ├── IoEffect.java │ │ ├── LineEnding.java │ │ ├── PathExpression.java │ │ └── fs │ │ │ ├── Fs.java │ │ │ ├── FsUtil.java │ │ │ ├── LocalFs.java │ │ │ ├── ZipFs.java │ │ │ └── ZipFsRoot.java │ │ ├── java │ │ ├── BooleanF.java │ │ ├── ClassF.java │ │ ├── FileF.java │ │ ├── ObjectF.java │ │ └── StringF.java │ │ └── util │ │ ├── FileModulator.java │ │ ├── FolderUtils.java │ │ ├── RelativePath.java │ │ ├── ScriptUtil.java │ │ ├── SystemCommand.java │ │ ├── TestUtil.java │ │ ├── UnixUtil.java │ │ ├── Validate.java │ │ ├── fj │ │ ├── FjFile.java │ │ ├── FjIterator.java │ │ ├── FunctionF.java │ │ ├── ListF.java │ │ └── TreeZipperF.java │ │ └── line │ │ ├── AbstractLineStreamWriter.java │ │ ├── LineConsumer.java │ │ ├── LineFile.java │ │ ├── LineProducer.java │ │ ├── LineStreamUtil.java │ │ ├── LineStreamWriter.java │ │ └── LineWriterWriter.java │ └── test │ ├── java │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ ├── FileAttributesTest.java │ │ ├── PackageFileSystemFormatterTest.java │ │ ├── PackageFileSystemTest.java │ │ ├── PackageVersionTest.java │ │ ├── UnixFileModeTest.java │ │ ├── io │ │ ├── FileScannerTest.java │ │ ├── LineEndingTest.java │ │ └── PathExpressionTest.java │ │ └── util │ │ ├── FileModulatorTest.java │ │ ├── RelativePathTest.java │ │ ├── ScriptUtilTest.java │ │ ├── fj │ │ └── FjIteratorTest.java │ │ └── vfs │ │ └── IncludeExcludeTest.java │ └── resources │ ├── my-project │ ├── Included.java │ └── src │ │ └── main │ │ ├── java │ │ └── Excluded.java │ │ └── unix │ │ └── files │ │ └── opt │ │ └── comp │ │ └── myapp │ │ ├── etc │ │ └── myapp.conf │ │ └── lib │ │ └── huge-file │ └── script-util │ ├── multiple-formats_multiple-packages │ ├── i.daemon │ ├── post-install │ ├── post-install-a │ ├── post-install-a-pkg │ ├── post-install-a-rpm │ ├── post-install-b-pkg │ ├── pre-remove │ └── r.daemon-b-pkg │ ├── single-format_multiple-packages │ ├── i.daemon │ ├── postinstall │ ├── postinstall-a │ ├── postinstall-b │ ├── preremove │ └── r.daemon-b │ └── single-format_single-package │ ├── i.daemon │ ├── postinstall │ ├── preinstall │ └── r.daemon ├── unix-core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── stratio │ │ │ └── mojo │ │ │ └── unix │ │ │ └── core │ │ │ ├── AssemblyOperation.java │ │ │ ├── AssemblyOperationUtil.java │ │ │ ├── CopyDirectoryOperation.java │ │ │ ├── CopyFileOperation.java │ │ │ ├── CreateDirectoriesOperation.java │ │ │ ├── FilterFilesOperation.java │ │ │ ├── FsFileCollector.java │ │ │ ├── LinuxUnixPlatform.java │ │ │ ├── SetAttributesOperation.java │ │ │ ├── SolarisUnixPlatform.java │ │ │ ├── SymlinkOperation.java │ │ │ └── UnixPlatform.java │ └── resources │ │ └── META-INF │ │ └── plexus │ │ └── components.xml │ └── test │ ├── java │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── core │ │ ├── OperationTest.java │ │ └── SetAttributesOperationTest.java │ └── resources │ └── operation │ ├── extract.jar │ └── files │ └── opt │ └── jetty │ ├── .bash_profile │ ├── README-unix.txt │ └── bin │ └── extra-app ├── unix-deb ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── deb │ │ ├── ControlFile.java │ │ ├── DebControlParser.java │ │ ├── DpkgDeb.java │ │ ├── DpkgDebTool.java │ │ └── DpkgDebUtil.java │ └── test │ ├── java │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── deb │ │ ├── ControlFileTest.java │ │ ├── DebControlParserTest.java │ │ └── DpkgDebToolTest.java │ └── resources │ ├── base-files_4_i386.deb │ ├── base-files_4_i386.txt │ └── control │ ├── ant.txt │ ├── bash.txt │ └── libc6.txt ├── unix-handbook ├── build-examples.xml ├── pom.xml ├── src │ ├── main │ │ └── docbook │ │ │ ├── content │ │ │ ├── command-reference │ │ │ │ ├── cat-GROUPS.txt │ │ │ │ ├── dpkg-deb-c.txt │ │ │ │ ├── rpm-qlp.txt │ │ │ │ ├── rpm-qvlp.txt │ │ │ │ └── unzip-l.txt │ │ │ └── handbook.xml │ │ │ ├── examples │ │ │ ├── basic │ │ │ │ ├── dpkg-deb-c.txt │ │ │ │ ├── dpkg-deb-f.txt │ │ │ │ ├── mvn-deb.txt │ │ │ │ ├── mvn-pkg.txt │ │ │ │ ├── mvn-rpm.txt │ │ │ │ ├── mvn-zip.txt │ │ │ │ ├── mvn.txt │ │ │ │ ├── pkgchk.txt │ │ │ │ ├── pkginfo.txt │ │ │ │ ├── pom-deb.xml │ │ │ │ ├── pom-pkg.xml │ │ │ │ ├── pom-rpm.xml │ │ │ │ ├── pom-zip.xml │ │ │ │ ├── pom.magic.xml │ │ │ │ ├── rpm-qlp.txt │ │ │ │ ├── rpm-qvlp.txt │ │ │ │ └── unzip-l.txt │ │ │ ├── hudson-jetty │ │ │ │ ├── mvn.txt │ │ │ │ ├── pkgchk.txt │ │ │ │ ├── pkginfo.txt │ │ │ │ ├── pom.xml │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── unix │ │ │ │ │ └── files │ │ │ │ │ └── opt │ │ │ │ │ └── hudson │ │ │ │ │ └── etc │ │ │ │ │ └── jetty-context.xml │ │ │ ├── pkgchk.txt │ │ │ ├── pkginfo.txt │ │ │ ├── rpm-qlp.txt │ │ │ ├── rpm-qvlp.txt │ │ │ ├── run-basic.sh │ │ │ ├── run-hudson-jetty-pkg.sh │ │ │ └── unzip-l.txt │ │ │ ├── format.xsl │ │ │ ├── generate-id.xsl │ │ │ ├── handbook-fo.xsl │ │ │ ├── handbook-html-chunked.xsl │ │ │ ├── handbook-html-single.xsl │ │ │ ├── highlight.xsl │ │ │ ├── identity.xsl │ │ │ └── process.xsl │ └── site │ │ └── resources │ │ └── css │ │ └── mojo-docbook.css └── xslthl-config.xml ├── unix-maven-plugin ├── pom.xml └── src │ ├── it │ ├── README.txt │ ├── jetty │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ ├── files │ │ │ └── opt │ │ │ │ └── jetty │ │ │ │ ├── README-unix.txt │ │ │ │ └── bin │ │ │ │ └── extra-app │ │ │ └── scripts │ │ │ ├── common │ │ │ ├── post-install │ │ │ ├── post-remove │ │ │ ├── pre-install │ │ │ └── pre-remove │ │ │ ├── dpkg │ │ │ ├── postinst │ │ │ ├── postrm │ │ │ ├── preinst │ │ │ └── prerm │ │ │ └── pkg │ │ │ └── postinstall │ ├── test-deb-1 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ ├── prebuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ └── files │ │ │ └── opt │ │ │ └── hudson │ │ │ └── etc │ │ │ └── config.properties │ ├── test-deb-2 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ └── postbuild.groovy │ ├── test-rpm-1 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ └── files │ │ │ └── opt │ │ │ └── hudson │ │ │ └── etc │ │ │ └── config.properties │ ├── test-rpm-2 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ └── postbuild.groovy │ ├── test-rpm-3 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ └── postbuild.groovy │ ├── test-sysvpkg-1 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ └── scripts │ │ │ ├── checkinstall │ │ │ ├── compver │ │ │ ├── copyright │ │ │ ├── depend │ │ │ ├── request │ │ │ └── space │ ├── test-sysvpkg-2 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ └── postbuild.groovy │ ├── test-sysvpkg-3 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ ├── files-default │ │ │ └── usr │ │ │ │ └── share │ │ │ │ └── hudson │ │ │ │ └── server │ │ │ │ └── README.txt │ │ │ ├── files-slave │ │ │ └── usr │ │ │ │ └── share │ │ │ │ └── hudson │ │ │ │ └── slave │ │ │ │ └── README.txt │ │ │ ├── files │ │ │ └── usr │ │ │ │ └── share │ │ │ │ └── hudson │ │ │ │ └── LICENSE-downstream.txt │ │ │ └── scripts │ │ │ ├── postinstall │ │ │ ├── postinstall-default │ │ │ └── postinstall-slave │ ├── test-sysvpkg-classes │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ └── files-smf │ │ │ ├── app-manifest.xml │ │ │ └── app-method │ ├── test-zip-1 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ ├── prebuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ └── files │ │ │ └── opt │ │ │ └── hudson │ │ │ └── etc │ │ │ ├── filter-1.conf │ │ │ ├── filter-2.conf │ │ │ ├── filter-all.conf │ │ │ └── unfiltered.properties │ ├── test-zip-2 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ └── postbuild.groovy │ ├── test-zip-3 │ │ ├── goals.txt │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ ├── prebuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── unix │ │ │ ├── files-default │ │ │ └── usr │ │ │ │ └── share │ │ │ │ └── hudson │ │ │ │ └── server │ │ │ │ └── README.txt │ │ │ ├── files-slave │ │ │ └── usr │ │ │ │ └── share │ │ │ │ └── hudson │ │ │ │ └── slave │ │ │ │ └── README.txt │ │ │ └── files │ │ │ └── usr │ │ │ └── share │ │ │ └── hudson │ │ │ └── LICENSE-downstream.txt │ ├── unix-from-jar-project │ │ ├── goals.txt │ │ ├── my-native.so │ │ ├── pom4test.xml │ │ ├── postbuild.groovy │ │ ├── prebuild.groovy │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── unix │ │ │ └── Hello.java │ └── web-runner │ │ ├── pom4test.xml │ │ └── src │ │ └── main │ │ └── java │ │ └── WebRunner.java │ ├── main │ ├── java │ │ └── com │ │ │ └── stratio │ │ │ └── mojo │ │ │ └── unix │ │ │ └── maven │ │ │ ├── MojoHelper.java │ │ │ ├── deb │ │ │ ├── DebMojoUtil.java │ │ │ ├── DebPackagingFormat.java │ │ │ ├── DebUnixPackage.java │ │ │ └── DebianDependency.java │ │ │ ├── plugin │ │ │ ├── AbstractFileSetOp.java │ │ │ ├── AbstractPackageAttachedMojo.java │ │ │ ├── AbstractPackageMojo.java │ │ │ ├── AbstractUnixMojo.java │ │ │ ├── AssemblyOp.java │ │ │ ├── CopyArtifact.java │ │ │ ├── CopyDirectory.java │ │ │ ├── CopyFile.java │ │ │ ├── DebSpecificSettings.java │ │ │ ├── Defaults.java │ │ │ ├── DpkgScanPackagesMojo.java │ │ │ ├── ExtractArtifact.java │ │ │ ├── ExtractFile.java │ │ │ ├── FilterFiles.java │ │ │ ├── MavenProjectWrapper.java │ │ │ ├── Mkdirs.java │ │ │ ├── MojoFileAttributes.java │ │ │ ├── Package.java │ │ │ ├── PackageDebAttachedMojo.java │ │ │ ├── PackageDebMojo.java │ │ │ ├── PackageRpmAttachedMojo.java │ │ │ ├── PackageRpmMojo.java │ │ │ ├── PackageSysvPkgAttachedMojo.java │ │ │ ├── PackageSysvPkgMojo.java │ │ │ ├── PackageZipAttachedMojo.java │ │ │ ├── PackageZipMojo.java │ │ │ ├── PackagingFormat.java │ │ │ ├── PackagingMojoParameters.java │ │ │ ├── PkgSpecificSettings.java │ │ │ ├── Regex.java │ │ │ ├── RpmSpecificSettings.java │ │ │ ├── SetAttributes.java │ │ │ ├── Symlink.java │ │ │ └── UnknownArtifactException.java │ │ │ ├── rpm │ │ │ ├── RpmMojoUtil.java │ │ │ ├── RpmPackagingFormat.java │ │ │ └── RpmUnixPackage.java │ │ │ ├── sysvpkg │ │ │ ├── PkgMojoUtil.java │ │ │ ├── PkgUnixPackage.java │ │ │ └── SysvPkgPackagingFormat.java │ │ │ └── zip │ │ │ ├── ZipPackagingFormat.java │ │ │ └── ZipUnixPackage.java │ └── resources │ │ └── META-INF │ │ └── plexus │ │ └── components.xml │ └── test │ ├── java │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── maven │ │ ├── MojoHelperDefaultsTest.java │ │ ├── MojoHelperTest.java │ │ ├── UnixPackageTestUtil.java │ │ ├── VersionTest.java │ │ ├── deb │ │ ├── DebMojoUtilTest.java │ │ └── DebUnixPackageTest.java │ │ ├── plugin │ │ ├── ShittyUtil.java │ │ └── Timestamps.java │ │ └── rpm │ │ └── RpmUnixPackageTest.java │ └── resources │ ├── test-filtering │ └── config.properties │ └── zip │ └── zip-1 │ ├── dirs │ └── bar.txt │ └── file │ └── foo.txt ├── unix-rpm ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── stratio │ │ └── mojo │ │ └── unix │ │ └── rpm │ │ ├── Rpm.java │ │ ├── RpmUtil.java │ │ ├── Rpmbuild.java │ │ └── SpecFile.java │ └── test │ └── java │ └── com │ └── stratio │ └── mojo │ └── unix │ └── rpm │ └── SpecFileTest.java └── unix-sysv-pkg ├── pom.xml └── src ├── main └── java │ └── com │ └── stratio │ └── mojo │ └── unix │ └── sysvpkg │ ├── PkgchkUtil.java │ ├── Pkginfo.java │ ├── PkginfoCommand.java │ ├── PkginfoUtil.java │ ├── PkgmkCommand.java │ ├── PkgtransCommand.java │ └── prototype │ ├── DirectoryEntry.java │ ├── EditableEntry.java │ ├── FileEntry.java │ ├── IEntry.java │ ├── PrototypeEntry.java │ ├── PrototypeFile.java │ └── SymlinkEntry.java └── test └── java └── com └── stratio └── mojo └── unix └── sysvpkg ├── PkgchkUtilTest.java ├── PkginfoTest.java └── prototype └── PrototypeFileTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .idea 3 | *.iml 4 | *.iws 5 | *.ipr 6 | target 7 | *.swp 8 | *.un~ 9 | *.xml~ 10 | 11 | 12 | unix-maven-plugin/src/it/*/build.log 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Only listing significant user-visible, not internal code cleanups and minor bug fixes. 4 | 5 | ## 1.3.0 (upcoming) 6 | 7 | * TBD 8 | 9 | ## 1.2.0 (March 2016) 10 | 11 | * Already expecting DEB conffiles at src/main/unix/files/DEBIAN/conffiles. 12 | * Building RPM spec with each line existing at src/main/unix/files/DEBIAN/conffiles. 13 | 14 | ## 1.1.6 (Sometime) 15 | 16 | * Improvements over trygvis repo 17 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | @Library('libpipelines@master') _ 2 | 3 | hose { 4 | EMAIL = 'qa' 5 | SLACKTEAM = 'stratioqa' 6 | DEVTIMEOUT = 40 7 | MODULE = 'unix-maven-plugin' 8 | REPOSITORY = 'unix-maven-plugin' 9 | FOSS = true 10 | MOJO = true 11 | 12 | DEV = { config -> 13 | doCompile(config) 14 | doUT(config) 15 | doPackage(config) 16 | 17 | parallel(DOC: { 18 | doDoc(config) 19 | }, QC: { 20 | doStaticAnalysis(config) 21 | }, DEPLOY: { 22 | doDeploy(config) 23 | }, failFast: config.FAILFAST) 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2009 The Codehaus. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Coverage Status](https://coveralls.io/repos/github/Stratio/unix-maven-plugin/badge.svg?branch=master)](https://coveralls.io/github/Stratio/unix-maven-plugin?branch=master) 2 | 3 | unix-maven-plugin 4 | ================= 5 | 6 | Stratio's fork of the unix-maven-plugin from the Codehaus Mojo project. 7 | 8 | used in every Stratio platform component. 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/site/fml/faq.fml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | How can I talk to the developers 23 | 24 | See the Mojo site. 25 | 26 | 27 | 28 | Does the pkg plugin work on a non-Solaris platform? 29 | 30 |

31 | The short answer is: probably not (yet). 32 |

33 |

34 | The a bit longer answer is that it will only run on platforms that have the pkgmk and 35 | pkgtrans tools installed in PATH. If you're on a platform without these tools installed 36 | natively you can try to install the tools from the 37 | Heirloom 38 | project. 39 |

40 |

41 | It wouldn't be very hard to implement a basic version of these tools in plain java, but it will take a bit 42 | of effort and not least testing. See the Developers page for more information 43 | about how to develop the plugin and specification of the package data stream format. 44 |

45 |
46 |
47 |
48 |
49 | -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/site/xdoc/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | Unix Maven Plugin 22 | Trygve Laugstol 23 | 24 | 25 |
26 |

27 | The unix-maven-plugin is a Maven plugin for producing installation packages for UNIX platforms. 28 |

29 | 30 |

31 | The plugin currently support the following packaging formats and platforms: 32 |

33 |
    34 |
  • 35 | deb - Debian and Debian-based platforms like Ubuntu 36 |
  • 37 |
  • 38 | pkg - Platforms with System V packaging tools like Solaris and HP-UX. Only Solaris is tested. 39 |
  • 40 |
  • 41 | rpm - RedHat, Fedora and other platforms using RPM. Many platforms have RPM even if they use 42 | another format as their primary format. 43 |
  • 44 |
  • 45 | zip - Generic zip files. A better assembly plugin that the assembly plugin. 46 |
  • 47 |
48 |

49 | Other features: 50 |

51 |
    52 |
  • 53 | Simplified assembly: The plugin supports advanced assembly features without requiring the Maven 54 | Assembly Plugin. See Assembly Operations. 55 |
  • 56 |
  • 57 | Repository index generation: Goals for running dpkg-scanpackages 58 |
  • 59 |
60 |

61 | Make sure you read the Handbook. This contains all the information you need. 62 |

63 |
64 |
65 | 66 |
67 | -------------------------------------------------------------------------------- /src/site/xdoc/usage.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | Unix Maven Plugin 22 | Trygve Laugstol 23 | 24 | 25 |
26 |

27 | The documentation for the plugin is available in the handbook in three formats: 28 |

29 | 40 |
41 | 42 |
43 | -------------------------------------------------------------------------------- /unix-ar/pom.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 4.0.0 27 | 28 | com.stratio.mojo.unix 29 | unix 30 | 1.3.0-SNAPSHOT 31 | 32 | unix-ar 33 | Maven Ar File Format Tools 34 | 35 | 36 | org.codehaus.plexus 37 | plexus-utils 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /unix-ar/src/main/java/com/stratio/mojo/unix/ar/FileNameTooLongException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.ar; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public class FileNameTooLongException 46 | extends RuntimeException 47 | { 48 | } 49 | -------------------------------------------------------------------------------- /unix-ar/src/main/java/com/stratio/mojo/unix/ar/InvalidArchiveMagicException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.ar; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public class InvalidArchiveMagicException 46 | extends RuntimeException 47 | { 48 | } 49 | -------------------------------------------------------------------------------- /unix-ar/src/main/java/com/stratio/mojo/unix/ar/InvalidFileMagicException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.ar; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public class InvalidFileMagicException 46 | extends RuntimeException 47 | { 48 | } 49 | -------------------------------------------------------------------------------- /unix-ar/src/main/java/com/stratio/mojo/unix/ar/NoSuchFileInArchiveException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.ar; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public class NoSuchFileInArchiveException 46 | extends RuntimeException 47 | { 48 | } 49 | -------------------------------------------------------------------------------- /unix-common/pom.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 4.0.0 27 | 28 | com.stratio.mojo.unix 29 | unix 30 | 1.3.0-SNAPSHOT 31 | 32 | unix-common 33 | Common Unix Code 34 | 35 | 36 | org.codehaus.plexus 37 | plexus-utils 38 | 39 | 40 | org.functionaljava 41 | functionaljava 42 | 43 | 44 | joda-time 45 | joda-time 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/EqualsIgnoreNull.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public interface EqualsIgnoreNull 46 | { 47 | boolean equalsIgnoreNull( T other ); 48 | } 49 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/FileCollector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import fj.F; 43 | import fj.data.Option; 44 | import com.stratio.mojo.unix.io.fs.Fs; 45 | 46 | import java.io.IOException; 47 | 48 | import static com.stratio.mojo.unix.UnixFsObject.*; 49 | 50 | /** 51 | * @author Trygve Laugstøl 52 | */ 53 | public interface FileCollector 54 | { 55 | void addDirectory( Directory directory ) 56 | throws IOException; 57 | 58 | void addFile( Fs fromFile, RegularFile file ) 59 | throws IOException; 60 | 61 | void addSymlink( Symlink symlink ) 62 | throws IOException; 63 | 64 | void apply( F> f ); 65 | } 66 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/MissingSettingException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public class MissingSettingException 46 | extends RuntimeException 47 | { 48 | private final String setting; 49 | 50 | public MissingSettingException( String setting ) 51 | { 52 | super( "Missing required setting: " + setting ); 53 | this.setting = setting; 54 | } 55 | 56 | public String getSetting() 57 | { 58 | return setting; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/PackageFileSystemObject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import com.stratio.mojo.unix.util.*; 43 | 44 | /** 45 | * E is data associated with the object. 46 | */ 47 | public interface PackageFileSystemObject 48 | { 49 | UnixFsObject getUnixFsObject(); 50 | 51 | E getExtension(); 52 | 53 | PackageFileSystemObject withUnixFsObject( UnixFsObject object ); 54 | } 55 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/PlainPackageFileSystemObject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * TODO: make plain not extend basic, removing the need to implement getExtension(). 44 | */ 45 | public class PlainPackageFileSystemObject 46 | extends BasicPackageFileSystemObject 47 | { 48 | public PlainPackageFileSystemObject( UnixFsObject unixFsObject ) 49 | { 50 | super( unixFsObject, null ); 51 | } 52 | 53 | public PackageFileSystemObject getExtension() 54 | { 55 | throw new RuntimeException( "Not implemented" ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/io/IoEffect.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.io; 17 | 18 | public interface IoEffect 19 | { 20 | void run() 21 | throws Exception; 22 | } 23 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/io/fs/Fs.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.io.fs; 17 | 18 | import com.stratio.mojo.unix.io.*; 19 | import com.stratio.mojo.unix.util.*; 20 | import org.joda.time.*; 21 | 22 | import java.io.*; 23 | 24 | /** 25 | * Move the write methods into WrFs<F extends Fs> extends Fs<F> 26 | */ 27 | public interface Fs 28 | extends Closeable 29 | { 30 | boolean exists(); 31 | 32 | boolean isFile(); 33 | 34 | boolean isDirectory(); 35 | 36 | LocalDateTime lastModified(); 37 | 38 | long size(); 39 | 40 | F resolve( RelativePath relativePath ); 41 | 42 | /** 43 | * The logical root of this file system. For local file system, it is the File it was created from, for archive 44 | * file system types it's the archive's File path. 45 | */ 46 | File basedir(); 47 | 48 | /** 49 | * The path inside the file system. 50 | */ 51 | RelativePath relativePath(); 52 | 53 | /** 54 | * For local files, File.getAbsolutePath. For archive files it's the archives path + "!" + relativePath 55 | */ 56 | String absolutePath(); 57 | 58 | InputStream inputStream() 59 | throws IOException; 60 | 61 | Iterable find( IncludeExcludeFilter filter ) 62 | throws IOException; 63 | 64 | void mkdir() 65 | throws IOException; 66 | 67 | void copyFrom( Fs from ) 68 | throws IOException; 69 | 70 | void copyFrom( Fs from, InputStream is ) 71 | throws IOException; 72 | } 73 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/io/fs/FsUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.io.fs; 17 | 18 | import java.io.*; 19 | import java.util.*; 20 | 21 | public class FsUtil 22 | { 23 | private final static String[] zipFileTypes = { "zip", "jar", "war", "ear", "sar", }; 24 | 25 | static { 26 | Arrays.sort( zipFileTypes ); 27 | } 28 | 29 | /** 30 | * Remember to close() the Fs-es after use. 31 | */ 32 | public static Fs resolve( File file ) 33 | throws IOException 34 | { 35 | if ( file.isDirectory() ) 36 | { 37 | return new LocalFs( file ); 38 | } 39 | 40 | int i = file.getName().lastIndexOf( '.' ); 41 | 42 | if ( i < 1 ) 43 | { 44 | throw new IOException( "Unable to resolve file type of file: " + file.getAbsolutePath() ); 45 | } 46 | 47 | String ending = file.getName().substring( i + 1 ); 48 | 49 | if ( Arrays.binarySearch( zipFileTypes, ending ) >= 0 ) 50 | { 51 | return new ZipFsRoot( file ); 52 | } 53 | else 54 | { 55 | throw new IOException( "Unable to resolve file type of file: " + file.getAbsolutePath() ); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/java/BooleanF.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.java; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import fj.*; 43 | 44 | public class BooleanF 45 | { 46 | public static F invert = new F() 47 | { 48 | public Boolean f( Boolean bool ) 49 | { 50 | return !bool; 51 | } 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/java/ObjectF.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.java; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import fj.*; 43 | 44 | import java.lang.Class; 45 | 46 | /** 47 | * @author Trygve Laugstøl 48 | */ 49 | public class ObjectF 50 | { 51 | public static F getClass_() 52 | { 53 | return new F() 54 | { 55 | public Class f( T o ) 56 | { 57 | return o.getClass(); 58 | } 59 | }; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/util/FolderUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.util; 17 | 18 | import java.io.File; 19 | 20 | public class FolderUtils { 21 | 22 | public static long folderSize(File directory) { 23 | long length = 0; 24 | if (directory.exists()){ 25 | for (File file : directory.listFiles()) { 26 | if (file.isFile()) 27 | length += file.length(); 28 | else 29 | length += folderSize(file); 30 | } 31 | } 32 | 33 | return length; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/util/fj/FjFile.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.util.fj; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import fj.*; 43 | 44 | import java.io.*; 45 | 46 | public class FjFile 47 | { 48 | public final File file; 49 | 50 | public FjFile( File file ) 51 | { 52 | this.file = file; 53 | } 54 | 55 | public static F toF( final FileFilter filter ) 56 | { 57 | return new F() 58 | { 59 | public Boolean f( File file ) 60 | { 61 | return filter.accept( file ); 62 | } 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/util/fj/ListF.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.util.fj; 17 | 18 | import fj.*; 19 | import fj.data.*; 20 | 21 | /** 22 | * @author Trygve Laugstøl 23 | */ 24 | public class ListF 25 | { 26 | public static F> list_() 27 | { 28 | return new F>() 29 | { 30 | public List f( T[] ts ) 31 | { 32 | return List.list( ts ); 33 | } 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/util/line/LineConsumer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.util.line; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * A factory for objects that can create an object from a set of lines. 44 | * 45 | * @author Trygve Laugstøl 46 | */ 47 | public interface LineConsumer 48 | { 49 | T fromStream( Iterable lines ); 50 | } 51 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/util/line/LineProducer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.util.line; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | /** 43 | * @author Trygve Laugstøl 44 | */ 45 | public interface LineProducer 46 | { 47 | void streamTo( LineStreamWriter streamWriter ); 48 | } 49 | -------------------------------------------------------------------------------- /unix-common/src/main/java/com/stratio/mojo/unix/util/line/LineStreamWriter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.util.line; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import java.io.*; 43 | import java.util.*; 44 | 45 | /** 46 | * @author Trygve Laugstøl 47 | */ 48 | public interface LineStreamWriter 49 | { 50 | String EOL = System.getProperty( "line.separator" ); 51 | 52 | LineStreamWriter add(); 53 | 54 | LineStreamWriter add( String line ); 55 | 56 | LineStreamWriter addIfNotEmpty( String value ); 57 | 58 | LineStreamWriter addIfNotEmpty( String field, String value ); 59 | 60 | LineStreamWriter addIfNotNull( File file ); 61 | 62 | LineStreamWriter addIf( boolean flag, String value ); 63 | 64 | LineStreamWriter addAllLines( Iterator lines ); 65 | 66 | LineStreamWriter addAllLines( Iterable lines ); 67 | } 68 | -------------------------------------------------------------------------------- /unix-common/src/test/java/com/stratio/mojo/unix/io/LineEndingTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.io; 17 | 18 | import fj.*; 19 | import junit.framework.*; 20 | import org.codehaus.plexus.util.*; 21 | 22 | import java.io.*; 23 | 24 | public class LineEndingTest 25 | extends TestCase 26 | { 27 | public void testDetect() 28 | throws Exception 29 | { 30 | assertResult( new byte[]{ 'a', 'b', '\n'}, LineEnding.unix ); 31 | assertResult( new byte[]{ 'a', 'b', '\n', 'c', 'd'}, LineEnding.unix ); 32 | assertResult( new byte[]{ 'a', 'b', '\r', '\n', 'c', 'd'}, LineEnding.windows ); 33 | } 34 | 35 | private void assertResult( byte[] bytes, LineEnding lineEnding ) 36 | throws IOException 37 | { 38 | P2 x = LineEnding.detect( new ByteArrayInputStream( bytes ) ); 39 | 40 | assertEquals( lineEnding, x._2() ); 41 | byte[] actualBytes = IOUtil.toByteArray( x._1() ); 42 | assertEquals( bytes.length, actualBytes.length ); 43 | for ( int i = 0; i < actualBytes.length; i++ ) 44 | { 45 | assertEquals( "byte #" + i, bytes[i], actualBytes[i] ); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/my-project/Included.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/my-project/src/main/java/Excluded.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/my-project/src/main/unix/files/opt/comp/myapp/etc/myapp.conf: -------------------------------------------------------------------------------- 1 | my-app -------------------------------------------------------------------------------- /unix-common/src/test/resources/my-project/src/main/unix/files/opt/comp/myapp/lib/huge-file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-common/src/test/resources/my-project/src/main/unix/files/opt/comp/myapp/lib/huge-file -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/i.daemon: -------------------------------------------------------------------------------- 1 | i.daemon 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/post-install: -------------------------------------------------------------------------------- 1 | postinstall 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/post-install-a: -------------------------------------------------------------------------------- 1 | postinstall-a 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/post-install-a-pkg: -------------------------------------------------------------------------------- 1 | postinstall-a-pkg 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/post-install-a-rpm: -------------------------------------------------------------------------------- 1 | postinstall-a-rpm 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/post-install-b-pkg: -------------------------------------------------------------------------------- 1 | postinstall-b-pkg 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/pre-remove: -------------------------------------------------------------------------------- 1 | preremove 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/multiple-formats_multiple-packages/r.daemon-b-pkg: -------------------------------------------------------------------------------- 1 | r.daemon-b-pkg 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_multiple-packages/i.daemon: -------------------------------------------------------------------------------- 1 | i.daemon 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_multiple-packages/postinstall: -------------------------------------------------------------------------------- 1 | postinstall 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_multiple-packages/postinstall-a: -------------------------------------------------------------------------------- 1 | postinstall-a 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_multiple-packages/postinstall-b: -------------------------------------------------------------------------------- 1 | postinstall-b 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_multiple-packages/preremove: -------------------------------------------------------------------------------- 1 | preremove 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_multiple-packages/r.daemon-b: -------------------------------------------------------------------------------- 1 | r.daemon-b 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_single-package/i.daemon: -------------------------------------------------------------------------------- 1 | i.daemon 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_single-package/postinstall: -------------------------------------------------------------------------------- 1 | postinstall 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_single-package/preinstall: -------------------------------------------------------------------------------- 1 | preinstall 2 | -------------------------------------------------------------------------------- /unix-common/src/test/resources/script-util/single-format_single-package/r.daemon: -------------------------------------------------------------------------------- 1 | r.daemon 2 | -------------------------------------------------------------------------------- /unix-core/pom.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 4.0.0 27 | 28 | com.stratio.mojo.unix 29 | unix 30 | 1.3.0-SNAPSHOT 31 | 32 | unix-core 33 | Maven Unix Plugin Core 34 | 35 | 36 | ${project.groupId} 37 | unix-common 38 | ${project.version} 39 | 40 | 41 | easymock 42 | easymock 43 | 1.2_Java1.3 44 | test 45 | 46 | 47 | joda-time 48 | joda-time 49 | 50 | 51 | org.codehaus.plexus 52 | plexus-container-default 53 | test 54 | 55 | 56 | org.functionaljava 57 | functionaljava 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /unix-core/src/main/java/com/stratio/mojo/unix/core/AssemblyOperation.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.core; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import com.stratio.mojo.unix.*; 43 | import com.stratio.mojo.unix.io.fs.*; 44 | import com.stratio.mojo.unix.util.line.*; 45 | 46 | import java.io.*; 47 | 48 | /** 49 | * TODO: Remove the LineProducer inheritance, replace with String debugString(). 50 | * Let the implementations use LineFile internally. 51 | * 52 | * @author Trygve Laugstøl 53 | */ 54 | public interface AssemblyOperation 55 | extends LineProducer 56 | { 57 | void perform(FileCollector fileCollector) 58 | throws IOException; 59 | } 60 | -------------------------------------------------------------------------------- /unix-core/src/main/java/com/stratio/mojo/unix/core/LinuxUnixPlatform.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.core; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import static fj.data.Option.*; 43 | import com.stratio.mojo.unix.*; 44 | import static com.stratio.mojo.unix.UnixFileMode.*; 45 | 46 | public class LinuxUnixPlatform 47 | implements UnixPlatform 48 | { 49 | private static final FileAttributes defaultFileAttributes = 50 | new FileAttributes( some( "root" ), some( "root" ), some( _0644 ) ); 51 | 52 | private static final FileAttributes defaultDirectoryAttributes = 53 | defaultFileAttributes.mode( _0755 ); 54 | 55 | public FileAttributes getDefaultFileAttributes() 56 | { 57 | return defaultFileAttributes; 58 | } 59 | 60 | public FileAttributes getDefaultDirectoryAttributes() 61 | { 62 | return defaultDirectoryAttributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /unix-core/src/main/java/com/stratio/mojo/unix/core/SolarisUnixPlatform.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.core; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import static fj.data.Option.*; 43 | import com.stratio.mojo.unix.*; 44 | import static com.stratio.mojo.unix.UnixFileMode.*; 45 | 46 | public class SolarisUnixPlatform 47 | implements UnixPlatform 48 | { 49 | private static final FileAttributes defaultFileAttributes = 50 | new FileAttributes( some( "nobody" ), some( "nogroup" ), some( _0644 ) ); 51 | 52 | private static final FileAttributes defaultDirectoryAttributes = 53 | defaultFileAttributes.mode( _0755 ); 54 | 55 | public FileAttributes getDefaultFileAttributes() 56 | { 57 | return defaultFileAttributes; 58 | } 59 | 60 | public FileAttributes getDefaultDirectoryAttributes() 61 | { 62 | return defaultDirectoryAttributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /unix-core/src/main/java/com/stratio/mojo/unix/core/UnixPlatform.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.core; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import com.stratio.mojo.unix.*; 43 | 44 | public interface UnixPlatform 45 | { 46 | FileAttributes getDefaultFileAttributes(); 47 | 48 | FileAttributes getDefaultDirectoryAttributes(); 49 | } 50 | -------------------------------------------------------------------------------- /unix-core/src/main/resources/META-INF/plexus/components.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | com.stratio.mojo.unix.core.UnixPlatform 22 | solaris 23 | com.stratio.mojo.unix.core.SolarisUnixPlatform 24 | 25 | 26 | com.stratio.mojo.unix.core.UnixPlatform 27 | linux 28 | com.stratio.mojo.unix.core.LinuxUnixPlatform 29 | 30 | 31 | com.stratio.mojo.unix.core.UnixPlatform 32 | generic 33 | com.stratio.mojo.unix.core.LinuxUnixPlatform 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /unix-core/src/test/resources/operation/extract.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-core/src/test/resources/operation/extract.jar -------------------------------------------------------------------------------- /unix-core/src/test/resources/operation/files/opt/jetty/.bash_profile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-core/src/test/resources/operation/files/opt/jetty/.bash_profile -------------------------------------------------------------------------------- /unix-core/src/test/resources/operation/files/opt/jetty/README-unix.txt: -------------------------------------------------------------------------------- 1 | I'm a README, hooray for me! 2 | -------------------------------------------------------------------------------- /unix-core/src/test/resources/operation/files/opt/jetty/bin/extra-app: -------------------------------------------------------------------------------- 1 | extra-app 2 | -------------------------------------------------------------------------------- /unix-deb/src/test/java/com/stratio/mojo/unix/deb/ControlFileTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.deb; 17 | 18 | import fj.*; 19 | import fj.data.*; 20 | import static fj.data.List.*; 21 | import junit.framework.*; 22 | import static com.stratio.mojo.unix.deb.ControlFile.*; 23 | 24 | public class ControlFileTest 25 | extends TestCase 26 | { 27 | Show> listShow = Show.listShow( Show.stringShow ); 28 | Equal> listEqual = Equal.listEqual( Equal.stringEqual ); 29 | 30 | public void testBasic() 31 | { 32 | ControlFile controlFile = new ControlFile( "package-name" ).depends( list( "tomcat6", "sun-java6-jdk" ) ); 33 | 34 | assertTrue( listEqual.eq( controlFile.toList(), list( "Package: package-name", 35 | "Depends: tomcat6, sun-java6-jdk" ) ) ); 36 | } 37 | 38 | public void testListToHeader() 39 | { 40 | List list; 41 | 42 | assertTrue( listEqual.eq( listToHeader( 10, "Foo", List.nil() ), List.nil() ) ); 43 | 44 | assertTrue( listEqual.eq( listToHeader( 10, "Foo", single( "yo" ) ), single( "Foo: yo" ) ) ); 45 | 46 | list = listToHeader( 10, "Foo", list( "yo", "1234567890" ) ); 47 | assertTrue( listEqual.eq( list, list( "Foo: yo, ", " 1234567890" ) ) ); 48 | 49 | list = listToHeader( 10, "Foo", list( "1234567890", "yo" ) ); 50 | assertTrue( listEqual.eq( list, list( "Foo: 1234567890, ", " yo" ) ) ); 51 | 52 | list = listToHeader( 10, "Foo", list( "1234567890", "1234567890", "1234567890", "1234567890", "1234567890" ) ); 53 | assertTrue( listEqual.eq( list, list( "Foo: 1234567890, ", " 1234567890, ", " 1234567890, ", " 1234567890, ", " 1234567890" ) ) ); 54 | 55 | list = listToHeader( 10, "Foo", list( "aa", "bb", "cc", "dd", "ee", "ff", "gg", "hh", "ii", "jj" ) ); 56 | assertTrue( listEqual.eq( list, list( "Foo: aa, bb, ", " cc, dd, ee, ", " ff, gg, hh, ", " ii, jj" ) ) ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /unix-deb/src/test/resources/base-files_4_i386.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-deb/src/test/resources/base-files_4_i386.deb -------------------------------------------------------------------------------- /unix-deb/src/test/resources/control/ant.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | Package: ant 18 | Priority: optional 19 | Section: devel 20 | Installed-Size: 1025 21 | Maintainer: Ubuntu Core Developers 22 | Original-Maintainer: Debian Java Maintainers 23 | Architecture: all 24 | Version: 1.7.0-3 25 | Replaces: libant1.6-java, ant-doc (<= 1.6.5-1) 26 | Depends: java-gcj-compat-dev | java-virtual-machine, java-gcj-compat | java1-runtime | java2-runtime, libxerces2-java 27 | Recommends: ant-optional, ant-gcj 28 | Suggests: ant-doc 29 | Conflicts: libant1.6-java, ant-doc (<= 1.6.5-1) 30 | Filename: pool/main/a/ant/ant_1.7.0-3_all.deb 31 | Size: 1281048 32 | MD5sum: bc3ae0ff50241b4ec81f109a04feb114 33 | SHA1: eda619ce5d6ad97742b2f6abcc6cb30316aec1fa 34 | SHA256: 6f8c71b09bfb2df2b7ac0e5cebe85a733a06a3f61226413b3913460c81ea777d 35 | Description: Java based build tool like make 36 | A system independent (i.e. not shell based) build tool that uses XML 37 | files as "Makefiles". This package contains the scripts and the core 38 | tasks libraries. 39 | . 40 | Homepage: http://ant.apache.org/ 41 | Bugs: mailto:ubuntu-users@lists.ubuntu.com 42 | Origin: Ubuntu 43 | -------------------------------------------------------------------------------- /unix-deb/src/test/resources/control/bash.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | Package: bash 18 | Essential: yes 19 | Priority: required 20 | Section: base 21 | Installed-Size: 1316 22 | Maintainer: Ubuntu Core developers 23 | Original-Maintainer: Matthias Klose 24 | Architecture: amd64 25 | Version: 3.2-0ubuntu16 26 | Replaces: bash-completion (<< 20060301), bash-doc (<= 2.05-1) 27 | Depends: base-files (>= 2.1.12), debianutils (>= 2.15) 28 | Pre-Depends: libc6 (>= 2.4), libncurses5 (>= 5.6+20071006-3) 29 | Recommends: bash-completion (>= 20060301) 30 | Suggests: bash-doc 31 | Conflicts: bash-completion (<< 20060301) 32 | Filename: pool/main/b/bash/bash_3.2-0ubuntu16_amd64.deb 33 | Size: 614892 34 | MD5sum: 36ebbaf67a8cc3b02ed702862b8211b8 35 | SHA1: 135042a328e48f662e6a96adb22622ce36313202 36 | SHA256: c252e624e62a3e3cc253972a909308ec24b5ea282e1602a9c81b140c4f5af998 37 | Description: The GNU Bourne Again SHell 38 | Bash is an sh-compatible command language interpreter that executes 39 | commands read from the standard input or from a file. Bash also 40 | incorporates useful features from the Korn and C shells (ksh and csh). 41 | . 42 | Bash is ultimately intended to be a conformant implementation of the 43 | IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2). 44 | . 45 | The Programmable Completion Code, by Ian Macdonald, is now found in 46 | the bash-completion package. 47 | Bugs: mailto:ubuntu-users@lists.ubuntu.com 48 | Origin: Ubuntu 49 | Task: minimal 50 | -------------------------------------------------------------------------------- /unix-deb/src/test/resources/control/libc6.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | Package: libc6 18 | Priority: required 19 | Section: base 20 | Installed-Size: 11348 21 | Maintainer: Ubuntu Core developers 22 | Original-Maintainer: GNU Libc Maintainers 23 | Architecture: amd64 24 | Source: glibc 25 | Version: 2.7-10ubuntu3 26 | Provides: glibc-2.7-1 27 | Depends: libgcc1 28 | Suggests: locales, glibc-doc 29 | Conflicts: libterm-readline-gnu-perl (<< 1.15-2), tzdata (<< 2007k-1) 30 | Filename: pool/main/g/glibc/libc6_2.7-10ubuntu3_amd64.deb 31 | Size: 4754108 32 | MD5sum: fe033464b288284d4031a3de64da4567 33 | SHA1: 402ab2c33aa59af6a4802de6340dd32be2229dce 34 | SHA256: 18dfd2ba99f95bae7778520afa1b4e86deff490aaa04d08da3e1b3100c999f45 35 | Description: GNU C Library: Shared libraries 36 | Contains the standard libraries that are used by nearly all programs on 37 | the system. This package includes shared versions of the standard C library 38 | and the standard math library, as well as many others. 39 | Bugs: mailto:ubuntu-users@lists.ubuntu.com 40 | Origin: Ubuntu 41 | Task: minimal -------------------------------------------------------------------------------- /unix-handbook/build-examples.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/content/command-reference/cat-GROUPS.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ cat /usr/share/doc/rpm-*/GROUPS 18 | Amusements/Games 19 | Amusements/Graphics 20 | Applications/Archiving 21 | Applications/Communications 22 | Applications/Databases 23 | Applications/Editors 24 | Applications/Emulators 25 | Applications/Engineering 26 | Applications/File 27 | Applications/Internet 28 | Applications/Multimedia 29 | Applications/Productivity 30 | Applications/Publishing 31 | Applications/System 32 | Applications/Text 33 | Development/Debuggers 34 | Development/Languages 35 | Development/Libraries 36 | Development/System 37 | Development/Tools 38 | Documentation 39 | System Environment/Base 40 | System Environment/Daemons 41 | System Environment/Kernel 42 | System Environment/Libraries 43 | System Environment/Shells 44 | User Interface/Desktops 45 | User Interface/X 46 | User Interface/X Hardware Support 47 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/content/command-reference/dpkg-deb-c.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ dpkg-deb -c target/*.deb 18 | drwxr-xr-x root/root 0 2011-07-07 16:38 ./ 19 | drwxr-xr-x root/root 0 2011-07-07 16:38 ./var/ 20 | drwxr-xr-x root/root 0 2011-07-07 16:38 ./var/log/ 21 | drwxr-xr-x root/root 0 2011-07-07 16:38 ./opt/ 22 | drwxr-xr-x root/root 0 2011-07-07 16:38 ./opt/hudson/ 23 | -rw-r--r-- root/root 20623413 2011-04-27 10:41 ./opt/hudson/hudson.war 24 | lrwxrwxrwx root/root 0 2011-07-07 16:38 ./var/log/hudson -> /var/opt/hudson/log 25 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/content/command-reference/rpm-qlp.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ rpm -q -l -p target/basic-*.rpm 18 | /opt 19 | /opt/hudson 20 | /opt/hudson/doc 21 | /opt/hudson/doc/atom-license.txt 22 | /opt/hudson/doc/dc-license.txt 23 | /opt/hudson/hudson.war 24 | /var 25 | /var/log 26 | /var/log/hudson 27 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/content/command-reference/rpm-qvlp.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ rpm -q -v -l -p target/basic-*.rpm 18 | drwxr-xr-x 2 nobody nogroup 0 May 13 21:27 /opt 19 | drwxr-xr-x 2 nobody nogroup 0 May 13 21:27 /opt/hudson 20 | drwxr-xr-x 2 nobody nogroup 0 May 13 21:27 /opt/hudson/doc 21 | -rw-r--r-- 1 nobody nogroup 49 Oct 2 2008 /opt/hudson/doc/atom-license.txt 22 | -rw-r--r-- 1 nobody nogroup 1544 Oct 2 2008 /opt/hudson/doc/dc-license.txt 23 | -rw-rw-rw- 1 hudson hudson 20623413 Oct 24 2008 /opt/hudson/hudson.war 24 | drwxr-xr-x 2 nobody nogroup 0 May 13 21:27 /var 25 | drwxr-xr-x 2 nobody nogroup 0 May 13 21:27 /var/log 26 | lrwxrwxrwx 1 nobody nogroup 19 May 13 21:27 /var/log/hudson -> /var/opt/hudson/log 27 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/content/command-reference/unzip-l.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ unzip -l target/basic-*.zip 18 | Archive: target/basic-1.0-SNAPSHOT.zip 19 | Length Date Time Name 20 | -------- ---- ---- ---- 21 | 0 04-07-11 13:33 ./opt/ 22 | 0 04-07-11 13:33 ./opt/hudson/ 23 | 0 04-07-11 13:33 ./opt/hudson/doc/ 24 | 49 10-02-08 02:07 ./opt/hudson/doc/atom-license.txt 25 | 1544 10-02-08 02:07 ./opt/hudson/doc/dc-license.txt 26 | 20623413 09-30-10 10:12 ./opt/hudson/hudson.war 27 | -------- ------- 28 | 20625006 6 files 29 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/dpkg-deb-c.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ dpkg-deb -c target/*.deb 18 | drwxr-xr-x root/root 0 2011-07-08 17:10 ./ 19 | drwxr-xr-x root/root 0 2011-07-08 17:10 ./var/ 20 | drwxr-xr-x root/root 0 2011-07-08 17:10 ./var/log/ 21 | drwxr-xr-x root/root 0 2011-07-08 17:10 ./opt/ 22 | drwxr-xr-x root/root 0 2011-07-08 17:10 ./opt/hudson/ 23 | drwxr-xr-x root/root 0 2011-07-08 17:10 ./opt/hudson/doc/ 24 | -rw-r--r-- root/root 1544 2008-10-02 02:07 ./opt/hudson/doc/dc-license.txt 25 | -rw-r--r-- root/root 49 2008-10-02 02:07 ./opt/hudson/doc/atom-license.txt 26 | -rw-r--r-- root/root 20623413 2011-04-27 10:41 ./opt/hudson/hudson.war 27 | lrwxrwxrwx root/root 0 2011-07-08 17:10 ./var/log/hudson -> /var/opt/hudson/log 28 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/dpkg-deb-f.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ dpkg-deb -f target/*.deb 18 | Package: basic 19 | Section: devel 20 | Priority: standard 21 | Maintainer: Acme 22 | Installed-Size: 1024 23 | Version: 1.0-20110708.151032 24 | Architecture: all 25 | Description: Hudson Solaris Package 26 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/mvn-deb.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | [INFO] Scanning for projects... 18 | [INFO] 19 | [INFO] ------------------------------------------------------------------------ 20 | [INFO] Building Hudson Solaris Package 1.0-SNAPSHOT 21 | [INFO] ------------------------------------------------------------------------ 22 | [INFO] 23 | [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ basic --- 24 | [INFO] 25 | [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ basic --- 26 | [debug] execute contextualize 27 | [INFO] Using 'UTF-8' encoding to copy filtered resources. 28 | [INFO] skip non existing resourceDirectory ~/unix/unix-handbook/src/main/docbook/examples/basic/src/main/resources 29 | [INFO] 30 | [INFO] --- unix-maven-plugin:1.0-alpha-5-SNAPSHOT:package-deb (default-package-deb) @ basic --- 31 | [INFO] Using "/tmp/vfs_cache" as temporary files store. 32 | [INFO] 33 | [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ basic --- 34 | [INFO] Installing ~/unix/unix-handbook/src/main/docbook/examples/basic/target/basic-1.0-SNAPSHOT.deb to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.deb 35 | [INFO] Installing ~/unix/unix-handbook/src/main/docbook/examples/basic/pom-deb.xml to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.pom 36 | [INFO] ------------------------------------------------------------------------ 37 | [INFO] BUILD SUCCESS 38 | [INFO] ------------------------------------------------------------------------ 39 | [INFO] Total time: 4.001s 40 | [INFO] Finished at: Fri Jul 08 17:10:34 CEST 2011 41 | [INFO] Final Memory: 9M/149M 42 | [INFO] ------------------------------------------------------------------------ 43 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/mvn-pkg.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | [INFO] Scanning for projects... 18 | [INFO] ------------------------------------------------------------------------ 19 | [INFO] Building Hudson Solaris Package 20 | [INFO] task-segment: [clean, install] 21 | [INFO] ------------------------------------------------------------------------ 22 | [INFO] [clean:clean] 23 | [INFO] [resources:resources] 24 | [INFO] Using 'UTF-8' encoding to copy filtered resources. 25 | [INFO] skip non existing resourceDirectory ~/unix/unix-handbook/src/main/docbook/examples/basic/src/main/resources 26 | [INFO] [unix:package-pkg] 27 | . 28 | opt 29 | hudson 30 | doc 31 | atom-license.txt 32 | dc-license.txt 33 | hudson.war 34 | var 35 | log 36 | hudson 37 | 38 | [INFO] [install:install] 39 | [INFO] Installing ~/unix/src/examples/basic-pkg/target/basic-1.0-SNAPSHOT.pkg to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.pkg 40 | [INFO] ------------------------------------------------------------------------ 41 | [INFO] BUILD SUCCESSFUL 42 | [INFO] ------------------------------------------------------------------------ 43 | [INFO] Total time: 4 seconds 44 | [INFO] Finished at: Wed May 13 21:31:27 CEST 2009 45 | [INFO] Final Memory: 14M/218M 46 | [INFO] ------------------------------------------------------------------------ 47 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/mvn-rpm.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | [INFO] Scanning for projects... 18 | [INFO] 19 | [INFO] ------------------------------------------------------------------------ 20 | [INFO] Building Hudson Solaris Package 1.0-SNAPSHOT 21 | [INFO] ------------------------------------------------------------------------ 22 | [INFO] 23 | [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ basic --- 24 | [INFO] 25 | [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ basic --- 26 | [debug] execute contextualize 27 | [INFO] Using 'UTF-8' encoding to copy filtered resources. 28 | [INFO] skip non existing resourceDirectory ~/unix/unix-handbook/src/main/docbook/examples/basic/src/main/resources 29 | [INFO] 30 | [INFO] --- unix-maven-plugin:1.0-alpha-5-SNAPSHOT:package-rpm (default-package-rpm) @ basic --- 31 | [INFO] Using "/tmp/vfs_cache" as temporary files store. 32 | [INFO] 33 | [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ basic --- 34 | [INFO] Installing ~/unix/unix-handbook/src/main/docbook/examples/basic/target/basic-1.0-SNAPSHOT.rpm to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.rpm 35 | [INFO] Installing ~/unix/unix-handbook/src/main/docbook/examples/basic/pom-rpm.xml to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.pom 36 | [INFO] ------------------------------------------------------------------------ 37 | [INFO] BUILD SUCCESS 38 | [INFO] ------------------------------------------------------------------------ 39 | [INFO] Total time: 12.908s 40 | [INFO] Finished at: Thu Apr 07 14:33:27 CEST 2011 41 | [INFO] Final Memory: 8M/81M 42 | [INFO] ------------------------------------------------------------------------ 43 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/mvn-zip.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | [INFO] Scanning for projects... 18 | [INFO] 19 | [INFO] ------------------------------------------------------------------------ 20 | [INFO] Building Hudson Solaris Package 1.0-SNAPSHOT 21 | [INFO] ------------------------------------------------------------------------ 22 | [INFO] 23 | [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ basic --- 24 | [INFO] 25 | [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ basic --- 26 | [debug] execute contextualize 27 | [INFO] Using 'UTF-8' encoding to copy filtered resources. 28 | [INFO] skip non existing resourceDirectory ~/unix/unix-handbook/src/main/docbook/examples/basic/src/main/resources 29 | [INFO] 30 | [INFO] --- unix-maven-plugin:1.0-alpha-5-SNAPSHOT:package-zip (default-package-zip) @ basic --- 31 | [INFO] Using "/tmp/vfs_cache" as temporary files store. 32 | [INFO] 33 | [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ basic --- 34 | [INFO] Installing ~/unix/unix-handbook/src/main/docbook/examples/basic/target/basic-1.0-SNAPSHOT.zip to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.zip 35 | [INFO] Installing ~/unix/unix-handbook/src/main/docbook/examples/basic/pom-zip.xml to ~/.m2/repository/com.stratio.mojo.unix/example/basic/1.0-SNAPSHOT/basic-1.0-SNAPSHOT.pom 36 | [INFO] ------------------------------------------------------------------------ 37 | [INFO] BUILD SUCCESS 38 | [INFO] ------------------------------------------------------------------------ 39 | [INFO] Total time: 7.099s 40 | [INFO] Finished at: Thu Apr 07 14:33:37 CEST 2011 41 | [INFO] Final Memory: 8M/81M 42 | [INFO] ------------------------------------------------------------------------ 43 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/mvn.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | [INFO] Scanning for projects... 18 | [INFO] ------------------------------------------------------------------------ 19 | [INFO] Building Hudson Solaris Package 20 | [INFO] task-segment: [clean, install] 21 | [INFO] ------------------------------------------------------------------------ 22 | [INFO] [clean:clean] 23 | [INFO] Deleting directory /home/tla/dev/unix/src/examples/basic-pkg/target 24 | [INFO] [resources:resources] 25 | [INFO] Using default encoding to copy filtered resources. 26 | [INFO] [unix:package-pkg] 27 | . 28 | opt 29 | hudson 30 | doc 31 | atom-license.txt 32 | dc-license.txt 33 | hudson.war 34 | var 35 | log 36 | hudson 37 | 38 | [INFO] [install:install] 39 | [INFO] Installing /home/tla/dev/unix/src/examples/basic-pkg/target/basic-pkg-1.0-SNAPSHOT.pkg to /home/tla/.m2/repository/com.stratio.mojo.unix/example/basic-pkg/1.0-SNAPSHOT/basic-pkg-1.0-SNAPSHOT.pkg 40 | [INFO] ------------------------------------------------------------------------ 41 | [INFO] BUILD SUCCESSFUL 42 | [INFO] ------------------------------------------------------------------------ 43 | [INFO] Total time: 4 seconds 44 | [INFO] Finished at: Thu Apr 30 18:15:28 CEST 2009 45 | [INFO] Final Memory: 10M/18M 46 | [INFO] ------------------------------------------------------------------------ 47 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/pkginfo.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ pkginfo -l -d target/basic-*.pkg 18 | PKGINST: basic 19 | NAME: Hudson 20 | CATEGORY: application 21 | ARCH: all 22 | VERSION: 1.0-20090513.193125 23 | PSTAMP: 20090513.193125 24 | EMAIL: support@acme.org 25 | STATUS: spooled 26 | FILES: 11 spooled pathnames 27 | 5 directories 28 | 2 setuid/setgid executables 29 | 2 package information files 30 | 40286 blocks used (approx) 31 | 32 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/rpm-qlp.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ rpm -q -l -p target/basic-*.rpm 18 | /opt 19 | /opt/hudson 20 | /opt/hudson/doc 21 | /opt/hudson/doc/atom-license.txt 22 | /opt/hudson/doc/dc-license.txt 23 | /opt/hudson/hudson.war 24 | /var 25 | /var/log 26 | /var/log/hudson 27 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/rpm-qvlp.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ rpm -q -v -l -p target/basic-*.rpm 18 | drwxr-xr-x 2 root root 0 Apr 7 14:33 /opt 19 | drwxr-xr-x 2 root root 0 Apr 7 14:33 /opt/hudson 20 | drwxr-xr-x 2 root root 0 Apr 7 14:33 /opt/hudson/doc 21 | -rw-r--r-- 1 root root 49 Oct 2 2008 /opt/hudson/doc/atom-license.txt 22 | -rw-r--r-- 1 root root 1544 Oct 2 2008 /opt/hudson/doc/dc-license.txt 23 | -rw-rw-rw- 1 hudson hudson 20623413 Sep 30 2010 /opt/hudson/hudson.war 24 | drwxr-xr-x 2 root root 0 Apr 7 14:33 /var 25 | drwxr-xr-x 2 root root 0 Apr 7 14:33 /var/log 26 | lrwxrwxrwx 1 root root 19 Apr 7 14:33 /var/log/hudson -> /var/opt/hudson/log 27 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/basic/unzip-l.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ unzip -l target/basic-*.zip 18 | Archive: target/basic-1.0-SNAPSHOT.zip 19 | Length Date Time Name 20 | -------- ---- ---- ---- 21 | 0 04-07-11 14:33 ./opt/ 22 | 0 04-07-11 14:33 ./opt/hudson/ 23 | 0 04-07-11 14:33 ./opt/hudson/doc/ 24 | 49 10-02-08 02:07 ./opt/hudson/doc/atom-license.txt 25 | 1544 10-02-08 02:07 ./opt/hudson/doc/dc-license.txt 26 | 20623413 09-30-10 10:12 ./opt/hudson/hudson.war 27 | -------- ------- 28 | 20625006 6 files 29 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/hudson-jetty/pkginfo.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | START SNIPPET: pkginfo 18 | $ pkginfo -l -d target/hudson-jetty-pkg-*.pkg 19 | PKGINST: hudson-jetty-pkg 20 | NAME: Hudson Solaris Package 21 | CATEGORY: application 22 | ARCH: all 23 | VERSION: 1.0-20090501.224326 24 | PSTAMP: 20090501.224326 25 | EMAIL: support@acme.org 26 | STATUS: spooled 27 | FILES: 142 spooled pathnames 28 | 30 directories 29 | 1 setuid/setgid executables 30 | 2 package information files 31 | 63038 blocks used (approx) 32 | 33 | END SNIPPET: pkginfo 34 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/hudson-jetty/src/main/unix/files/opt/hudson/etc/jetty-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | /hudson 25 | /opt/hudson/lib/hudson.war 26 | 27 | true 28 | false 29 | 30 | 31 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/pkgchk.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ pkgchk -l -d target/basic-*.pkg all 18 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/pkginfo.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ pkginfo -l -d target/basic-*.pkg 18 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/rpm-qlp.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ rpm -q -l -p target/basic-*.rpm 18 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/rpm-qvlp.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ rpm -q -v -l -p target/basic-*.rpm 18 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/run-basic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2008 Stratio (http://stratio.com) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | set -x 20 | 21 | cd `dirname $0`/basic 22 | 23 | if [ -z "${MVN}" ] 24 | then 25 | MVN=mvn 26 | fi 27 | 28 | SED1="s,\(.*Installing\) /[a-zA-Z/\.-]*\(/unix/.*\),\1 ~\2,g" 29 | SED2="s,\(.*to\) /[a-z]*/[a-z]*\(.*\),\1 ~\2,g" 30 | SED3="s,\(.*resourceDirectory\) /[a-zA-Z/\.-]*\(/unix/.*\),\1 ~\2,g" 31 | 32 | if [ -x "`which pkgchk 2>/dev/null`" ] 33 | then 34 | rm -rf target 35 | "${MVN}" -Dencoding=UTF-8 -f pom-pkg.xml clean install | 36 | sed -e "${SED1}" -e "${SED2}" -e "${SED3}" \ 37 | > mvn-pkg.txt 2>&1 38 | 39 | cmd="pkgchk -l -d target/basic-*.pkg all" 40 | echo "$ $cmd" > pkgchk.txt 41 | $cmd | \ 42 | sed "s,\(.*> from\) <.*\(/target/.*\),\1\n <..\2,g" \ 43 | >> pkgchk.txt 44 | 45 | cmd="pkginfo -l -d target/basic-*.pkg" 46 | echo "$ $cmd" > pkginfo.txt 47 | $cmd >> pkginfo.txt 48 | fi 49 | 50 | if [ -x "`which rpmbuild 2>/dev/null`" ] 51 | then 52 | rm -rf target 53 | "${MVN}" -Dencoding=UTF-8 -f pom-rpm.xml clean install | 54 | sed -e "${SED1}" -e "${SED2}" -e "${SED3}" \ 55 | > mvn-rpm.txt 2>&1 56 | 57 | cmd="rpm -q -v -l -p target/basic-*.rpm" 58 | echo "$ $cmd" > rpm-qvlp.txt 59 | $cmd >> rpm-qvlp.txt 60 | 61 | cmd="rpm -q -l -p target/basic-*.rpm" 62 | echo "$ $cmd" > rpm-qlp.txt 63 | $cmd >> rpm-qlp.txt 64 | fi 65 | 66 | if [ -x "`which dpkg-deb 2>/dev/null`" ] 67 | then 68 | rm -rf target 69 | "${MVN}" -Dencoding=UTF-8 -f pom-deb.xml clean install | 70 | sed -e "${SED1}" -e "${SED2}" -e "${SED3}" \ 71 | > mvn-deb.txt 2>&1 72 | 73 | cmd="dpkg-deb -c target/*.deb" 74 | echo "$ $cmd" > dpkg-deb-c.txt 75 | $cmd >> dpkg-deb-c.txt 76 | 77 | cmd="dpkg-deb -f target/*.deb" 78 | echo "$ $cmd" > dpkg-deb-f.txt 79 | $cmd >> dpkg-deb-f.txt 80 | fi 81 | exit 82 | rm -rf target 83 | "${MVN}" -Dencoding=UTF-8 -f pom-zip.xml clean install | 84 | sed -e "${SED1}" -e "${SED2}" -e "${SED3}" \ 85 | > mvn-zip.txt 2>&1 86 | 87 | cmd="unzip -l target/basic-*.zip" 88 | echo "$ $cmd" > unzip-l.txt 89 | $cmd >> unzip-l.txt 90 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/run-hudson-jetty-pkg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2008 Stratio (http://stratio.com) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | 19 | set -x 20 | 21 | cd hudson-jetty-pkg 22 | 23 | mvn -Dmaven.unix.debug=true clean install > mvn.txt 24 | cmd="pkgchk -l -d target/hudson-jetty-pkg-*.pkg all" 25 | echo "$ $cmd" > pkgchk.txt 26 | $cmd | \ 27 | sed "s,\(.*> from <\).*\(/target/.*\),\1..\2,g" \ 28 | >> pkgchk.txt 29 | 30 | cmd="pkginfo -l -d target/hudson-jetty-pkg-*.pkg" 31 | echo "$ $cmd" > pkginfo.txt 32 | $cmd >> pkginfo.txt 33 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/examples/unzip-l.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2008 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | $ unzip -l target/basic-*.zip 18 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/format.xsl: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/generate-id.xsl: -------------------------------------------------------------------------------- 1 | 18 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/handbook-fo.xsl: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | wrap 29 | \ 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | inherit 39 | 40 | 41 | 42 | 43 | 44 | keyword 45 | 46 | 47 | 48 | 49 | 50 | 51 | anything 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/handbook-html-chunked.xsl: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/handbook-html-single.xsl: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/identity.xsl: -------------------------------------------------------------------------------- 1 | 18 | 23 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /unix-handbook/src/main/docbook/process.xsl: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | in version 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 53 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /unix-handbook/src/site/resources/css/mojo-docbook.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2008 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | body, td, select, input, li { 17 | font-family: Verdana, Helvetica, Arial, sans-serif; 18 | font-size: 13px; 19 | } 20 | 21 | code { 22 | font-family: Courier, monospace; 23 | font-size: 13px; 24 | } 25 | 26 | /* Copied from .source from maven-theme.css:109 and maven-base.css:136 */ 27 | .programlisting, .screen, .literallayout { 28 | border: 1px solid #999999; 29 | margin: 1em 7px; 30 | padding: 12px; 31 | } 32 | 33 | div.literallayout > p { 34 | margin: 0; 35 | } 36 | 37 | .preface > table { 38 | border: 0; 39 | } 40 | 41 | .preface > td { 42 | border: 0; 43 | } 44 | 45 | .preface > th { 46 | background-color: #BBBBBB; 47 | color: white; 48 | font-weight: bold; 49 | border: 0; 50 | /* text-align: left; */ 51 | } 52 | 53 | /* Copies the 'a' table row class */ 54 | .preface > tr { 55 | background-color: #DDDDDD; 56 | } 57 | 58 | /* 59 | * These are taken from maven-theme 60 | */ 61 | 62 | /* Docbook: added h1 here, used for */ 63 | h1, h2 { 64 | background-color: #DDDDDD; 65 | border: 1px solid #999999; 66 | color: #990000; 67 | font-size: x-large; 68 | font-weight: 900; 69 | padding: 4px 4px 4px 6px; 70 | } 71 | 72 | h3 { 73 | background-color: #EEEEEE; 74 | border: 1px solid #AAAAAA; 75 | color: #990000; 76 | font-size: large; 77 | font-weight: normal; 78 | padding: 4px 4px 4px 6px; 79 | } 80 | 81 | h4 { 82 | background-color: #FFFFFF; 83 | border: 1px solid #BBBBBB; 84 | color: #990000; 85 | font-size: large; 86 | font-weight: normal; 87 | padding: 4px 4px 4px 6px; 88 | } 89 | 90 | h5 { 91 | color: #990000; 92 | padding: 4px 4px 4px 6px; 93 | } 94 | 95 | p { 96 | font-size: small; 97 | line-height: 1.3em; 98 | } 99 | 100 | -------------------------------------------------------------------------------- /unix-handbook/xslthl-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/README.txt: -------------------------------------------------------------------------------- 1 | == jetty == 2 | 3 | o Shows how to depend on a ZIP file. 4 | o Shows how to create a package in multiple formats. 5 | o Uses default settings for the file and directory objects. 6 | o Shows format-specific configuration elements ( and ). 7 | o Shows how to deliver empty directories. 8 | 9 | == test-{deb,pkg,rpm}-1 == 10 | 11 | o Maven project with packaging={deb,pkg,rpm}. The project delivers the Hudson web application as its primary artifact. 12 | o Packages the Hudson WAR file as the "hudson" user. 13 | o Shows how to depend on a WAR file. 14 | 15 | == test-{deb,pkg,rpm}-2 == 16 | 17 | o Maven project with packaging={deb,pkg,rpm}. The project delivers the Hudson slave JAR file as its primary artifact. 18 | o Extracts the Hudson slave.jar and the licenses. The files are installed with "hudson" as owner. 19 | o Shows how to depend on a WAR file. 20 | 21 | == test-{deb,pkg,rpm}-3 == 22 | 23 | o Maven project with packaging={deb,pkg,rpm}. The project delivers two packages of the same format. The default 24 | is similar to test-{..}-1 and the client is similar to test-{..}-2. 25 | o Shows how to depend on a WAR file. 26 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/files/opt/jetty/README-unix.txt: -------------------------------------------------------------------------------- 1 | I'm a README, hooray for me! 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/files/opt/jetty/bin/extra-app: -------------------------------------------------------------------------------- 1 | extra-app 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/common/post-install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Jetty Installed" 3 | 4 | common_post_install() { 5 | chown -R jetty:adm /var/opt/jetty/cache /var/opt/jetty/log /var/opt/jetty/lib 6 | chmod 750 /var/opt/jetty/log 7 | } 8 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/common/post-remove: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Jetty Removed" 3 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/common/pre-install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Installing Jetty" 3 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/common/pre-remove: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Removing Jetty" 3 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/dpkg/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | case "$1" in 6 | configure) 7 | if ! id jetty > /dev/null 2>&1 ; then 8 | adduser --system --home /usr/share/jetty7 --no-create-home \ 9 | --ingroup nogroup --disabled-password --shell /bin/false \ 10 | jetty 11 | fi 12 | 13 | common_post_install 14 | ;; 15 | 16 | abort-upgrade|abort-remove|abort-deconfigure) 17 | ;; 18 | 19 | *) 20 | echo "$0 called with unknown argument \`$1'" >&2 21 | exit 1 22 | ;; 23 | esac 24 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/dpkg/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # Remove cached files 6 | rm -rf /var/cache/jetty7/* 7 | 8 | case "$1" in 9 | purge) 10 | userdel jetty || true 11 | rm -rf /var/log/jetty7 12 | ;; 13 | 14 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 15 | # Nothing to do here 16 | ;; 17 | 18 | *) 19 | echo "$0 called with unknown argument \`$1'" >&2 20 | exit 1 21 | ;; 22 | esac 23 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/dpkg/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # summary of how this script can be called: 6 | # * `install' 7 | # * `install' 8 | # * `upgrade' 9 | # * `abort-upgrade' 10 | # 11 | # for details, see http://www.debian.org/doc/debian-policy/ or 12 | # the debian-policy package 13 | 14 | case "$1" in 15 | upgrade) 16 | ;; 17 | 18 | install|upgrade) 19 | ;; 20 | 21 | abort-upgrade) 22 | ;; 23 | 24 | *) 25 | echo "preinst called with unknown argument \`$1'" >&2 26 | exit 1 27 | ;; 28 | esac 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/dpkg/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | # summary of how this script can be called: 6 | # * `remove' 7 | # * `upgrade' 8 | # * `failed-upgrade' 9 | # * `remove' `in-favour' 10 | # * `deconfigure' `in-favour' 11 | # `removing' 12 | # 13 | # for details, see http://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | case "$1" in 17 | remove|upgrade|deconfigure) 18 | ;; 19 | 20 | failed-upgrade) 21 | ;; 22 | 23 | *) 24 | echo "prerm called with unknown argument \`$1'" >&2 25 | exit 1 26 | ;; 27 | esac 28 | 29 | exit 0 30 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/jetty/src/main/unix/scripts/pkg/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | common_post_install 4 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-deb-1/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-deb-1/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import com.stratio.mojo.unix.maven.plugin.Timestamps 17 | 18 | new Timestamps(basedir).deb1.setTimestamps() 19 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-deb-1/src/main/unix/files/opt/hudson/etc/config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003 Stratio (http://stratio.com) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | version=${project.version} 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-deb-2/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-deb-2/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import static fj.data.Option.none 17 | import static fj.data.Option.some 18 | import com.stratio.mojo.unix.FileAttributes 19 | import static com.stratio.mojo.unix.UnixFileMode.fromString 20 | import com.stratio.mojo.unix.UnixFsObject 21 | import static com.stratio.mojo.unix.UnixFsObject.directory 22 | import static com.stratio.mojo.unix.UnixFsObject.regularFile 23 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.START_OF_TIME 24 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.assertDebEntries 25 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.assertFormat 26 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.r 27 | 28 | boolean success = true 29 | 30 | assertFormat "deb", "dpkg-deb", true, { 31 | File deb = new File(System.getProperty("user.home"), ".m2/repository/bar/project-deb-2/1.1-2/project-deb-2-1.1-2.deb") 32 | 33 | FileAttributes dirAttributes = new FileAttributes(none(), none(), some(fromString("rwxr-xr-x"))); 34 | FileAttributes hudsonWarAttributes = new FileAttributes(none(), none(), some(fromString("rw-r--r--"))); 35 | 36 | success &= assertDebEntries(deb, (List)[ 37 | directory(r("."), START_OF_TIME, dirAttributes), 38 | directory(r("usr"), START_OF_TIME, dirAttributes), 39 | directory(r("usr/share"), START_OF_TIME, dirAttributes), 40 | directory(r("usr/share/hudson"), START_OF_TIME, dirAttributes), 41 | directory(r("usr/share/hudson/lib"), START_OF_TIME, dirAttributes), 42 | regularFile(r("usr/share/hudson/lib/slave.jar"), START_OF_TIME, 158615, hudsonWarAttributes), 43 | directory(r("usr/share/hudson/license"), START_OF_TIME, dirAttributes), 44 | regularFile(r("usr/share/hudson/license/atom-license.txt"), START_OF_TIME, 49, hudsonWarAttributes), 45 | regularFile(r("usr/share/hudson/license/dc-license.txt"), START_OF_TIME, 1544, hudsonWarAttributes), 46 | ]) 47 | } 48 | 49 | return success 50 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-rpm-1/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-rpm-1/src/main/unix/files/opt/hudson/etc/config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003 Stratio (http://stratio.com) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | version=${project.version} 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-rpm-2/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-rpm-2/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.* 17 | import com.stratio.mojo.unix.rpm.RpmUtil 18 | import com.stratio.mojo.unix.rpm.SpecFile 19 | 20 | boolean success = true 21 | 22 | File rpm = findArtifact("bar", "project-rpm-2", "1.1-2", "rpm") 23 | 24 | success &= assertRpmEntries(rpm, [ 25 | new RpmUtil.FileInfo("/usr", "root", "root", "drwxr-xr-x", 0, null), 26 | new RpmUtil.FileInfo("/usr/share", "root", "root", "drwxr-xr-x", 0, null), 27 | new RpmUtil.FileInfo("/usr/share/hudson", "root", "root", "drwxr-xr-x", 0, null), 28 | new RpmUtil.FileInfo("/usr/share/hudson/lib", "root", "root", "drwxr-xr-x", 0, null), 29 | new RpmUtil.FileInfo("/usr/share/hudson/lib/slave.jar", "hudson", "hudson", "-r--r--r--", 158615, null), 30 | new RpmUtil.FileInfo("/usr/share/hudson/license", "root", "root", "drwxr-xr-x", 0, null), 31 | new RpmUtil.FileInfo("/usr/share/hudson/license/atom-license.txt", "nobody", "nobody", "-r--r--r--", 49, null), 32 | new RpmUtil.FileInfo("/usr/share/hudson/license/dc-license.txt", "nobody", "nobody", "-r--r--r--", 1544, null), 33 | ]) 34 | 35 | specFile = new SpecFile() 36 | specFile.name = "project-rpm-2" 37 | specFile.version = "1.1_2" 38 | specFile.release = 1 39 | specFile.summary = "RPM 2" 40 | specFile.license = "BSD" 41 | specFile.group = "Application/Collectors" 42 | 43 | success &= assertRelaxed(specFile, RpmUtil.getSpecFileFromRpm(rpm), specFileEqual); 44 | 45 | return success 46 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-rpm-3/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.* 17 | import static com.stratio.mojo.unix.sysvpkg.PkgchkUtil.* 18 | import com.stratio.mojo.unix.sysvpkg.Pkginfo 19 | import com.stratio.mojo.unix.sysvpkg.PkginfoUtil 20 | import static fj.data.Option.* 21 | import fj.data.Option 22 | import org.joda.time.LocalDateTime 23 | 24 | Option ldtNone = Option.none() 25 | 26 | boolean success = true 27 | 28 | File pkg = new File((File) basedir, "target/project-sysvpkg-1-1.1-2.pkg") 29 | 30 | pkginfo = new Pkginfo("all", "application", "Hudson", "project-sysvpkg-1", "1.1-2"). 31 | email(some("trygvis@inamo.no")) 32 | 33 | success &= assertRelaxed(pkginfo, PkginfoUtil.getPackageInfoForDevice(pkg).some(), packageInfoEqual); 34 | 35 | // Ignore dates for now 36 | success &= assertSysvPkgEntries(pkg, [ 37 | directory("/opt", "17777777777", "?", "?", ldtNone), 38 | directory("/opt/hudson", "0755", "nobody", "nogroup", ldtNone), 39 | regularFile("/opt/hudson/hudson.war", "0666", "hudson", "hudson", 20623413, 3301, ldtNone), 40 | directory("/usr", "17777777777", "?", "?", ldtNone), 41 | directory("/usr/share", "0755", "nobody", "nogroup", ldtNone), 42 | directory("/usr/share/hudson", "0755", "nobody", "nogroup", ldtNone), 43 | regularFile("/usr/share/hudson/README.txt", "0644", "nobody", "nogroup", 41, 3746, ldtNone), 44 | directory("/var", "17777777777", "?", "?", ldtNone), 45 | directory("/var/log", "0755", "nobody", "nogroup", ldtNone), 46 | symlink("/var/log/hudson", "/var/opt/hudson/log"), 47 | installationFile("checkinstall", 28, 2563, ldtNone), 48 | installationFile("compver", 0, 0, ldtNone), 49 | installationFile("copyright", 24, 2150, ldtNone), 50 | installationFile("depend", 0, 0, ldtNone), 51 | installationFile("pkginfo", 157, 0, ldtNone), 52 | installationFile("request", 46, 4055, ldtNone), 53 | installationFile("space", 0, 0, ldtNone), 54 | ]) 55 | 56 | return success 57 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/checkinstall: -------------------------------------------------------------------------------- 1 | echo "Checkinstall running" 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/compver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/compver -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/copyright: -------------------------------------------------------------------------------- 1 | I'm a copyright message 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/depend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/depend -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/request: -------------------------------------------------------------------------------- 1 | echo "Requesting something! (no, not really)" 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/space: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stratio/unix-maven-plugin/e93e00a92ce320f1aca9974fc464f8ce318a71a5/unix-maven-plugin/src/it/test-sysvpkg-1/src/main/unix/scripts/space -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-2/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-2/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.* 17 | import static com.stratio.mojo.unix.sysvpkg.PkgchkUtil.* 18 | import com.stratio.mojo.unix.sysvpkg.Pkginfo 19 | import com.stratio.mojo.unix.sysvpkg.PkginfoUtil 20 | import fj.data.Option 21 | import org.joda.time.LocalDateTime 22 | 23 | Option ldtNone = Option.none() 24 | 25 | boolean success = true 26 | 27 | File pkg = new File((File) basedir, "target/project-sysvpkg-2-1.1-2.pkg") 28 | 29 | success &= assertRelaxed( 30 | new Pkginfo( "all", "application", "Hudson Slave", "project-sysvpkg-2", "1.1-2"), 31 | PkginfoUtil.getPackageInfoForDevice(pkg).some(), packageInfoEqual); 32 | 33 | success &= assertSysvPkgEntries(pkg, [ 34 | directory("/usr", "17777777777", "?", "?", ldtNone), 35 | directory("/usr/share", "0755", "nobody", "nogroup", ldtNone), 36 | directory("/usr/share/hudson", "0755", "nobody", "nogroup", ldtNone), 37 | directory("/usr/share/hudson/lib", "0755", "nobody", "nogroup", ldtNone), 38 | regularFile("/usr/share/hudson/lib/slave.jar", "0644", "nobody", "nogroup", 158615, 48565, ldtNone), 39 | directory("/usr/share/hudson/license", "0755", "nobody", "nogroup", ldtNone), 40 | regularFile("/usr/share/hudson/license/atom-license.txt", "0644", "nobody", "nogroup", 49, 4473, ldtNone), 41 | regularFile("/usr/share/hudson/license/dc-license.txt", "0644", "nobody", "nogroup", 1544, 59072, ldtNone), 42 | installationFile("pkginfo", 159, 0, ldtNone), 43 | ]) 44 | return success 45 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/src/main/unix/files-default/usr/share/hudson/server/README.txt: -------------------------------------------------------------------------------- 1 | usr/share/hudson/server/README.txt 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/src/main/unix/files-slave/usr/share/hudson/slave/README.txt: -------------------------------------------------------------------------------- 1 | usr/share/hudson/slave/README.txt 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/src/main/unix/files/usr/share/hudson/LICENSE-downstream.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | licenses suck! 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/src/main/unix/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Slave postinstall" 4 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/src/main/unix/scripts/postinstall-default: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Default postinstall" 4 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-3/src/main/unix/scripts/postinstall-slave: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Common postinstall" 4 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-classes/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-classes/pom4test.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 4.0.0 21 | 22 | com.stratio.mojo.unix 23 | unix 24 | @project.version@ 25 | 26 | bar 27 | project-sysvpkg-classes 28 | 1.1 29 | sysvpkg 30 | Hudson 31 | 32 | 33 | 34 | 35 | org.jvnet.hudson.main 36 | hudson-war 37 | 1.255 38 | war 39 | 40 | 41 | 42 | 43 | 44 | com.stratio.mojo.unix 45 | unix-maven-plugin 46 | @project.version@ 47 | true 48 | 49 | Trygve Laugstol 50 | 1024 51 | trygvis@inamo.no 52 | 53 | none, smf 54 | 55 | 56 | 57 | org.jvnet.hudson.main:hudson-war:war 58 | /opt/hudson/hudson.war 59 | 60 | 61 | src/main/unix/files-smf 62 | /var/lib 63 | 64 | class:smf 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-classes/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.* 17 | import static com.stratio.mojo.unix.sysvpkg.PkgchkUtil.* 18 | import com.stratio.mojo.unix.sysvpkg.PkginfoUtil 19 | import fj.data.Option 20 | import org.joda.time.LocalDateTime 21 | import com.stratio.mojo.unix.sysvpkg.Pkginfo; 22 | 23 | Option ldtNone = Option.none() 24 | 25 | boolean success = true 26 | 27 | File pkg = new File((File) basedir, "target/project-sysvpkg-classes-1.1.pkg") 28 | 29 | success &= assertRelaxed( 30 | new Pkginfo("all", "application", "Hudson", "project-sysvpkg-classes", "1.1"), 31 | PkginfoUtil.getPackageInfoForDevice(pkg).some(), packageInfoEqual); 32 | 33 | // Ignore dates for now 34 | success &= assertSysvPkgEntries(pkg, [ 35 | directory("/opt", "17777777777", "?", "?", ldtNone), 36 | directory("/opt/hudson", "0755", "nobody", "nogroup", ldtNone), 37 | regularFile("/opt/hudson/hudson.war", "0644", "nobody", "nogroup", 20623413, 3301, ldtNone), 38 | directory("/var", "17777777777", "?", "?", ldtNone), 39 | directory("/var/lib", "0755", "nobody", "nogroup", ldtNone), 40 | regularFile("/var/lib/app-method", "0644", "nobody", "nogroup", 30, 2290, ldtNone), 41 | regularFile("/var/lib/app-manifest.xml", "0644", "nobody", "nogroup", 36, 3285, ldtNone), 42 | installationFile("pkginfo", 161, 0, ldtNone), 43 | ]) 44 | 45 | return success 46 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-classes/src/main/unix/files-smf/app-manifest.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-sysvpkg-classes/src/main/unix/files-smf/app-method: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Hello World! 4 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install -Dmy-user-property=user-property 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import com.stratio.mojo.unix.maven.plugin.Timestamps 17 | 18 | import static com.stratio.mojo.unix.FileAttributes.EMPTY 19 | import static com.stratio.mojo.unix.UnixFsObject.directory 20 | import static com.stratio.mojo.unix.UnixFsObject.regularFile 21 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.* 22 | 23 | boolean success = true 24 | 25 | def timestamps = new Timestamps(basedir).zip1 26 | 27 | File zip = findArtifact("bar", "project-zip-1", "1.1-2", "zip") 28 | 29 | success &= assertZipEntries(zip, [ 30 | directory(r("/opt"), START_OF_TIME, EMPTY), 31 | directory(r("/opt/hudson"), START_OF_TIME, EMPTY), 32 | regularFile(r("/opt/hudson/hudson.war"), timestamps.hudsonWarTimestamp.timestamp, 20623413, EMPTY), 33 | 34 | directory(r("/opt/hudson/etc"), START_OF_TIME, EMPTY), 35 | regularFile(r("/opt/hudson/etc/filter-1.conf"), timestamps.filter1.timestamp, 237, EMPTY), 36 | regularFile(r("/opt/hudson/etc/filter-2.conf"), timestamps.filter2.timestamp, 88, EMPTY), 37 | regularFile(r("/opt/hudson/etc/filter-all.conf"), timestamps.filterAll.timestamp, 157, EMPTY), 38 | regularFile(r("/opt/hudson/etc/unfiltered.properties"), timestamps.unfiltered.timestamp, 27, EMPTY), 39 | ]) 40 | 41 | return success 42 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import com.stratio.mojo.unix.maven.plugin.Timestamps 17 | 18 | new Timestamps(basedir).zip1.setTimestamps() 19 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/src/main/unix/files/opt/hudson/etc/filter-1.conf: -------------------------------------------------------------------------------- 1 | # Property specified in the project 2 | my-property=${my-property} 3 | 4 | # Property specified on the command line with -D 5 | my-user-property=${my-user-property} 6 | 7 | # System property. This is the most constant system property I could find. 8 | java.class.version=${java.class.version} 9 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/src/main/unix/files/opt/hudson/etc/filter-2.conf: -------------------------------------------------------------------------------- 1 | simple-regex=MY_PLACEHOLDER 2 | 3 | # This should not be expanded 4 | project.version=${project.version} 5 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/src/main/unix/files/opt/hudson/etc/filter-all.conf: -------------------------------------------------------------------------------- 1 | # This file is included in all 2 | # The ${double-test} will be expanded from the in the pom, and again with a regex 3 | double-test=${double-test} 4 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-1/src/main/unix/files/opt/hudson/etc/unfiltered.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003 Stratio (http://stratio.com) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | version=${project.version} 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-2/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-2/postbuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import static com.stratio.mojo.unix.maven.plugin.ShittyUtil.* 17 | import static com.stratio.mojo.unix.FileAttributes.* 18 | import static com.stratio.mojo.unix.UnixFsObject.* 19 | import org.joda.time.*; 20 | 21 | boolean success = true 22 | 23 | File zip = findArtifact("bar", "project-zip-2", "1.1-2", "zip") 24 | 25 | ts = new LocalDateTime(2008, 10, 2, 2, 7, 36) 26 | 27 | success &= assertZipEntries(zip, [ 28 | directory(r("/usr"), START_OF_TIME, EMPTY), 29 | directory(r("/usr/share"), START_OF_TIME, EMPTY), 30 | directory(r("/usr/share/hudson"), START_OF_TIME, EMPTY), 31 | directory(r("/usr/share/hudson/lib"), START_OF_TIME, EMPTY), 32 | regularFile(r("/usr/share/hudson/lib/slave.jar"), ts, 158615, EMPTY), 33 | directory(r("/usr/share/hudson/license"), START_OF_TIME, EMPTY), 34 | regularFile(r("/usr/share/hudson/license/atom-license.txt"), ts, 49, EMPTY), 35 | regularFile(r("/usr/share/hudson/license/dc-license.txt"), ts, 1544, EMPTY), 36 | ]) 37 | return success 38 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-3/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-3/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import com.stratio.mojo.unix.maven.plugin.Timestamps 17 | 18 | new Timestamps(basedir).zip3.setTimestamps() 19 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-3/src/main/unix/files-default/usr/share/hudson/server/README.txt: -------------------------------------------------------------------------------- 1 | usr/share/hudson/server/README.txt 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-3/src/main/unix/files-slave/usr/share/hudson/slave/README.txt: -------------------------------------------------------------------------------- 1 | usr/share/hudson/slave/README.txt 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/test-zip-3/src/main/unix/files/usr/share/hudson/LICENSE-downstream.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | licenses suck! 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/unix-from-jar-project/goals.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | -e -Dmaven.unix.debug=true clean install 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/unix-from-jar-project/my-native.so: -------------------------------------------------------------------------------- 1 | I'm native, go away. 2 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/unix-from-jar-project/prebuild.groovy: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | ant.exec(command: 'mvn install:install-file -o ' + 17 | '-DgroupId=com.stratio.mojo.unix.it ' + 18 | '-DartifactId=my-native ' + 19 | '-Dversion=1.0 ' + 20 | '-Dclassifier=${os.name}-${os.version}-${os.arch} ' + 21 | '-Dpackaging=so ' + 22 | '-Dfile=my-native.so ' + 23 | '-DgeneratePom') 24 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/unix-from-jar-project/src/main/java/unix/Hello.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package unix; 17 | 18 | public class Hello 19 | { 20 | public static void main( String[] args ) 21 | { 22 | System.out.println( "Hello World!" ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/it/web-runner/src/main/java/WebRunner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | class WebRunner 17 | { 18 | public static void main( String[] args ) 19 | { 20 | System.out.println("Hello world!"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/main/java/com/stratio/mojo/unix/maven/deb/DebPackagingFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.maven.deb; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import org.apache.maven.plugin.logging.*; 43 | import com.stratio.mojo.unix.maven.plugin.*; 44 | 45 | /** 46 | * @author Trygve Laugstøl 47 | */ 48 | public class DebPackagingFormat 49 | extends PackagingFormat 50 | { 51 | public DebUnixPackage start(Log log) 52 | { 53 | return new DebUnixPackage(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/main/java/com/stratio/mojo/unix/maven/plugin/Regex.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.maven.plugin; 17 | 18 | import com.stratio.mojo.unix.*; 19 | 20 | public class Regex 21 | { 22 | public String pattern; 23 | public String replacement; 24 | 25 | public UnixFsObject.Replacer toReplacer() 26 | { 27 | return new UnixFsObject.Replacer( pattern, replacement); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/main/java/com/stratio/mojo/unix/maven/plugin/UnknownArtifactException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.maven.plugin; 17 | 18 | import org.apache.maven.artifact.*; 19 | 20 | import java.util.*; 21 | 22 | /** 23 | * @author Trygve Laugstøl 24 | */ 25 | public class UnknownArtifactException 26 | extends Exception 27 | { 28 | public final String artifact; 29 | 30 | public final Map artifactMap; 31 | 32 | public UnknownArtifactException( String artifact, Map artifactMap ) 33 | { 34 | this.artifact = artifact; 35 | this.artifactMap = artifactMap; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/main/java/com/stratio/mojo/unix/maven/rpm/RpmPackagingFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.maven.rpm; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import org.apache.maven.plugin.logging.*; 43 | import com.stratio.mojo.unix.maven.plugin.*; 44 | 45 | /** 46 | * @author Trygve Laugstøl 47 | */ 48 | public class RpmPackagingFormat 49 | extends PackagingFormat 50 | { 51 | public RpmUnixPackage start( Log log ) 52 | { 53 | return new RpmUnixPackage(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/main/java/com/stratio/mojo/unix/maven/sysvpkg/SysvPkgPackagingFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.maven.sysvpkg; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import org.apache.maven.plugin.logging.*; 43 | import com.stratio.mojo.unix.maven.plugin.*; 44 | 45 | /** 46 | * @author Trygve Laugstøl 47 | */ 48 | public class SysvPkgPackagingFormat 49 | extends PackagingFormat 50 | { 51 | public PkgUnixPackage start( Log log ) 52 | { 53 | return new PkgUnixPackage(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/main/java/com/stratio/mojo/unix/maven/zip/ZipPackagingFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2003 Stratio (http://stratio.com) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.stratio.mojo.unix.maven.zip; 17 | 18 | /* 19 | * The MIT License 20 | * 21 | * Copyright 2009 The Codehaus. 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 24 | * this software and associated documentation files (the "Software"), to deal in 25 | * the Software without restriction, including without limitation the rights to 26 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 27 | * of the Software, and to permit persons to whom the Software is furnished to do 28 | * so, subject to the following conditions: 29 | * 30 | * The above copyright notice and this permission notice shall be included in all 31 | * copies or substantial portions of the Software. 32 | * 33 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 34 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 35 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 36 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 37 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 | * SOFTWARE. 40 | */ 41 | 42 | import org.apache.maven.plugin.logging.*; 43 | import com.stratio.mojo.unix.maven.plugin.*; 44 | 45 | /** 46 | * @author Trygve Laugstøl 47 | */ 48 | public class ZipPackagingFormat 49 | extends PackagingFormat 50 | { 51 | public ZipUnixPackage start( Log log ) 52 | { 53 | return new ZipUnixPackage( log ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/test/resources/test-filtering/config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2003 Stratio (http://stratio.com) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | version=${project.version} 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/test/resources/zip/zip-1/dirs/bar.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | @bar@ 18 | -------------------------------------------------------------------------------- /unix-maven-plugin/src/test/resources/zip/zip-1/file/foo.txt: -------------------------------------------------------------------------------- 1 | ==== 2 | Copyright (C) 2003 Stratio (http://stratio.com) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ==== 16 | 17 | @foo@ 18 | -------------------------------------------------------------------------------- /unix-rpm/pom.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 4.0.0 27 | 28 | com.stratio.mojo.unix 29 | unix 30 | 1.3.0-SNAPSHOT 31 | 32 | unix-rpm 33 | Maven RPM Support 34 | 35 | 36 | joda-time 37 | joda-time 38 | 39 | 40 | ${project.groupId} 41 | unix-common 42 | ${project.version} 43 | 44 | 45 | org.codehaus.plexus 46 | plexus-utils 47 | 48 | 49 | org.functionaljava 50 | functionaljava 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /unix-sysv-pkg/pom.xml: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 4.0.0 27 | 28 | com.stratio.mojo.unix 29 | unix 30 | 1.3.0-SNAPSHOT 31 | 32 | unix-sysv-pkg 33 | Maven Sysv Pkg Support 34 | 35 | 36 | ${project.groupId} 37 | unix-common 38 | ${project.version} 39 | 40 | 41 | joda-time 42 | joda-time 43 | 44 | 45 | org.codehaus.plexus 46 | plexus-utils 47 | 48 | 49 | org.functionaljava 50 | functionaljava 51 | 52 | 53 | 54 | --------------------------------------------------------------------------------