The unzip adapter will locate an artifact by one of several built in rules, including the parameters provided in the URL and then extract the requested file from inside the ZIP file, which is the artifact.
![]() | ZIP File |
---|---|
This adapter only works on ZIP files. Some locator rules automatically filter out anything which is not a ZIP file. |
The base entry point to the unzip adapter is http://localhost:8080/unzip
.
The next element in the path must always be the “locator type”.
Everything after the locator type is specific to the locator implementation. However
the scheme should always follow the basic pattern of
http://localhost:8080/unzip/<locator>/param1/param2/path/to/file
.
So after the type comes the parameters specific to the type, following the be deep link
inside the ZIP file. This allows to easily build related URLs to the original path and
allows for relative linking between elements inside the ZIP file. This is required
for directly accessing a zipped P2 repository.
![]() | URL samples |
---|---|
The following URL samples will skip the base prefix |
Also see https://github.com/ctron/package-drone/wiki/Unzip-Adapter in the GitHub wiki.
This locator will only retrieve the specified artifact using the artifact ID.
The full URL scheme is /artifact/<artifactId>/path/to/file
The newest locator will simply look for the newest artifact in a channel.
The full URL scheme is /newest/<channelIdOrName>/path/to/file
The newest ZIP locator will simply look for the newest artifact in a channel which is a ZIP file.
The full URL scheme is /newestZip/<channelIdOrName>/path/to/file
This locator will search a channel for the newest artifact matching the provided name.
The full URL scheme is /newestByName/<channelIdOrName>/<name>/path/to/file
This locator uses maven specific metadata and has a few sub types of operation.
The base URL scheme is /maven/<subType>/<channelIdOrName>
![]() | Maven meta data |
---|---|
This locator requires maven metadata, which will only be present at the moment if the artifacts where deploy using the maven repository adapter and mvn deploy. |
This sub type will use the latest ZIP type artifact based on “Group ID” and “Artifact ID”. However it will not find any snapshot versions.
The full URL scheme is /maven/latest/<channelIdOrName>/<groupId>/<artifactId>/path/to/file
This sub type will use the latest ZIP type artifact based on “Group ID” and “Artifact ID”. It will not find any release versions.
The full URL scheme is /maven/latest-SNAPSHOT/<channelIdOrName>/<groupId>/<artifactId>/path/to/file
This sub type will search for the artifact with the perfect matching version and matching group id and artifact id. This can either be a release, snapshot or specific snapshot version. If there are several matching versions in the same channel, then the highest ranking according to maven will be used.
The full URL scheme is /maven/perfect/<channelIdOrName>/<groupId>/<artifactId>/<version>/path/to/file
This sub type will scan for a maven artifact with matching group id, artifact id and version prefix. If there are several matching versions in the same channel, then the highest ranking according to maven will be used.
The full URL scheme is /maven/prefixed/<channelIdOrName>/<groupId>/<artifactId>/<versionPrefix>/path/to/file
The version prefix is a string like 1.2.x
, 1.x
or 1.x-SNAPSHOT
.
If the version prefix ends with -SNAPSHOT
then only snapshot versions will be considered.
The version prefix string is scanned for the first occurrence of “x”, which marks the end of the prefix. In order for an artifact to match, the start of artifact version must match the specified prefix. See the following examples:
Prefix in URL | Prefix for match | Snapshots? |
---|---|---|
1.0.x | 1.0. | no |
1.2.x | 1.2. | no |
1.x | 1. | no |
1.x.x | 1. | no |
1.x.4 | 1. | no |
1.2.x-SNAPSHOT | 1.2. | yes |
1.x-SNAPSHOT | 1. | yes |
1.2x | 1.2 | yes |
Assuming the channel has the alias name “m1” and contains the following artifacts, deployed using the Maven 2 adapter.
Group ID | Artifact ID | Version | Snapshot Version |
---|---|---|---|
test | art1 | 1.0.0-SNAPSHOT | 20150102.101010-1 |
test | art1 | 1.0.0 | |
test | art1 | 1.1.0-SNAPSHOT | 20150102.101010-1 |
test | art1 | 1.1.0-RC1 | |
test | art1 | 1.1.0 | |
test | art1 | 2.0.0-SNAPSHOT | 20150102.101010-1 |
test | art1 | 2.0.0-SNAPSHOT | 20150103.101010-1 |
test | art1 | 2.0.0-SNAPSHOT | 20150104.101010-1 |
test | art1 | 2.0.0-RC1 | |
test | art1 | 2.0.0-RC2 | |
test | art1 | 2.0.0 | |
test | art1 | 2.0.1-SNAPSHOT | 20150102.101010-1 |
test | art1 | 2.0.1 | |
test | art1 | 2.1.0-SNAPSHOT | 20150102.101010-1 |
test | art1 | 2.1.0-SNAPSHOT | 20150103.101010-1 |
test | art1 | 2.1.0-SNAPSHOT | 20150104.101010-1 |
test | art1 | 2.1.0-RC1 | |
test | art1 | 2.1.0-RC2 | |
test | art1 | 2.1.0 | |
test | art1 | 3.0.0-SNAPSHOT | 20150102.101010-1 |
test | art1 | 3.1.0-SNAPSHOT | 20150102.101010-1 |
The following table shows a few examples
Task | URL | Result |
---|---|---|
Latest release | /latest/m1/test/art1/path/to/file | test/art1-2.1.0 |
Latest snapshot | /latest-SNAPSHOT/m1/test/art1/path/to/file | test/art1-3.0.0-20150102.101010-1 |
Latest 2.0 release | /prefixed/m1/test/art1/2.0.x/path/to/file | test/art1-2.0.1 |
Latest 2.x release | /prefixed/m1/test/art1/2.x/path/to/file | test/art1-2.1.0 |
Latest 3.x snapshot | /prefixed/m1/test/art1/3.x-SNAPSHOT/path/to/file | test/art1-3.1.0-20150102.101010-1 |
Specific version 1.1.0-RC1 | /perfect/m1/test/art1/1.1.0-RC1/path/to/file | test/art1-1.1.0-RC1 |
Specific version 2.0.0-SNAPSHOT | /perfect/m1/test/art1/2.0.0-SNAPSHOT/path/to/file | test/art1-2.0.0-20150104.101010-1 Since there are several versions matching 2.0.0-SNAPSHOT, the highest ranking snapshot release will be used, which is identified by the specific snapshot version. |
Specific snapshot version 2.0.0-20150102.101010-1 | /perfect/m1/test/art1/2.0.0-20150102.101010-1/path/to/file | test/art1-2.0.0-20150102.101010-1 |
Specific snapshot version 2.0.0-20140101.101010-1 | /perfect/m1/test/art1/2.0.0-20140101.101010-1/path/to/file | 404 error since the requested artifact is no in the channel |