Closed juanfra0064 closed 2 years ago
En teoría solo debería pedir esos datos cuando intentas publicar el paquete en el repo. Le estas dando build, o que task estas ejecutando?
Como el proyecto aparece con errores, le estoy dando Bonot secundario sobre el proyecto y la opcion clean and Build para generar el codigo
Ah esque primero tienes que correr el task "satResources" para que descargue todas las definiciones técnicas del SAT, ya despues debes poderle dar al task de build.
Si vas a utilizar el proyecto asi como se compila, puedes utilizar el paquete que está ya en la última versión. https://github.com/GrupoCorasa/cfdi-base/packages/1120118
Ejecute el task "satResources" y sigue apareciendo el mismo error
could not get unknown property 'username' for extensions 'env' of type ...
tengo que configurar alguna variable?
Podrías pasarme que está imprimiendo el IDE al correr el task? En teoría parece que está intentando publicar el build en el repositorio, aún si creas el archivo con las variables, te va marcar error al intentarlo publicar por falta de permisos. Una "solución" para que te deje compilarlo podría ser que quites del archivo build.gradle la configuración del task publish, que viene siendo este pedazo de código.
publishing {
repositories {
maven {
name = "cfdi-base"
url = uri("https://maven.pkg.github.com/grupocorasa/cfdi-base")
credentials {
username = env.USERNAME.value
password = env.GP_TOKEN.value
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
Esto es lo que dice con el publishing
FAILURE: Build failed with an exception.
Where: Script 'E:\ide\Java\NetBeans Test\cfdi-base-main\build.gradle' line: 20
What went wrong: A problem occurred evaluating root project 'cfdi-base'.
Could not get unknown property 'USERNAME' for extension 'env' of type co.uzzu.dotenv.gradle.DotEnvRoot.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 40ms
Sin el publishing es diferente, parece que no encuentra un recurso
Task :satResources FAILED Download http://www.sat.gob.mx/sitio_internet/cfd/3/cadenaoriginal_3_2/cadenaoriginal_3_2.xslt
FAILURE: Build failed with an exception.
Where: Script 'E:\ide\Java\NetBeans Test\cfdi-base-main\download.gradle' line: 23
What went wrong: Execution failed for task ':satResources'.
java.io.FileNotFoundException: src\main\resources\xslt\cfd\3\cadenaoriginal_3_2\cadenaoriginal_3_2.xslt (The system cannot find the path specified)
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 197ms
Que raro, primero marca que descargó el archivo "cadenaoriginal_3_2.xslt", y despues dice que no lo encuentra en la ruta "src\main\resources\xslt\cfd\3\cadenaoriginal_3_2\cadenaoriginal_3_2.xslt". Puedes revisar manualmente esa ruta para ver si está el archivo descargado.
Y si que esta raro por que el archivo si esta en esa ruta
Que podria ocacionar ese error?, por cierto lo estoy haciendo en NetBeans 12
Lo único que se me ocurre es que sean permisos, podrías intentar corriendo con --stacktrace para ver si marca algo adicional.
Con --stacktrace
FAILURE: Build failed with an exception.
Where: Script 'E:\ide\Java\NetBeans Test\cfdi-base-main\download.gradle' line: 23
What went wrong: Execution failed for task ':satResources'.
java.io.FileNotFoundException: src\main\resources\xslt\cfd\3\cadenaoriginal_3_2\cadenaoriginal_3_2.xslt (The system cannot find the path specified)
Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':satResources'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.gradle.api.UncheckedIOException: java.io.FileNotFoundException: src\main\resources\xslt\cfd\3\cadenaoriginal_3_2\cadenaoriginal_3_2.xslt (The system cannot find the path specified)
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61)
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:599)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:553)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:536)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:276)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:265)
at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
at java.util.Optional.orElseGet(Optional.java:267)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
at java.util.Optional.map(Optional.java:215)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
at java.util.Optional.orElseGet(Optional.java:267)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
... 33 more
Caused by: java.io.FileNotFoundException: src\main\resources\xslt\cfd\3\cadenaoriginal_3_2\cadenaoriginal_3_2.xslt (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.
Get more help at https://help.gradle.org
BUILD FAILED in 201ms
Creo que ya se cual es el problema! Para las rutas en Windows de utiliza la diagonal, pero en Unix es la diagonal invertida, tal vez ese sea el problema. En una chanza hago los cambios en todas las rutas
Pudiste probar si ese fue el problema? para no actualizar la librería hasta estar seguro que asi se soluciona
Agregué un nuevo branch donde hice los cambios. Se llama "FixFilePath", si pudieras hacer las pruebas, es muy probable que aún le falten algunos ajustes.
Ya hice la prueba y me marca el mismo error :(
El proyecto lo tiens en Eclipse o Netbeans? Para usar el mismo IDE
Se desarrolló en IntellijIDEA, pero no creo que ese sea el problema. Has verificado los permisos para ver si podría ser por ahí? Tambien intenta cambiando en el método de "satResources" (Aprox línea 290 del archivo download.gradle) por este código.
urls.each { url ->
downloadSatResouce(
localDownloads,
url,
'${buildDir.absolutePath}/src/main/resources/'
)
}
Si vas a utilizar el proyecto asi como se compila, puedes utilizar el paquete que está ya en la última versión. https://github.com/GrupoCorasa/cfdi-base/packages/1120118
Hola Heriberto, trato de usar como tal esto en mi pom, pero me dice que no puede resolver esta dependencia :( ¿La seguirás publicando? P.D. Por cierto, he usado tus versiones anteriormente, gracias por tu aporte!
Aqui puedes consultar el manual sobre como utilizar los paquetes que son subidos a Github Packages: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry
Ahi mismo hay una sección que dice "Installing a package" y te dice como utilizarlas. De igual manera dentro de la url con el paquete, del lado derecho tiene para descargar directamente los compilados.
Si tienes alguna duda lo comentas.
cierto, muchas gracias! mi sueño de ayer debió omitir los compilados je Feliz año!
Hola, estoy tratando de ejecutar el proyecto y me sale este error
could not get unknown property 'username' for extensions 'env' of type ...