Upload-OfflineDeploymentPackage
It lets upload the generated offline package to Nexus. The script is based on the blog post published by Sonatype: http://www.sonatype.org/nexus/2016/04/14/uploading-artifacts-into-nexus-repository-via-powershell/.
Syntax
Upload-OfflineDeploymentPackage [-EndpointUrl] <String> [-Repository] <String> [-Group] <String> [-Artifact] <String> [-Version] <String> [-Packaging] <String> [-PackagePath] <String> [-Username] <String> [-Password] <String> [<CommonParameters>]
Description
It lets upload the generated offline package to Nexus. The script is based on the blog post published by Sonatype: http://www.sonatype.org/nexus/2016/04/14/uploading-artifacts-into-nexus-repository-via-powershell/.
Parameters
-EndpointUrl <String>
Address of your Nexus server.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 1 | true | false | false |
-Repository <String>
Name of your repository in Nexus.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 2 | true | false | false |
-Group <String>
Group Id.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 3 | true | false | false |
-Artifact <String>
The artifact name. It is a folder name put between the group and version.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 4 | true | false | false |
-Version <String>
Artifact version.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 5 | true | false | false |
-Packaging <String>
Packaging type (at ex. jar, war, ear, rar, etc.).
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 6 | true | false | false |
-PackagePath <String>
Full, literal path pointing to your Artifact.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 7 | true | false | false |
-Username <String>
The username to Nexus.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 8 | true | false | false |
-Password <String>
The password to Nexus.
| Position | Required | Default value | Accept pipeline input | Accept wildchard characters |
|---|---|---|---|---|
| 9 | true | false | false |
Examples
-------------------------- EXAMPLE 1 --------------------------
Upload-OfflineDeploymentPackage -EndpointUrl "https://nexus.unic.com/nexus/service/local/artifact/maven/content" -Repository "unic-ecs-releases" -Group "LLB" -Artifact "Release" -Version "1.0" -Packaging "zip" -PackagePath "D:\MyDeployment.zip" -Username "test.username" -Password "SecurePassword"