1. Descargar el proyecto Autofirma , conversión a Gradle e importarlo en Eclipse

 1. Descarga

Ir a https://github.com/ctt-gob-es/clienteafirma y marcar el botón code y seleccionar "Download ZIP"


Crear una carpeta de Workspace por ejemplo WS_AUTOFIRMA-APPLET

Descomprimir el zip dentro de dicha carpeta, obteniendo la carpeta "clienteafirma-master" dento del workspace

2. Transformar el proyecto de Maven a Gradle

Abrir Eclipse, seleccionar el Workspace "WS_AUTOFIRMA-APPLET"

Crear un nuevo proyecto gradle supongamos que lo llamamos Autofirma. Para ello seleccionamos FIle> New >Other > Gradle > Gradle Project

Le damos de nombre Autofirma, y la versión de Gradle 7.6.1 y de Java la 17

Ahora abrimos una ventana de terminal:

 Window > Show View > Other > Terminal > Terminal >Open

En la ventana nos situamos en la carpeta 

...../WS_AUTOFIRMA-APPLET/clientafirma-master 

y ejecutamos

../Autofirma/gradlew init

y nos pregunta y contestamos por defecto

edu@edu-HP-ProDesk-600-G1-SFF:~/MyWorkspaces/WS_AUTOFIRMA-APPLET/clienteafirma-master$ ../Autofirma/gradlew init

Found a Maven build. Generate a Gradle build from this? (default: yes) [yes, no] 

Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2] 1

Generate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] 

> Task :init
Maven to Gradle conversion is an incubating feature.
Get more help with your project: https://docs.gradle.org/7.6.1/userguide/migrating_from_maven.html

BUILD SUCCESSFUL in 4m 33s
2 actionable tasks: 2 executed
edu@edu-HP-ProDesk-600-G1-SFF:~/MyWorkspaces/WS_AUTOFIRMA-APPLET/clienteafirma-master$ 

Y ya tenemos el proyecto convertido a gradle

Si abrimos el fichero settings.gradle tenemos

/*
 * This file was generated by the Gradle 'init' task.
 */

rootProject.name = 'afirma-client'
include(':afirma-crypto-batch-client')
include(':afirma-crypto-xades')
include(':afirma-ui-core-jse')
include(':afirma-server-triphase-signer-document')
include(':afirma-crypto-xadestri-client')
include(':afirma-core-keystores')
include(':afirma-crypto-cades')
include(':afirma-crypto-xmlsignature')
include(':afirma-crypto-core-xml')
include(':afirma-crypto-validation')
include(':afirma-crypto-odf')
include(':afirma-crypto-pdf')
include(':afirma-crypto-cadestri-client')
include(':afirma-server-triphase-signer-cache')
include(':afirma-ui-core-jse-keystores')
include(':afirma-ui-simpleafirma-plugins')
include(':afirma-keystores-filters')
include(':afirma-crypto-cms')
include(':afirma-core-massive')
include(':afirma-ui-simpleafirma-plugins-manager')
include(':afirma-ui-simpleafirma-plugin-hash')
include(':afirma-crypto-ooxml')
include(':afirma-crypto-core-pkcs7')
include(':afirma-ui-simpleafirma-plugin-validatecerts')
include(':afirma-core')
include(':afirma-crypto-padestri-client')
include(':afirma-server-triphase-signer-core')
include(':afirma-crypto-cades-multi')
include(':afirma-crypto-core-pkcs7-tsp')
include(':afirma-keystores-mozilla')
include(':afirma-crypto-pdf-common')
project(":afirma-ui-simpleafirma-plugins").projectDir = file('afirma-simple-plugins')
project(":afirma-ui-simpleafirma-plugins-manager").projectDir = file('afirma-simple-plugins-manager')
project(":afirma-ui-simpleafirma-plugin-hash").projectDir = file('afirma-simple-plugin-hash')
project(":afirma-ui-simpleafirma-plugin-validatecerts").projectDir = file('afirma-simple-plugin-validatecerts')

Por tanto hay que renombrar la carpeta 

"clienteafirma-master" a "afirma-client"  como se indica la línea de fondo amarillo.  para no tener problemas a la hora de importar el proyecto

Ahora se va aproceder a importar el proyecto desde Eclipse, para ello en el menú superior 

File > Import > Gradle > Existing Gradle Project

Buscamos la carpeta del proyecto que es la renombrada afirma-client y aceptamos todas ls opciopnes y tarda un buen rato.

Después de procesar se ve que hay unos proyectos que tienen errores. También hay carpetas que no figuran como proyecto.



Comentarios