Gradle not working inside container but does outside - docker

For some reason gradle is not working for me from w/in a docker container. Of course, outside the container it works fine. What's strange is that it doesn't say what file or directory is missing.
# ./gradlew clean -s
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'foo-bar'.
> Could not resolve com.google.protobuf:protobuf-gradle-plugin:0.8.9.
> Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-gradle-plugin/0.8.9/protobuf-gradle-plugin-0.8.9.pom'.
> org.apache.http.ssl.SSLInitializationException: (No such file or directory)
Caused by: java.io.FileNotFoundException: (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at org.gradle.internal.resource.transport.http.DefaultSslContextFactory$SslContextCacheLoader.initTrustManagerFactory(DefaultSslContextFactory.java:146)
at org.gradle.internal.resource.transport.http.DefaultSslContextFactory$SslContextCacheLoader.load(DefaultSslContextFactory.java:119)
... 248 more

Appears the problem was that javax.net.ssl.trustStore was being set to blank and overwriting the default, which also explains why FileNotFoundException appeared to not specify a value.

Related

Xcode10 error: can't exec (No such file or directory) for a user defined build setting

I get the "error: can't exec (No such file or directory)" when building a project with a user-defined build setting which is a path to a script. The project builds in Xcode 9.
ld = $(USER_LIBRARY_DIR)/Application\ Support/BlackBerry/Good.platform/iOS/FIPS_module/$FIPS_PACKAGE/bin/gd_fipsld
gives
error: can't exec '/Users/username/Library/Application\ Support/BlackBerry/Good.platform/iOS/FIPS_module/arm64.sdk/bin/gd_fipsld' (No such file or directory)
How to fix it?
In Xcode10 the new build system doesn’t support the tilde(~) character which is replaced with $(HOME) in the path.
Before: ~/Library/Application Support/BlackBerry/Good.platform/iOS/FIPS_module/$FIPS_PACKAGE/bin/gd_fipsld
After: $(HOME)/Library/Application Support/BlackBerry/Good.platform/iOS/FIPS_module/$FIPS_PACKAGE/bin/gd_fipsld
Note: The changes needs to be made in default.xcconfig file.

Failed to copy /home/[...]/ecj.jar to /usr/share/ant/lib/ecj.jar due to java.io.FileNotFoundException /usr/share/ant/lib/ecj.jar (Permission denied)

While ant clean works fine within Liferay IDE, when trying from command line I get:
$ ant clean
Buildfile: /home/nico/myportlet/build.xml
[copy] Copying 1 file to /usr/share/ant/lib
Attempt to copy /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar to /usr/share/ant/lib/ecj.jar using NIO Channels failed due to '/usr/share/ant/lib/ecj.jar (Permission denied)'. Falling back to streams.
BUILD FAILED
/home/nico/myportlet/build.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/portlets/build-common-portlet.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/build-common-plugin.xml:5: The following error occurred while executing this line:
/home/nico/liferay-plugins-sdk-6.2-ee-sp14/build-common.xml:94: Failed to copy /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar to /usr/share/ant/lib/ecj.jar due to java.io.FileNotFoundException /usr/share/ant/lib/ecj.jar (Permission denied)
Total time: 2 seconds
How to fix that?
Just copy the file manually as root.
After you have done that, ant will be happy and execute the tasks without complaining.
Here is how to do on Linux/Mac:
sudo cp /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib/ecj.jar /usr/share/ant/lib/
Or to not messing up with system libraries we could reference folder to ant like :
ant clean -lib /home/nico/liferay-plugins-sdk-6.2-ee-sp14/lib

Docker plugin : java.io.FileNotFoundException: /src/main/docker/Dockerfile gradle-docker fails

I'm trying to run spring boot sample on osx (mbp) and I'm getting following exception (Trying buildDocker task). I'm sure I have configured docker properly as I can run command docker-machine run hello-world and receive proper output.
Caused by: java.io.FileNotFoundException: /src/main/docker/Dockerfile (No such file or directory)
at se.transmode.gradle.plugins.docker.image.Dockerfile.fromExternalFile(Dockerfile.groovy:45)
at se.transmode.gradle.plugins.docker.image.Dockerfile$fromExternalFile.call(Unknown Source)
at se.transmode.gradle.plugins.docker.DockerTask.buildDockerfile(DockerTask.groovy:223)
at se.transmode.gradle.plugins.docker.DockerTask.build(DockerTask.groovy:238)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
... 54 more
Other validation would be I can run gradle-docker default build task (i.e. distDocker) without any problem. Problem occur when I try to run build following build task on the gradle script.
// tag::task[]
task buildDocker(type: Docker, dependsOn: build) {
push = true
applicationName = jar.baseName
dockerfile = file('/src/main/docker/Dockerfile')
doFirst {
copy {
from jar
into stageDir
}
}
}
// end::task[]
I can't workout why it cannot determine the file when it's already exists. I tried copying into root and change path for no luck.
OSX : 10.10.4
Java : 1.8
Remove the '/' before src in the path. The path is relative from the current directory (project root) and not the volume root.

Buld Errors because of weblogic

I have the following code in my build.properties file
### WebLogic ###
bea.home=${tool.home}/bea
# weblogic 8.1: Change weblogic.home
weblogic.home=${bea.home}/weblogic81
#weblogic.home=${bea.home}/weblogic92
#weblogic.home=${bea.home}/wlserver_10.3
weblogic.version=8.1
ejb.spec.version=3.0
But after running the tools.build file it is showing the following error:
BUILD FAILED
t:\DevEnv\3.1RC25\toolsetup.xml:22:
The following error occurred while executing this line:
t:\DevEnv\3.1RC25\toolsetup.xml:184: Property 'weblogic.8.1.root' is not defined.
I have checked and the weblogic is in the folder T:\bea\weblogic81\server\lib
Is this a problem regarding the wrong versions of weblogic as I have weblogic81 on my machine?

Jenkins Ruby metrics plugin fail to copy .gitkeep

Jenkins Ruby metrics plugin cause error when copy .gitkeep file to log directory, because it fails to create log directory.
Error message is below.
Publishing rcov report...
ERROR: Publisher hudson.plugins.rubyMetrics.rcov.RcovPublisher aborted due to exception
Failed to copy /Users/Shared/Jenkins/Home/jobs/RailsApp/workspace/log/.gitkeep to /Users/Shared/Jenkins/Home/jobs/RailsApp/builds/2014-02-05_21-07-52/log/.gitkeep due to failed to create the parent directory for /Users/Shared/Jenkins/Home/jobs/RailsApp/builds/2014-02-05_21-07-52/log/.gitkeep
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:914)
at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:567)
at hudson.Util.copyFile(Util.java:922)
at hudson.FilePath$38$1.visit(FilePath.java:1937)
at hudson.util.DirScanner.scanSingle(DirScanner.java:49)
at hudson.util.DirScanner$Glob.scan(DirScanner.java:131)
at hudson.FilePath$38.invoke(FilePath.java:1932)
at hudson.FilePath$38.invoke(FilePath.java:1925)
at hudson.FilePath.act(FilePath.java:914)
at hudson.FilePath.act(FilePath.java:887)
at hudson.FilePath.copyRecursiveTo(FilePath.java:1925)
at hudson.FilePath.copyRecursiveTo(FilePath.java:1911)
at hudson.FilePath.copyRecursiveTo(FilePath.java:1894)
at hudson.plugins.rubyMetrics.Utils.moveReportsToBuildRootDir(Utils.java:28)
at hudson.plugins.rubyMetrics.Utils.moveReportsToBuildRootDir(Utils.java:12)
at hudson.plugins.rubyMetrics.HtmlPublisher.prepareMetricsReportBeforeParse(HtmlPublisher.java:30)
at hudson.plugins.rubyMetrics.rcov.RcovPublisher.perform(RcovPublisher.java:50)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:784)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:756)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:705)
at hudson.model.Run.execute(Run.java:1695)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: java.io.IOException: failed to create the parent directory for /Users/Shared/Jenkins/Home/jobs/RailsApp/builds/2014-02-05_21-07-52/log/.gitkeep
at org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:512)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:559)
at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:899)
... 25 more
Jenkins didn't create log 'directory' but log 'file'. Jenkins have permission to read/write of the directory of course. Any ideas? Thanks in advance.
I spend a lot of time to fix this issue.
In fact, when you activate the Ruby metrics plugin, you have to provide a directory. If you don't, the default folder is log, and it is the cause of your error.
So, go to your project configuration and in the Publish Rcov Report section, you just fill the directory.
Enjoy :)

Resources