본문 바로가기

카테고리 없음

Maven Assembly Zip Relative Path

Universal:package-bin Creates the zip universal package. Universal:package-zip-tarball Creates the tgz universal package. Universal:package-xz-tarball Creates the txz universal package. The xz command can get better compressionfor some types of archives. Universal:package-osx-dmg Creates the dmg universal package. This only work on OSX or systems with hdiutil.

Maven Assembly Zip Relative Path Location

Format

Universal-docs:package-bin Creates the zip universal documentation package. Universal-docs:package-zip-tarball Creates the tgz universal documentation package. Universal-docs:package-xz-tarball Creates the txz universal documentation package. The xz command can get better compressionfor some types of archives.

Getting Started with Universal PackagingBy default, all files found in the src/universal directory are included in the distribution. So, the first stepin creating a distribution is to place files in this directory and organize them as you’d like in them to be in the distributed package.If your output format is a zip file, for example, although the distribution will consist of just one zip file, the files and directories within that zip file will reflect the same organization and structure as src/universal.To add files generated by the build task to a distribution, simply add a mapping to the mappings in Universal setting. Let’slook at an example where we add the packaged jar of a project to the lib folder of a distribution. /usr/share//bin/cool-toollib/cool-tool.jarconf/cool-tool.conf/usr/bin/cool-tool - /usr/share//bin/cool-tool/etc/ - /usr/share//confThe mapGenericFilesToWindows will construct an MSI that installs the application in and includethe bin directory on Windows PATH environment variable (optionally disabled).While these mappings provide a great start to nice packaging, it stillmay be necessary to customize the native packaging for each platform. This can be done by configuring those settings directly.For example, even using generic mapping, debian has a requirement for changelog files to be fully formed. Using the above generic mapping, we can configure just thischangelog in addition to the generic packaging by first defining a changelog in src/debian/changelog and then adding the following setting.

Dir. is a method that creates a sequence of every file under a directory, including the directory itself.relativeTo returns a String that is the path relative to whatever you pass to it.dir.getParentFile returns the parent of dir. In this example, it’s the parent directory of whatever target is.pair is a method that takes a function and applies it to every file (in the sequence), and returns a (file, function-result) tuple.Putting it all together, this creates a map of every file under target/scala-2.10/api (including the directory target/scala-2.10/api itself)with a string that is the path to the parent of target. This is a mapping for every file and a string that tells the universal packager where it is located.For example:if target = /Users/you/dev/fantasticApp/src/scala/fantasticApp-0.1-HOTFIX01andfantasticApp-0.1-HOTFIX01/scala-2.10/api/ contains the files.

Zip

((/Users/you/dev/fantasticApp/src/scala/fantasticApp-0.1-HOTFIX01,fantasticApp-0.1-HOTFIX01),(/Users/you/dev/fantasticApp/src/scala/fantasticApp-0.1-HOTFIX01/README,fantasticApp-0.1-HOTFIX01/README),(//Users/you/dev/fantasticApp/src/scala/fantasticApp-0.1-HOTFIX01/somedata.csv,fantasticApp-0.1-HOTFIX01/somedata.csv))Note that the first item of each pair is the full path to where the file exists on the system /Users/you., and thesecond part is the just the path starting after./scala. That second part is what is returned from.relativeTo(dir.getParentFile).