| 1 |
------ |
| 2 |
Other SCM Commands |
| 3 |
------ |
| 4 |
Pete Marvin King |
| 5 |
------ |
| 6 |
2008-08-13 |
| 7 |
------ |
| 8 |
|
| 9 |
~~ Licensed to the Apache Software Foundation (ASF) under one |
| 10 |
~~ or more contributor license agreements. See the NOTICE file |
| 11 |
~~ distributed with this work for additional information |
| 12 |
~~ regarding copyright ownership. The ASF licenses this file |
| 13 |
~~ to you under the Apache License, Version 2.0 (the |
| 14 |
~~ "License"); you may not use this file except in compliance |
| 15 |
~~ with the License. You may obtain a copy of the License at |
| 16 |
~~ |
| 17 |
~~ http://www.apache.org/licenses/LICENSE-2.0 |
| 18 |
~~ |
| 19 |
~~ Unless required by applicable law or agreed to in writing, |
| 20 |
~~ software distributed under the License is distributed on an |
| 21 |
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 22 |
~~ KIND, either express or implied. See the License for the |
| 23 |
~~ specific language governing permissions and limitations |
| 24 |
~~ under the License. |
| 25 |
|
| 26 |
~~ NOTE: For help with the syntax of this file, see: |
| 27 |
~~ http://maven.apache.org/doxia/references/apt-format.html |
| 28 |
|
| 29 |
Other SCM Commands |
| 30 |
|
| 31 |
The scm plugin requires the scm to be configured in the <<<pom.xml>>>. |
| 32 |
|
| 33 |
+---------+ |
| 34 |
<project> |
| 35 |
... |
| 36 |
<packaging>jar</packaging> |
| 37 |
<version>1.0-SNAPSHOT</version> |
| 38 |
<name>SCM Sample Project</name> |
| 39 |
<url>http://somecompany.com</url> |
| 40 |
<scm> |
| 41 |
<connection>scm:svn:http://somerepository.com/svn_repo/trunk</connection> |
| 42 |
<developerConnection>scm:svn:https://somerepository.com/svn_repo/trunk</developerConnection> |
| 43 |
<url>http://somerepository.com/view.cvs</url> |
| 44 |
</scm> |
| 45 |
... |
| 46 |
</project> |
| 47 |
+---------+ |
| 48 |
|
| 49 |
If you want to change the default scm provider implementation, for exemple you want to use the native cvs |
| 50 |
instead of the pure java implementation, you must configure your plugin like that: |
| 51 |
|
| 52 |
+-----------+ |
| 53 |
<project> |
| 54 |
... |
| 55 |
<build> |
| 56 |
... |
| 57 |
<plugins> |
| 58 |
<plugin> |
| 59 |
<groupId>org.apache.maven.plugins</groupId> |
| 60 |
<artifactId>maven-scm-plugin</artifactId> |
| 61 |
<version>${project.version}</version> |
| 62 |
<configuration> |
| 63 |
<providerImplementations> |
| 64 |
<cvs>cvs_native</cvs> |
| 65 |
</providerImplementations> |
| 66 |
</configuration> |
| 67 |
</plugin> |
| 68 |
... |
| 69 |
</plugins |
| 70 |
... |
| 71 |
</build> |
| 72 |
... |
| 73 |
</project> |
| 74 |
+-----------+ |
| 75 |
|
| 76 |
Once the scm has been configured, scm operations can be performed. |
| 77 |
|
| 78 |
* changelog - displays the project commit changes for each revisions |
| 79 |
|
| 80 |
<<<pom.xml>>> configuration : |
| 81 |
|
| 82 |
+-----------+ |
| 83 |
<project> |
| 84 |
... |
| 85 |
<build> |
| 86 |
... |
| 87 |
<plugins> |
| 88 |
<plugin> |
| 89 |
<groupId>org.apache.maven.plugins</groupId> |
| 90 |
<artifactId>maven-scm-plugin</artifactId> |
| 91 |
<version>${project.version}</version> |
| 92 |
<configuration> |
| 93 |
<startDate>YYYY-MM-DD</startDate> |
| 94 |
<endDate>YYYY-MM-DD</endDate> |
| 95 |
</configuration> |
| 96 |
</plugin> |
| 97 |
... |
| 98 |
</plugins |
| 99 |
... |
| 100 |
</build> |
| 101 |
... |
| 102 |
</project> |
| 103 |
+-----------+ |
| 104 |
|
| 105 |
Command : |
| 106 |
|
| 107 |
+---------+ |
| 108 |
mvn scm:changelog |
| 109 |
+---------+ |
| 110 |
|
| 111 |
or you can specify the startDate and endDate on the commandline |
| 112 |
|
| 113 |
+---------+ |
| 114 |
mvn -DstartDate=YYYY-MM-DD -DendDate=YYYY-MM-DD scm:changelog |
| 115 |
+---------+ |
| 116 |
|
| 117 |
|
| 118 |
* diff |
| 119 |
|
| 120 |
<<<pom.xml>>> configuration : |
| 121 |
|
| 122 |
+-----------+ |
| 123 |
<project> |
| 124 |
... |
| 125 |
<build> |
| 126 |
... |
| 127 |
<plugins> |
| 128 |
<plugin> |
| 129 |
<groupId>org.apache.maven.plugins</groupId> |
| 130 |
<artifactId>maven-scm-plugin</artifactId> |
| 131 |
<version>${project.version}</version> |
| 132 |
<configuration> |
| 133 |
<startRevision>connection</startRevision> |
| 134 |
<endRevision>connection</endRevision> |
| 135 |
</configuration> |
| 136 |
</plugin> |
| 137 |
... |
| 138 |
</plugins |
| 139 |
... |
| 140 |
</build> |
| 141 |
... |
| 142 |
</project> |
| 143 |
+-----------+ |
| 144 |
|
| 145 |
Command : |
| 146 |
|
| 147 |
+---------+ |
| 148 |
mvn scm:diff |
| 149 |
+---------+ |
| 150 |
|
| 151 |
or you can specify the startRevision and endRevision in the command line |
| 152 |
|
| 153 |
+---------+ |
| 154 |
mvn -DstartRevision=<revision> -DendRevision=<revision> scm:diff |
| 155 |
+---------+ |
| 156 |
|
| 157 |
* edit - set the edit status of the file, locking the project sources if supported. |
| 158 |
|
| 159 |
Command : |
| 160 |
|
| 161 |
+---------+ |
| 162 |
mvn scm:edit |
| 163 |
+---------+ |
| 164 |
|
| 165 |
* status - displays the modified files in the project. |
| 166 |
|
| 167 |
Command : |
| 168 |
|
| 169 |
+---------+ |
| 170 |
mvn scm:status |
| 171 |
+---------+ |
| 172 |
|
| 173 |
* tag |
| 174 |
|
| 175 |
<<<pom.xml>>> configuration : |
| 176 |
|
| 177 |
+-----------+ |
| 178 |
<project> |
| 179 |
... |
| 180 |
<build> |
| 181 |
... |
| 182 |
<plugins> |
| 183 |
<plugin> |
| 184 |
<groupId>org.apache.maven.plugins</groupId> |
| 185 |
<artifactId>maven-scm-plugin</artifactId> |
| 186 |
<version>${project.version}</version> |
| 187 |
<configuration> |
| 188 |
<tag>tag name</tag> |
| 189 |
</configuration> |
| 190 |
</plugin> |
| 191 |
... |
| 192 |
</plugins |
| 193 |
... |
| 194 |
</build> |
| 195 |
... |
| 196 |
</project> |
| 197 |
+-----------+ |
| 198 |
|
| 199 |
Command : |
| 200 |
|
| 201 |
+---------+ |
| 202 |
mvn scm:tag |
| 203 |
+---------+ |
| 204 |
|
| 205 |
or you can specify the tag name in the command line |
| 206 |
|
| 207 |
+---------+ |
| 208 |
mvn -Dtag="<tag name>" scm:tag |
| 209 |
+---------+ |
| 210 |
|
| 211 |
* unedit - unset the edit status of the project sources and unlocking it if supported. |
| 212 |
|
| 213 |
Command : |
| 214 |
|
| 215 |
+---------+ |
| 216 |
mvn scm:unedit |
| 217 |
+---------+ |
| 218 |
|
| 219 |
* validate - check if the scm urls configured in the <<<pom.xml>>> is valid. |
| 220 |
|
| 221 |
Command : |
| 222 |
|
| 223 |
+---------+ |
| 224 |
mvn scm:validate |
| 225 |
+---------+ |
| 226 |
|
| 227 |
or passing the scmConnection or/and the developerConnection in the command line |
| 228 |
|
| 229 |
+---------+ |
| 230 |
mvn -DscmConnection="<scm url>" -DscmDeveloperConnection="<scm url>" scm:validate |
| 231 |
+---------+ |
| 232 |
|