You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to deploy artifacts using FTP you must first specify the use of an FTP server in the **distributionManagement** element of your POM as well as specifying an `extension` in your `build` element which will pull in the FTP artifacts required to deploy with FTP:
30
28
31
-
In order to deploy artifacts using FTP you must first specify the use of an FTP server in the
32
-
<<distributionManagement>> element of your POM as well as specifying an <<<extension>>> in your
33
-
<<<build>>> element which will pull in the FTP artifacts required to deploy with FTP:
34
-
35
-
+----+
29
+
```unknown
36
30
<project>
37
31
...
38
32
<distributionManagement>
@@ -54,12 +48,11 @@ Deployment of artifacts with FTP
54
48
</build>
55
49
...
56
50
</project>
57
-
+----+
51
+
```
58
52
59
-
Your <<<settings.xml>>> would contain a <<<server>>> element where the <<<id>>> of that element matches <<<id>>> of the
60
-
FTP repository specified in the POM above:
53
+
Your `settings.xml` would contain a `server` element where the `id` of that element matches `id` of the FTP repository specified in the POM above:
61
54
62
-
+----+
55
+
```unknown
63
56
<settings>
64
57
...
65
58
<servers>
@@ -71,12 +64,11 @@ Deployment of artifacts with FTP
71
64
</servers>
72
65
...
73
66
</settings>
74
-
+----+
67
+
```
75
68
76
-
You should, of course, make sure that you can login into the specified FTP server by hand before attempting the
77
-
deployment with Maven. Once you have verified that everything is setup correctly you can now deploy your artifacts
78
-
using Maven:
69
+
You should, of course, make sure that you can login into the specified FTP server by hand before attempting the deployment with Maven\. Once you have verified that everything is setup correctly you can now deploy your artifacts using Maven:
<!-- Unless required by applicable law or agreed to in writing,-->
19
+
<!-- software distributed under the License is distributed on an-->
20
+
<!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY-->
21
+
<!-- KIND, either express or implied. See the License for the-->
22
+
<!-- specific language governing permissions and limitations-->
23
+
<!-- under the License.-->
24
+
25
+
# Deploying With Network Issues
26
+
27
+
Sometimes, network quality from building machine to the remote repository is not perfect\. Of course, improving the network would be the best solution, but it is not always possible\.
28
+
29
+
There are a few strategies to work around the network issue\.
30
+
31
+
## Configuring Multiple Tries
32
+
33
+
Deploy plugin provides [`retryFailedDeploymentCount` parameter](../deploy-mojo.html#retryFailedDeploymentCount) to retry deployment multiple times before giving up and returning a failure for the `deploy` goal:
34
+
35
+
```unknown
42
36
<project>
43
37
[...]
44
38
<build>
@@ -54,60 +48,52 @@ Deploying With Network Issues
54
48
</build>
55
49
[...]
56
50
</project>
57
-
+----+
51
+
```
58
52
59
-
* Deploying to a Local Staging Directory
53
+
##Deploying to a Local Staging Directory
60
54
61
-
When the network is really not consistent, a deeper strategy is to deploy in 2 steps:
55
+
When the network is really not consistent, a deeper strategy is to deploy in 2 steps:
62
56
63
-
1. <<<deploy>>> to a local directory during the build, for example <<<file:./target/staging-deploy>>>,
57
+
1\.`deploy` to a local directory during the build, for example `file:./target/staging-deploy`,
64
58
65
-
2. then copy from the local area to the target remote repository, retrying as much as necessary.
59
+
2\. then copy from the local area to the target remote repository, retrying as much as necessary\.
66
60
67
-
[]
61
+
### Deploying to a Local Directory
68
62
69
-
**Deploying to a Local Directory
63
+
Deploying to a local directory can be done from command line, without changing POM, using [`altDeploymentRepository` parameter](../deploy-mojo.html#altDeploymentRepository):
70
64
71
-
Deploying to a local directory can be done from command line, without changing POM, using
will do the same without taking care of repository metadata: use it if you have an empty repository as target,
94
-
like a staging repository provided by a repository manager.
95
-
96
-
It can be invoked fully from command line (renaming <<<-Dwagon.>>> with <<<wagon.targetId>>> when
97
-
{{{https://github.com/mojohaus/wagon-maven-plugin/pull/26}Wagon Maven Plugin 2.0.1 will be released}}):
98
-
99
-
+----+
73
+
```
74
+
75
+
Of course, you can configure the repository in your `pom.xml` if you want to go from a temporary strategy to the general strategy\.
76
+
77
+
### Copying from Local Directory to Target Remote Repository
78
+
79
+
`wagon-maven-plugin`'s [`merge-maven-repos` goal](https://www.mojohaus.org/wagon-maven-plugin/merge-maven-repos-mojo.html) provides a mechanism to copy from one remote repository to the other, while merging repository metadata\.
80
+
81
+
`wagon-maven-plugin`'s [`upload` goal](https://www.mojohaus.org/wagon-maven-plugin/upload-mojo.html) will do the same without taking care of repository metadata: use it if you have an empty repository as target, like a staging repository provided by a repository manager\.
82
+
83
+
It can be invoked fully from command line \(renaming `-Dwagon.` with `wagon.targetId` when [Wagon Maven Plugin 2\.0\.1 will be released](https://github.com/mojohaus/wagon-maven-plugin/pull/26)\):
<!-- Unless required by applicable law or agreed to in writing,-->
19
+
<!-- software distributed under the License is distributed on an-->
20
+
<!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY-->
21
+
<!-- KIND, either express or implied. See the License for the-->
22
+
<!-- specific language governing permissions and limitations-->
23
+
<!-- under the License.-->
24
+
25
+
# Deployment of artifacts in an external SSH command
26
+
27
+
In order to deploy artifacts using SSH you must first specify the use of an SSH server in the **distributionManagement** element of your POM as well as specifying an `extension` in your `build` element which will pull in the SSH artifacts required to deploy with SSH:
28
+
29
+
```unknown
36
30
37
31
<project>
38
32
...
@@ -55,14 +49,11 @@ Deployment of artifacts in an external SSH command
55
49
</build>
56
50
..
57
51
</project>
52
+
```
58
53
59
-
+----+
54
+
If you are deploying from Unix or have Cygwin installed you won't need to any additional configuration in your `settings.xml` file as everything will be taken from the environment\. But if you are on Windows and are using something like `plink` then you will need something like the following:
60
55
61
-
If you are deploying from Unix or have Cygwin installed you won't need to any additional configuration in your <<<settings.xml>>>
62
-
file as everything will be taken from the environment. But if you are on Windows and are using something like <<<plink>>> then
63
-
you will need something like the following:
64
-
65
-
+----+
56
+
```unknown
66
57
67
58
<settings>
68
59
...
@@ -80,21 +71,17 @@ Deployment of artifacts in an external SSH command
80
71
</servers>
81
72
...
82
73
</settings>
74
+
```
83
75
84
-
+----+
85
-
86
-
You should, of course, make sure that you can login into the specified SSH server by hand before attempting the
87
-
deployment with Maven. Once you have verified that everything is setup correctly you can now deploy your artifacts
88
-
using Maven:
76
+
You should, of course, make sure that you can login into the specified SSH server by hand before attempting the deployment with Maven\. Once you have verified that everything is setup correctly you can now deploy your artifacts using Maven:
89
77
90
-
+----+
78
+
```unknown
91
79
mvn deploy
92
-
+----+
80
+
```
93
81
94
-
Sometimes you may have permissions problems deploying and if so you can set the file and directory permissions
95
-
like so:
82
+
Sometimes you may have permissions problems deploying and if so you can set the file and directory permissions like so:
96
83
97
-
+----+
84
+
```unknown
98
85
99
86
<settings>
100
87
...
@@ -116,10 +103,7 @@ mvn deploy
116
103
</servers>
117
104
...
118
105
</settings>
106
+
```
119
107
120
-
+----+
108
+
**NOTE:** If you are using Putty it will expect the private key to be in the `PPK` format and not the standard format so make sure you use `puttygen` to convert your openssh format key to `PPK` format or generate another one\. Windows users can find the Putty tools on the [PuTTY Download Page](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)\.
121
109
122
-
<<NOTE:>> If you are using Putty it will expect the private key to be in the <<<PPK>>> format and not the standard
123
-
format so make sure you use <<<puttygen>>> to convert your openssh format key to <<<PPK>>> format or generate another
124
-
one. Windows users can find the Putty tools on the
0 commit comments