- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下情况:
我有一个包含几个子项目的项目。今天我尝试通过命令行使用 gradle 构建项目。
执行 ./gradlew clean :build
时构建成功, 但不是 ./gradlew clean build
.根据激活的子项目,它会导致不同的错误。 这是为什么?不应该一样吗?
两个命令直接在彼此之后执行,代码没有变化,并且来自同一个目录(基目录,settings.gradle
所在的位置。
Intellij 的 gradle-refresh 工作,构建成功(但在我们的构建服务器上失败,如果相关的话)。
根据文档 https://docs.gradle.org/current/userguide/command_line_interface.html#executing_tasks_in_multi_project_builds我假设它会做同样的事情,因为没有指定子项目,并且为所有子模块执行构建任务。没有名为 build
的文件夹在根项目中,所以这不会引起混淆。我解释错了吗?
我在网上搜索了,但是我找不到结果,因为:
大多数搜索引擎无法识别它,并且 colon
导致不相关的结果,如 What is the colon operator in Gradle? .
gradle 版本是 4.10.2
如果您需要更多信息,请告诉我。
最佳答案
./gradlew clean :build
之间有区别和 ./gradlew clean build
,这就是您有不同行为的原因:在第一种情况下,您使用的是合格的任务名称,在另一种情况下,您使用的是简单的任务名称。这些文档 here和 here解释执行任务的这两种方法:
./gradlew test
):The first approach is similar to the single-project use case, but Gradle works slightly differently in the case of a multi-project build. The command gradle test will execute the test task in any subprojects, relative to the current working directory, that have that task. So if you run the command from the root project directory, you’ll run test in api, shared, services:shared and services:webservice. If you run the command from the services project directory, you’ll only execute the task in services:shared and services:webservice.
./gradlew build
在根项目目录中将触发
build
的执行根项目和所有子项目的任务
./gradlew :build
) For more control over what gets executed, use qualified names (the second approach mentioned). These are paths just like directory paths, but use ‘:’ instead of ‘/’ or ‘\’. If the path begins with a ‘:’, then the path is resolved relative to the root project. In other words, the leading ‘:’ represents the root project itself. All other colons are path separators.
./gradlew :build
,您将“仅”执行
build
rootProject
的任务
./gradlew :build
),您将不会看到这些错误
关于gradle - 为什么 ./gradlew clean build 和 ./gradlew clean :build 之间有区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53394617/
假设我想在编译项目之前将项目本地依赖项(jar 文件)安装到本地 Maven 存储库 (~/.m2),这样我就可以在 POM 中引用它们,就像引用 Maven 中的任何依赖项一样中央。目前,我正在使用
我需要使用 Clean 编程语言列出目录中的所有文件,但我不知道这样做的任何函数。有人可以帮助我吗? 最佳答案 您可以使用 Directory module 中的函数 getDirectoryCont
我的应用程序工作正常,我能够使用 jar 执行 mvn clean install并能够执行 jar 文件,但我将其更改为 war 文件,但我无法执行 mvn clean install . 这些之间
我是 Maven 的初学者。当我点击 clean & Build 在 netbeans 中重建我的项目时,它抛出一个错误 Failed to execute goal org.apache.maven
我已经为我的一些模型覆盖了 clean() 方法来构造约束以满足我的数据库架构要求(因为它需要运行时信息来进行这些验证)。 从现在开始,我已经完成了大部分后端组件(模型、信号、..),现在我正在尝试编
从 Android Studio 项目的终端发出以下语句有什么区别: Android_Studio_Project_Path: ./gradlew clean Android_Studio_Proje
我曾在不同的团队工作过,在一个团队中,人们倾向于在合并旧分支后立即清理它们。在其他团队分支永远停留。删除/保留旧分支有什么好处?这是否取决于我们使用的源代码控制系统? (在我的情况下 - SVN)。
我有一个相当复杂的(iPhone SDK)Xcode 项目,有很多目标——4 个静态库、单元测试、多个示例应用程序、一个运行 shell 脚本的 BuildAll 以及一个运行另一个 shell 脚本
我有一个 cucumber 项目,当您单独运行 cucumberrunner 文件时,该项目运行良好 [运行方式 -->Junit 测试]。 当我尝试使用 maven 命令运行相同的文件时,它失败了:
我在 cruiseControl 中有一个 msbuild 任务,它首先清除然后重建。如果我将其更改为“清理并构建”(而不是重建),会有什么不同吗? Rebuild 为每个项目执行“清理 + 构建”。
我对 Clean Architecture 中的 Gateway to Entity 依赖有疑问。我认为以下同心圆图形经常被介绍为整洁的架构。 在上图中,Gateway并没有直视Entity。但是,还
我使用M2e + Eclipse + Maven,我想知道两者之间的区别: 在终端和中运行“mvn clean” 从Eclipse 运行“干净的项目”吗? 有人可以请教吗? 最佳答案 通过一些快速测试
我试图弄清楚 package.json 脚本部分中“clean:dist”或“clean:js”与“clean”的作用?我在网上搜索并查看了NPM documentation但找不到任何线索。那么有人
我在 Linux 上的构建过程有一个小问题。 无论出于何种原因,在我的代码中,如果我发出“make clean”命令,Linux 会生成一个名为“clean”的文件。问题是我的项目的 makefile
mvn clean package和mvn clean install到底有什么区别?当我运行这两个命令时,它们似乎都在做同样的事情。 最佳答案 好吧,两者都会清理。这意味着他们将删除目标文件夹。真正
您在每个应用程序的开发过程中都遇到了某个时刻,您在模拟器中看到的内容与您认为应该发生的情况不符。这些大多是人为错误——或者至少在大多数我的案例中是这样的;-)——但有时 Xcode 只是“迷失了方向”
我使用这两个命令来解决我项目中的依赖问题。 mvn -U clean compile解决的问题。但我不知道它们之间的区别。请解释这些命令之间的区别以及我何时使用 mvn clean compile和
我正在为我的项目使用 Maven。如果我的项目不使用某些本地资源,这不是问题。 以便我遵循本指南 https://stackoverflow.com/a/61576687/6720896 将我的本地
我正在尝试创建一个 Grunt 任务来清理目录中的所有文件、子目录及其文件等。 我可以删除所有文件,但文件夹始终保留。 clean: { preview: ["live_previe
我有以下情况: 我有一个包含几个子项目的项目。今天我尝试通过命令行使用 gradle 构建项目。 执行 ./gradlew clean :build 时构建成功, 但不是 ./gradlew clea
我是一名优秀的程序员,十分优秀!