Jenkins中修改gradle的默认目录

网友投稿 485 2022-11-09

Jenkins中修改gradle的默认目录

Jenkins中修改gradle的默认目录

之前公司有一个旧的Jenkins在提供客户端打包,随着时间的推移发现默认gradle占用根分区的资源空间越来越大。照成数据盘有很大闲置,而根分区不够的现象。

可以看到我根分区剩余空间非常少

网上也找了好多。什么5中方式改变gradl的目录。发现好多都是windows的。其中发现了一个但用处不是很大。

最后通过

[root@dbjenkins gradle_cache]# gradle --h

USAGE: gradle [option...] [task...] -?, -h, --help Shows this help message. -a, --no-rebuild Do not rebuild project dependencies. -b, --build-file Specifies the build file. -c, --settings-file Specifies the settings file. --configure-on-demand Only relevant projects are configured in this build run. This means faster build for large multi-project builds. [incubating] --console Specifies which type of console output to generate. Values are 'plain', 'auto' (default) or 'rich'. --continue Continues task execution after a task failure. -D, --system-prop Set system property of the JVM (e.g. -Dmyprop=myvalue). -d, --debug Log in debug mode (includes normal stacktrace). --daemon Uses the Gradle daemon to run the build. Starts the daemon if not running. --foreground Starts the Gradle daemon in the foreground. [incubating] -g, --gradle-user-home Specifies the gradle user home directory. --gui Launches the Gradle GUI. -I, --init-script Specifies an initialization script. -i, --info Set log level to info. -m, --dry-run Runs the builds with all task actions disabled. --max-workers Configure the number of concurrent workers Gradle is allowed to use. [incubating] --no-color Do not use color in the console output. [deprecated - use --console=plain instead] --no-daemon Do not use the Gradle daemon to run the build. --offline The build should operate without accessing network resources. -P, --project-prop Set project property for the build script (e.g. -Pmyprop=myvalue). -p, --project-dir Specifies the start directory for Gradle. Defaults to current directory. --parallel Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. [incubating] --parallel-threads Build projects in parallel, using the specified number of executor threads. [deprecated - Please use --parallel, optionally in conjunction with --max-workers.] [incubating] --profile Profiles build execution time and generates a report in the /reports/profile directory. --project-cache-dir Specifies the project-specific cache directory. Defaults to .gradle in the root project directory. -q, --quiet Log errors only. --recompile-scripts Force build script recompiling. --refresh-dependencies Refresh the state of dependencies. --rerun-tasks Ignore previously cached task results. -S, --full-stacktrace Print out the full (very verbose) stacktrace for all exceptions. -s, --stacktrace Print out the stacktrace for all exceptions. --stop Stops the Gradle daemon if it is running. -t, --continuous Enables continuous build. Gradle does not exit and will re-execute tasks when task file inputs change. [incubating] -u, --no-search-upward Don't search in parent folders for a settings.gradle file. -v, --version Print version info. -x, --exclude-task Specify a task to be excluded from execution.

发现

-g,--gradle-user-home指定gradle用户的主目录。

--project-cache-dir指定特定于项目的缓存目录。在根项目目录中默认为.gradle。

[root@dbjenkins ~]# mkdir /dbox/gradle_cache/

建立gradle 的主目录,和缓存目录

[root@dbjenkins gradle_cache]# gradle -g /dbox/gradle_cache

:help Welcome to Gradle 2.14.1. To run a build, run gradle ... To see a list of available tasks, run gradle tasks To see a list of command-line options, run gradle --help To see more detail about a task, run gradle help --task BUILD SUCCESSFUL Total time: 1.662 secs This build could be faster, please consider using the Gradle Daemon: gradle_cache]# gradle --project-cache-dir /dbox/gradle_cache

:help Welcome to Gradle 2.14.1. To run a build, run gradle ... To see a list of available tasks, run gradle tasks To see a list of command-line options, run gradle --help To see more detail about a task, run gradle help --task BUILD SUCCESSFUL Total time: 1.72 secs This build could be faster, please consider using the Gradle Daemon: ~]# cd /dbox/gradle_cache/[root@dbjenkins gradle_cache]# ls -a

[root@dbjenkins gradle_cache]#

. .. 2.14.1 caches .gradle native

发现目录下已经生成了一些默认的目录

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Spring Boot中自动执行sql脚本的方法实例
下一篇:详解Linux内核模块的编写方法
相关文章

 发表评论

暂时没有评论,来抢沙发吧~