简体   繁体   English

Gradle将命令行参数传递给子项目运行任务

[英]Gradle pass commandline arguments to subproject run task

I have the following project-structure: 我有以下项目结构:

Root project 'rmi-tutorial'
+--- Project ':client'
+--- Project ':lib'
\--- Project ':server'

How can I pass command line arguments via the root-project run task to another certain sub project? 如何通过根项目运行任务将命令行参数传递给另一个特定的子项目?

I thought about something like this: 我想到了这样的事情:

gradlew.bat run -Pclient:<parameter1> -Pclient:<parameter2>

All of the project properties are still available in the project.properties map. 所有项目属性在project.properties映射中仍然可用。 Should you wish to access them from any level of your project, you may do so. 如果您希望从项目的任何级别访问它们,则可以这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM