Revision 42481 trunk/org.gvsig.desktop/maven-howto.rst
maven-howto.rst | ||
---|---|---|
9 | 9 |
------------------------------------------------------------------- |
10 | 10 |
|
11 | 11 |
Can reduce install execution skiping test execution and compilation, |
12 |
javadoc generation, test signature checking, license checking, and
|
|
12 |
javadoc generation, test signature checking, license checking, and |
|
13 | 13 |
attach sources in jar. |
14 | 14 |
|
15 | 15 |
mvn -Danimal.sniffer.skip=true -Dsource.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -DskipTests -Dgvsig.skip.downloadPluginTemplates=true install |
... | ... | |
20 | 20 |
To increase the build number of gvSIG plugins, yo can do: |
21 | 21 |
|
22 | 22 |
mvn -Dincrease-build-number process-sources |
23 |
|
|
23 |
|
|
24 | 24 |
How to deploy a package of a gvSIG plugin |
25 | 25 |
-------------------------------------------- |
26 | 26 |
|
... | ... | |
30 | 30 |
|
31 | 31 |
Notes: |
32 | 32 |
- Require that the gvsig.package.info.poolURL property that this set to the correct value. |
33 |
- The process uses WEBDAV to upload the packages, gvspkg and gvspki, and require
|
|
33 |
- The process uses WEBDAV to upload the packages, gvspkg and gvspki, and require |
|
34 | 34 |
access to write in the location specified by gvsig.package.info.poolURL |
35 | 35 |
- If "user" or "password" is not present, the process ask its each time it need. |
36 | 36 |
- If folder specified in gvsig.package.info.poolURL does not exist, the process try to create it. |
37 |
- The process create a file "addon-request.txt" in the target with the information to
|
|
37 |
- The process create a file "addon-request.txt" in the target with the information to |
|
38 | 38 |
add to the ticket to request the update of the package in the main repository of |
39 | 39 |
packages of gvSIG. |
40 |
|
|
40 |
|
|
41 | 41 |
How show the list of files that have problems with the header. |
42 | 42 |
---------------------------------------------------------------- |
43 | 43 |
|
... | ... | |
58 | 58 |
How to skip attach sources in jar from command line |
59 | 59 |
------------------------------------------------------ |
60 | 60 |
|
61 |
If in the project is enabled by default the generation of jar whith
|
|
61 |
If in the project is enabled by default the generation of jar whith |
|
62 | 62 |
the sources of the project, you can disable this setting the property |
63 | 63 |
"source.skip" to true in the command line:: |
64 | 64 |
|
... | ... | |
67 | 67 |
How to skip test compile from command line |
68 | 68 |
-------------------------------------------- |
69 | 69 |
|
70 |
You can skip the compilation of test setting the propety "maven.test.skip"
|
|
70 |
You can skip the compilation of test setting the propety "maven.test.skip" |
|
71 | 71 |
to true in the command line:: |
72 | 72 |
|
73 | 73 |
mvn -Dmaven.test.skip=true install |
... | ... | |
108 | 108 |
How to check and fix the header of source files. |
109 | 109 |
-------------------------------------------------- |
110 | 110 |
|
111 |
You can check the headers of the files in you project
|
|
111 |
You can check the headers of the files in you project |
|
112 | 112 |
using the goal "license". To check the header use:: |
113 | 113 |
|
114 | 114 |
mvn license:check |
... | ... | |
116 | 116 |
To fix the header use:: |
117 | 117 |
|
118 | 118 |
mvn license:format |
119 |
|
|
119 |
|
|
120 | 120 |
How to skip test compilation |
121 | 121 |
-------------------------------- |
122 | 122 |
|
... | ... | |
174 | 174 |
Continue on test failure |
175 | 175 |
----------------------------- |
176 | 176 |
|
177 |
You can configure a project to continue on test execution
|
|
178 |
failure. To do this add to the pom of the project the next
|
|
177 |
You can configure a project to continue on test execution |
|
178 |
failure. To do this add to the pom of the project the next |
|
179 | 179 |
configuration of plugin "maven-surefire-plugin" :: |
180 | 180 |
|
181 | 181 |
<build> |
... | ... | |
197 | 197 |
Set java compatibility |
198 | 198 |
-------------------------- |
199 | 199 |
|
200 |
To set the compatibility with a java version add to the
|
|
201 |
pom of the project the next configuration of plugin
|
|
200 |
To set the compatibility with a java version add to the |
|
201 |
pom of the project the next configuration of plugin |
|
202 | 202 |
"maven-compiler-plugin" :: |
203 | 203 |
|
204 | 204 |
<build> |
... | ... | |
244 | 244 |
</configuration> |
245 | 245 |
</execution> |
246 | 246 |
</executions> |
247 |
</plugin>
|
|
247 |
</plugin> |
|
248 | 248 |
... |
249 | 249 |
</plugins> |
250 | 250 |
</build> |
... | ... | |
293 | 293 |
When execute a "mvn deploy" fail with the error:: |
294 | 294 |
|
295 | 295 |
[INFO] ------------------------------------------------------------------------ |
296 |
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
|
|
297 |
(default-deploy) on project org.gvsig.desktop: Failed to deploy artifacts/metadata:
|
|
298 |
No connector available to access repository gvsig-repository (dav:https://devel.gvsig.org/m2repo/j2se)
|
|
296 |
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy |
|
297 |
(default-deploy) on project org.gvsig.desktop: Failed to deploy artifacts/metadata: |
|
298 |
No connector available to access repository gvsig-repository (dav:https://devel.gvsig.org/m2repo/j2se) |
|
299 | 299 |
of type default using the available factories WagonRepositoryConnectorFactory -> [Help 1] |
300 |
[ERROR]
|
|
301 |
|
|
300 |
[ERROR] |
|
301 |
|
|
302 | 302 |
This happens to be configured the webdav wagon as an extension in the section "build":: |
303 | 303 |
|
304 | 304 |
... |
... | ... | |
319 | 319 |
fails with the following error :: |
320 | 320 |
|
321 | 321 |
[INFO] ------------------------------------------------------------------------ |
322 |
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare
|
|
322 |
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare |
|
323 | 323 |
(default-cli) on project org.gvsig.desktop: Unable to commit files |
324 | 324 |
[ERROR] Provider message: |
325 | 325 |
[ERROR] The svn command failed. |
326 | 326 |
[ERROR] Command output: |
327 | 327 |
[ERROR] svn: Commit failed (details follow): |
328 |
[ERROR] svn: MKACTIVITY of '/svn/gvsig-desktop/!svn/act/931a27bc-57e8-45d9-adcd-5a2cf54a7045':
|
|
328 |
[ERROR] svn: MKACTIVITY of '/svn/gvsig-desktop/!svn/act/931a27bc-57e8-45d9-adcd-5a2cf54a7045': |
|
329 | 329 |
authorization failed: Could not authenticate to server: rejected Basic challenge (https://devel.gvsig.org) |
330 | 330 |
[ERROR] -> [Help 1] |
331 |
[ERROR] |
|
332 | 331 |
[ERROR] |
332 |
[ERROR] |
|
333 | 333 |
|
334 | 334 |
Apparently maven in linux system use the svn of system and if you're not |
335 | 335 |
authenticated when trying to access to the repository, svn fails. |
336 | 336 |
|
337 | 337 |
This is solved by executing a commit from the command line on |
338 |
some file of the project (only if you have not enabled the option
|
|
339 |
"store-passwords = no" in $ HOME / .subversion / config). For example, you
|
|
340 |
can add or remove at the end of "pom.xml" a blank line and then run
|
|
338 |
some file of the project (only if you have not enabled the option |
|
339 |
"store-passwords = no" in $ HOME / .subversion / config). For example, you |
|
340 |
can add or remove at the end of "pom.xml" a blank line and then run |
|
341 | 341 |
from the command line :: |
342 | 342 |
|
343 | 343 |
svn ci -m "" pom.xml |
344 | 344 |
|
345 | 345 |
Alternatively can excute:: |
346 | 346 |
|
347 |
svn list https://devel.gvsig.org/svn/gvsig-desktop/
|
|
347 |
svn list https://devel.gvsig.org/svn/gvsig-desktop/ |
|
348 | 348 |
|
349 | 349 |
And manually accept the certificate permanently. |
350 | 350 |
|
... | ... | |
358 | 358 |
When running "mvn release:perform" fail with unable to find valid certification:: |
359 | 359 |
|
360 | 360 |
|
361 |
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project org.gvsig.tools: Failed to deploy artifacts: Could not transfer artifact org.gvsig:org.gvsig.tools:pom:3.0.15 from/to gvsig-repository (dav:https://devel.gvsig.org/m2repo/j2se): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1] |
|
362 |
[INFO] [ERROR]
|
|
363 |
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. |
|
364 |
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging. |
|
365 |
[INFO] [ERROR]
|
|
366 |
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles: |
|
367 |
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException |
|
361 |
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project org.gvsig.tools: Failed to deploy artifacts: Could not transfer artifact org.gvsig:org.gvsig.tools:pom:3.0.15 from/to gvsig-repository (dav:https://devel.gvsig.org/m2repo/j2se): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
|
|
362 |
[INFO] [ERROR]
|
|
363 |
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
|
|
364 |
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
|
|
365 |
[INFO] [ERROR]
|
|
366 |
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
|
|
367 |
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
|
|
368 | 368 |
|
369 |
Consulte la seccion "Acceso de escritura al repositorio maven de gvSIG" de |
|
369 |
Consulte la seccion "Acceso de escritura al repositorio maven de gvSIG" de
|
|
370 | 370 |
|
371 |
http://www.gvsig.org/plone/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2.0.0/trabajar-con-el-nucleo-de-gvsig/gvsig-compilation/initial-configuration/initial-configuration/?searchterm=maven%20java%20certification |
|
371 |
http://www.gvsig.org/plone/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2.0.0/trabajar-con-el-nucleo-de-gvsig/gvsig-compilation/initial-configuration/initial-configuration/?searchterm=maven%20java%20certification
|
|
372 | 372 |
|
373 |
How to deploy a jar to gvSIG maven repository |
|
374 |
--------------------------------------------------- |
|
373 | 375 |
|
376 |
Si queremos subir el fichero: |
|
377 |
|
|
378 |
- file formsrt.jar |
|
379 |
- artifactId formsrt |
|
380 |
- groupId com.jeta |
|
381 |
- version 2.1.0_M3-1 |
|
382 |
|
|
383 |
Al repositorio de gvSIG tendriamos que: |
|
384 |
|
|
385 |
- primero crear la carpeta https://devel.gvsig.org/m2repo/j2se/com/jeta/2.1.0_M3-1 en caso de que no exista. |
|
386 |
Podemos hacerlo usando un cliente de webdav, por ejemplo el cadaver. |
|
387 |
|
|
388 |
- Podemos necesitar instalar los certificados correspondientes al https del servidor de gvSIG. |
|
389 |
Para ello podemos seguir las instrucciones indicadas en: |
|
390 |
|
|
391 |
http://docs.gvsig.org/plone/projects/gvsig-desktop/docs/devel/gvsig-devel-guide/2.0.0/trabajar-con-el-nucleo-de-gvsig/gvsig-compilation/initial-configuration/initial-configuration#acceso-de-escritura-al-repositorio-maven-de-gvsig |
|
392 |
|
|
393 |
- Nos aseguraremos que en el settings.xml estan incluidos en la seccion servers los datos para acceder al servidor de gvSIG:: |
|
394 |
|
|
395 |
<?xml version="1.0" encoding="UTF-8"?> |
|
396 |
<settings xmlns="http://maven.apache.org/POM/4.0.0" |
|
397 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
398 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 |
|
399 |
http://maven.apache.org/xsd/settings-1.0.0.xsd"> |
|
400 |
<servers> |
|
401 |
<server> |
|
402 |
<id>gvsig-repository</id> |
|
403 |
<username>USUARIO</username> |
|
404 |
<password>CLAVE</password> |
|
405 |
<filePermissions>664</filePermissions> |
|
406 |
<directoryPermissions>774</directoryPermissions> |
|
407 |
</server> |
|
408 |
</servers> |
|
409 |
</settings> |
|
410 |
|
|
411 |
- Luego subimos el fichero ejectando el siguiente comando maven:: |
|
412 |
|
|
413 |
mvn deploy:deploy-file \ |
|
414 |
-Durl=https://devel.gvsig.org/m2repo/j2se \ |
|
415 |
-DrepositoryId=gvsig-repository \ |
|
416 |
-DgroupId=com.jeta \ |
|
417 |
-DartifactId=formsrt \ |
|
418 |
-Dversion=2.1.0_M3-1 \ |
|
419 |
-Dpackaging=jar \ |
|
420 |
-Dfile=formsrt.jar \ |
|
421 |
-Ddescription="Abeille runtime 2.1.0_M3 with the jgoodies clases removeds." |
|
422 |
|
|
423 |
|
Also available in: Unified diff