gradle多模块 java_GitHub - zhjunjun/gradle-demo: gradle的一个多模块Java项目脚手架

Gradle构建的一个多模块Java项目脚手架

java: 1.8.0_251"

Gradle: 6.5.1

Kotlin: 1.3.72

Groovy: 2.5.11

查看项目结构

➜ gradle_demo git:(main) ✗ gradle projects

> Task :projects

------------------------------------------------------------

Root project

------------------------------------------------------------

Root project 'gradle_demo'

+--- Project ':app'

+--- Project ':list'

\--- Project ':web'

....

查看该项目任务列表

➜ gradle_demo git:(main) ✗ gradle -q tasks --all

------------------------------------------------------------

Tasks runnable from root project

------------------------------------------------------------

Application tasks

-----------------

app:run - Runs this project as a JVM application

Build tasks

-----------

app:assemble - Assembles the outputs of this project.

list:assemble - Assembles the outputs of this project.

web:assemble - Assembles the outputs of this project.

app:build - Assembles and tests this project.

list:build - Assembles and tests this project.

web:build - Assembles and tests this project.

app:buildDependents - Assembles and tests this project and all projects that depend on it.

list:buildDependents - Assembles and tests this project and all projects that depend on it.

web:buildDependents - Assembles and tests this project and all projects that depend on it.

app:buildNeeded - Assembles and tests this project and all projects it depends on.

list:buildNeeded - Assembles and tests this project and all projects it depends on.

web:buildNeeded - Assembles and tests this project and all projects it depends on.

app:classes - Assembles main classes.

list:classes - Assembles main classes.

web:classes - Assembles main classes.

app:clean - Deletes the build directory.

list:clean - Deletes the build directory.

web:clean - Deletes the build directory.

app:jar - Assembles a jar archive containing the main classes.

list:jar - Assembles a jar archive containing the main classes.

web:jar - Assembles a jar archive containing the main classes.

app:testClasses - Assembles test classes.

list:testClasses - Assembles test classes.

web:testClasses - Assembles test classes.

Build Setup tasks

-----------------

init - Initializes a new Gradle build.

wrapper - Generates Gradle wrapper files.

Distribution tasks

------------------

app:assembleDist - Assembles the main distributions

app:distTar - Bundles the project as a distribution.

app:distZip - Bundles the project as a distribution.

app:installDist - Installs the project as a distribution as-is.

Documentation tasks

-------------------

app:javadoc - Generates Javadoc API documentation for the main source code.

list:javadoc - Generates Javadoc API documentation for the main source code.

web:javadoc - Generates Javadoc API documentation for the main source code.

...

构建项目

➜ gradle_demo git:(main) ✗ gradle app:build

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.

Use '--warning-mode all' to show the individual deprecation warnings.

See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1s

9 actionable tasks: 9 up-to-date

运行项目

➜ gradle_demo git:(main) ✗ gradle app:run

> Task :app:run

web init

list init

com.example.App run ---->

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.

Use '--warning-mode all' to show the individual deprecation warnings.

See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 956ms

6 actionable tasks: 1 executed, 5 up-to-date

参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
gradle-demo.zip 文件夹 PATH 列表 卷序列号为 4E8D-6931 C:. │ .classpath │ .gitignore │ .project │ .txt │ build.gradlegradlew │ gradlew.bat │ settings.gradle │ ├─.gradle │ ├─4.8.1 │ │ ├─fileChanges │ │ │ last-build.bin │ │ │ │ │ ├─fileContent │ │ │ annotation-processors.bin │ │ │ fileContent.lock │ │ │ │ │ ├─fileHashes │ │ │ fileHashes.bin │ │ │ fileHashes.lock │ │ │ resourceHashesCache.bin │ │ │ │ │ └─taskHistory │ │ taskHistory.bin │ │ taskHistory.lock │ │ │ ├─buildOutputCleanup │ │ buildOutputCleanup.lock │ │ cache.properties │ │ outputFiles.bin │ │ │ └─vcsWorkingDirs │ gc.properties │ ├─.settings │ org.eclipse.buildship.core.prefs │ org.eclipse.core.resources.prefs │ org.eclipse.jdt.core.prefs │ ├─bin │ ├─main │ │ │ application.properties │ │ │ │ │ ├─com │ │ │ └─dream │ │ │ └─gradledemo │ │ │ │ GradleDemoApplication.class │ │ │ │ │ │ │ └─controller │ │ │ DemoController.class │ │ │ │ │ └─templates │ │ hello.html │ │ │ └─test │ └─com │ └─dream │ └─gradledemoGradleDemoApplicationTests.class │ ├─build │ ├─classes │ │ └─java │ │ └─main │ │ └─com │ │ └─dream │ │ └─gradledemo │ │ │ GradleDemoApplication.class │ │ │ │ │ └─controller │ │ DemoController.class │ │ │ ├─resources │ │ └─main │ │ │ application.properties │ │ │ │ │ ├─static │ │ └─templates │ │ hello.html │ │ │ └─tmp │ └─compileJava ├─gradle │ └─wrapper │ gradle-wrapper.jar │ gradle-wrapper.properties │ └─src ├─main │ ├─java │ │ └─com │ │ └─dream │ │ └─gradledemo │ │ │ GradleDemoApplication.java │ │ │ │ │ └─controller │ │ DemoController.java │ │ │ └─resources │ │ application.properties │ │ │ ├─static │ └─templates │ hello.html │ └─test └─java └─com └─dream └─gradledemo GradleDemoApplicationTests.java

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值