I’ve got a project, and I’ve got it building class-only jars(the default), but I also need it to include the java sources inside the jars. How do I do this?
By default, any Jar task only include compiled classes.
You can change that with something like
jar{
from sourceSets.main.allSource
}
This includes all sources from the main sourceSet to the base jar task.
All tasks of type jar can be tweaked with
tasks.withType(Jar){
from sourcesets.xxxx.allSource
}
i looked at all the build.gradle files in my project and there is no Jar task anywhere . how can it be ?
You most certainly apply the [Java plug-in] (https://docs.gradle.org/current/userguide/java_plugin.html) that creates this task for you, among a lot of other things
yes I did.
so how should I use
jar {
from sourceSets.main.allSource
}
?
just like this ?
yes, just like this.
Your build.gradle delegates to a Project
object (more or less) that will use dynamic extension to retrieve the jar
task in the tasks container, since jar
is not a regular method from a Project
object.
Hi Francois ,I am using this build.gradle
apply plugin: 'java’
apply plugin: ‘eclipse-wtp’
version=“1.0.0-SNAPSHOT”
configurations.add “provided”
dependencies {
provided fileTree(dir: project(":dataserver-deployment-war").projectDir.toString()+"/build/war/WEB-INF/lib", include: "*.jar")
provided fileTree(dir: project(":engineserver-deployment-war").projectDir.toString()+"/build/war/WEB-INF/lib", include: "*.jar")
}
sourceSets.main {
compileClasspath += configurations.provided
}
sourceSets {
main {
java { srcDir ‘src/main/java’ }
java { srcDir ‘src/ersDWH/java’ }
java { srcDir ‘src/fixFIEngine/java’ }
java { srcDir ‘src/fixFutureEngine/java’ }
}
}
jar {
from sourceSets.main.allSource
}
and the output is
unpackWars
:custom-projects:custom-shared-lib:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:custom-projects:custom-shared-lib:processResources
:custom-projects:custom-shared-lib:classes
:custom-projects:custom-shared-lib:jar
:custom-projects:custom-shared-lib:assemble
:custom-projects:custom-shared-lib:compileTestJava UP-TO-DATE
:custom-projects:custom-shared-lib:processTestResources UP-TO-DATE
:custom-projects:custom-shared-lib:testClasses UP-TO-DATE
:custom-projects:custom-shared-lib:test UP-TO-DATE
:custom-projects:custom-shared-lib:check UP-TO-DATE
:custom-projects:custom-shared-lib:build
BUILD SUCCESSFUL
but the custom-shared-lib.jar is still without the java sources.
':custom-projects:custom-shared-lib:jar’
Means that you are working in a multi-projects build.
Are you showing me the build.gradle of the custom-shared-lib subproject?
You always have the solution to apply the “allSource” trick to all tasks of type “Jar”, as shown above, but the solution I gave you should work … if applied to the correct “jar” task, so in the correct build.gradle file.
yes this is the build.gradle of the custom-shared-lib subproject.
Unfortunately I cannot attach a pic. I can send the directory structure to you by mail.
It might be helpful to run with “–info” (or perhaps “–debug”), as this will show you the full command line being generated. This would show what folders “jar” is attempting to copy into the jar file. This might give you a clue.
ok so
ar {
from sourceSets.main.allSource
}
works fine . it was my mistake .
The problem now is that I’m getting en error in other step of the build script when doing jarsign.
I’m getting : ERROR: jarsigner returned: 1
Loading properties from file ‘D:\calypso\calypso-14.1.0.12\tools\calypso-patcher\gradle.properties’ …
Executing task: patch
[11:14:29.637] Currently installed modules: [calypso-bloomberg-sapi-1.3.2, calypso-bloomberg-1.5.2, calypso-cdsisdamodel-14.1.0.12, calypso-cls-1.0.0-14.0.0.11, calypso-collateral-2.3.6-14.1.0.0, calypso-custom-extensions-1.0.1, calypso-data-explorers-1.1.0-14.1.0.0, calypso-datauploader-3.8.0-14.0.0.18.SP1-FXEM, calypso-dtcc-2.2.0-c14, calypso-ers-14.1.0.12, calypso-hedge-accounting-14.1.0.12, calypso-icelink-2.3.0-14.1.0.0, calypso-markit-14.1.0, calypso-markitwire-4.5.1-14.0.0.0, calypso-matching-1.5.0-CAL-14.0.0.22.SP2, calypso-module-distribution-14.1.0.12, calypso-reuters-rdss-1.2.5-14.1.0.0, calypso-reuters-rfa-1.16.3-14.0.0.22.SP2, calypso-scalable-risk-infra-3.0.3, calypso-tof-14.0.0.24, calypso-trax-2.1.8-CAL-14.0.0.18, calypso-trioptima-1.4.3-c14, calypso-xva-1.1.5, custom-project-distribution-1.0.0-SNAPSHOT]
[11:14:29.668] Using Calypso patcher version 1.2.1
[11:14:29.668] Processing input file ‘custom-project-distribution.cup’ …
[11:14:29.668] The input file ‘custom-project-distribution.cup’ is a CUP file
[11:14:29.668] Determining distributions to patch …
[11:14:29.934] Processing distribution ‘custom-project-distribution-1.0.0-SNAPSHOT-rel.zip’ …
[11:14:30.058] Is the module currently installed ? true
[11:14:30.058] This module is among the distributions to be explicitly upgraded (as per the command line)
[11:14:30.058] The module upgrade hasn’t been forced (the incoming version will be applied only if newer)
[11:14:30.058] Distribution ‘custom-project-distribution’ is installed and will be updated
[11:14:30.105] Distribution ‘custom-project-distribution’ is installed (1.0.0-SNAPSHOT) and incoming version (1.0.0-SNAPSHOT) is newer
[11:14:30.105] Patching in unattended mode …
[11:14:30.105] Found 1 distributions to patch
[11:14:30.105] custom-project-distribution-1.0.0-SNAPSHOT-rel.zip
[11:14:30.105] Patching 1 distribution(s) …
[11:14:30.152] Patching distribution ‘custom-project-distribution-1.0.0-SNAPSHOT-rel.zip’ [1/1] …
[11:14:30.729] Patching custom-project-distribution-1.0.0-SNAPSHOT, file: custom-project-distribution-1.0.0-SNAPSHOT-rel.zip
[11:14:30.760] Patching Calypso deployment files
[11:14:30.776] Patching dataserver.war
[11:14:30.776] Extracting dataserver.war to D:\calypso\calypso-14.1.0.12\deploy\dataserver.war.extracted
[11:14:46.267] Upgrading custom-shared-lib: 1.0.0-snapshot -> 1.0.0-snapshot
[11:14:46.283] Comparing classes for audit information
[11:15:00.136] Removing file custom-shared-lib-1.0.0-SNAPSHOT.jar
[11:15:00.136] Updating custom-shared-lib-1.0.0-SNAPSHOT.jar with new file custom-shared-lib-1.0.0-SNAPSHOT.jar in target directory D:\calypso\calypso-14.1.0.12\deploy\dataserver.war.extracted\WEB-INF\lib
[11:15:00.214] custom-shared-lib-1.0.0-SNAPSHOT.jar has been successfully updated.
[11:15:00.245] Upgrading custom-dataserver-services: 1.0.0-snapshot -> 1.0.0-snapshot
[11:15:00.245] Comparing classes for audit information
[11:15:00.276] Removing file custom-dataserver-services-1.0.0-SNAPSHOT.jar
[11:15:00.276] Updating custom-dataserver-services-1.0.0-SNAPSHOT.jar with new file custom-dataserver-services-1.0.0-SNAPSHOT.jar in target directory D:\calypso\calypso-14.1.0.12\deploy\dataserver.war.extracted\WEB-INF\lib
[11:15:00.276] custom-dataserver-services-1.0.0-SNAPSHOT.jar has been successfully updated.
[11:15:00.323] Writing audit report to D:\calypso\calypso-14.1.0.12\deploy\dataserver.war.extracted\calypso-hotfix-audit.xml
[11:15:00.744] Creating backup of dataserver.war in D:\calypso\calypso-14.1.0.12\patch-history\20150911-111420\deploy
[11:15:00.744] Backing up dataserver.war
[11:15:01.072] Removing file dataserver.war
[11:15:01.134] Rebuilding dataserver.war with patched files
[11:15:33.801] Removing temporary folder: D:\calypso\calypso-14.1.0.12\deploy\dataserver.war.extracted
[11:15:34.737] Patching engineserver.war
[11:15:34.737] Extracting engineserver.war to D:\calypso\calypso-14.1.0.12\deploy\engineserver.war.extracted
[11:15:48.652] Upgrading custom-shared-lib: 1.0.0-snapshot -> 1.0.0-snapshot
[11:15:48.683] Removing file custom-shared-lib-1.0.0-SNAPSHOT.jar
[11:15:48.683] Updating custom-shared-lib-1.0.0-SNAPSHOT.jar with new file custom-shared-lib-1.0.0-SNAPSHOT.jar in target directory D:\calypso\calypso-14.1.0.12\deploy\engineserver.war.extracted\WEB-INF\lib
[11:15:48.730] custom-shared-lib-1.0.0-SNAPSHOT.jar has been successfully updated.
[11:15:48.746] Upgrading custom-engine: 1.0.0-snapshot -> 1.0.0-snapshot
[11:15:48.746] Comparing classes for audit information
[11:15:48.808] Removing file custom-engine-1.0.0-SNAPSHOT.jar
[11:15:48.824] Updating custom-engine-1.0.0-SNAPSHOT.jar with new file custom-engine-1.0.0-SNAPSHOT.jar in target directory D:\calypso\calypso-14.1.0.12\deploy\engineserver.war.extracted\WEB-INF\lib
[11:15:48.824] custom-engine-1.0.0-SNAPSHOT.jar has been successfully updated.
[11:15:48.839] Writing audit report to D:\calypso\calypso-14.1.0.12\deploy\engineserver.war.extracted\calypso-hotfix-audit.xml
[11:15:49.120] Creating backup of engineserver.war in D:\calypso\calypso-14.1.0.12\patch-history\20150911-111420\deploy
[11:15:49.120] Backing up engineserver.war
[11:15:49.448] Removing file engineserver.war
[11:15:49.541] Rebuilding engineserver.war with patched files
[11:16:20.991] Removing temporary folder: D:\calypso\calypso-14.1.0.12\deploy\engineserver.war.extracted
[11:16:21.740] Patching webstart.war
[11:16:21.740] Extracting webstart.war to D:\calypso\calypso-14.1.0.12\deploy\webstart.war.extracted
[11:16:35.624] Upgrading custom-shared-lib: 1.0.0-snapshot -> 1.0.0-snapshot
[11:16:35.656] Removing file custom-shared-lib-1.0.0-SNAPSHOT.jar
[11:16:35.671] Updating custom-shared-lib-1.0.0-SNAPSHOT.jar with new file custom-shared-lib-1.0.0-SNAPSHOT.jar in target directory D:\calypso\calypso-14.1.0.12\deploy\webstart.war.extracted\application-jars
[11:16:35.671] Signing jar D:\calypso\calypso-14.1.0.12\deploy\webstart.war.extracted\application-jars\custom-shared-lib-1.0.0-SNAPSHOT.jar
[11:16:37.918] Backing up patch file to D:\calypso\calypso-14.1.0.12\patch-history\20150911-111420
[11:16:37.918] Backing up custom-project-distribution.cup
Script completed with errors!
ERROR: jarsigner returned: 1
Using Calypso patcher version 1.2.1
org.gradle.api.internal.LocationAwareException: Execution failed for task ‘:patch’.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:83)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:115)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:46)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:patch’.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:286)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:93)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
… 24 more
Caused by: : jarsigner returned: 1
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at org.apache.tools.ant.taskdefs.SignJar.signOneJar(SignJar.java:488)
at org.apache.tools.ant.taskdefs.SignJar.execute(SignJar.java:403)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at groovy.util.AntBuilder.performTask(AntBuilder.java:260)
at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:220)
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:170)
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.calypso.util.PatchUtil.signJar(PatchUtil.groovy:791)
at com.calypso.util.PatchUtil$signJar.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:50)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:169)
at com.calypso.util.PatchUtil$patchLibraryclosure11.doCall(PatchUtil.groovy:483)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:425)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1376)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1348)
at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.calypso.util.PatchUtil.patchLibrary(PatchUtil.groovy:402)
at com.calypso.util.PatchUtil$patchLibrary.call(Unknown Source)
at com.calypso.gradle.tasks.CalypsoPatcher$hotfixDeploymentFilesclosure3.doCall(CalypsoPatcher.groovy:250)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:425)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1376)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1348)
at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.calypso.gradle.tasks.CalypsoPatcher.hotfixDeploymentFiles(CalypsoPatcher.groovy:192)
at com.calypso.gradle.tasks.CalypsoPatcher$hotfixDeploymentFiles.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at com.calypso.gradle.tasks.CalypsoPatcher.executePatch(CalypsoPatcher.groovy:952)
at com.calypso.gradle.tasks.CalypsoPatcher$executePatch.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
at com.calypso.gradle.tasks.CalypsoPatcher.executeTask(CalypsoPatcher.groovy:1147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:513)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
… 53 more
Log file can be found at D:\calypso\calypso-14.1.0.12\tools\calypso-patcher\log\calypsoPatcher.patch.20150911-111420.log
and the sign task
/**
- copy scripts/src/main/jbossInstallationsPatches/…/patch into JBOSS_HOME
*/
task copyJbossInstallationPatches(dependsOn:[’:scripts:unwarAllDeployedWarFiles’,
‘:buildConfigurationManagement:loadBuildAndFilterConfig’]) << {
/*
- all env case goes first
*/
safePatchCopy(
"${project.rootDir}/buildConfigurationManagement/src/main/config/zHomePatch/jboss_home",
"${project.ext.JBOSS_HOME}/"
)
/*
- calypsoTargetSystem
*/
if(System.properties[‘calypsoTargetSystem’]) {
safePatchCopy(
"${project.rootDir}/buildConfigurationManagement/src/main/config/" + System.properties[‘calypsoTargetSystem’] +
"/zHomePatch/jboss_home",
"${project.ext.JBOSS_HOME}/"
)
}
/*
- calypsoTargetSystem + calypsoTargetSubSystem
- the more specific case goes last and wins
*/
if(System.properties[‘calypsoTargetSystem’] && System.properties[‘calypsoTargetSubSystem’]) {
safePatchCopy(
"${project.rootDir}/buildConfigurationManagement/src/main/config/" + System.properties[‘calypsoTargetSystem’] +
"/" + System.properties[‘calypsoTargetSubSystem’] + “/zHomePatch/jboss_home”,
"${project.ext.JBOSS_HOME}/"
)
}
/*
- if we have an exploded webstart folder we resign all the jars
*/
def webStartRoot = new File("${project.ext.JBOSS_HOME}/standalone-dataserver/deployments/webstart.war/")
if(webStartRoot.exists()) {
webStartRoot.traverse(nameFilter: ~/..jar./) { File jarFile ->
logger.debug "Lazy Signing " + jarFile
ant.signjar(
alias: ‘calypso’,
jar: jarFile,
keystore: “${project.ext.CALYPSO_HOME}/deploy/calypsoJAWS.key”,
storepass: “calypso”,
keypass: “calypso”,
preservelastmodified: “true”,
lazy: “true”,
verbose: “true”)
}
}
}
It’s generally a good idea to post a new note when your issues have changed to something completely different.
Did you look in that “calypso” log file?
yes I posted it above
jars\custom-shared-lib-1.0.0-SNAPSHOT.jar
[11:16:37.918] Backing up patch file to D:\calypso\calypso-14.1.0.12\patch-history\20150911-111420
[11:16:37.918] Backing up custom-project-distribution.cup
Script completed with errors!
ERROR: jarsigner returned: 1
Using Calypso patcher version 1.2.1
org.gradle.api.internal.LocationAwareException: Execution failed for task ‘:patch’.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:83)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:115)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)