无法为类型为org.gradle.api.tasks.bundling.Jar的任务“:idl-parser:sourceJar”设置未知属性“分类器

scyqe7ek  于 2023-03-13  发布在  其他
关注(0)|答案(1)|浏览(544)

我目前正在我的MacOS上安装Fast-DDS-Gen;但是,安装失败了,因为我遇到了以下错误。2我该如何解决这个问题?
这是官方网站的URLhttps://fast-dds.docs.eprosima.com/en/latest/installation/sources/sources_mac.html
以下是官网的说明:

brew install gradle

cd ~
git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git
cd Fast-DDS-Gen
gradle assemble

当我执行命令gradle assemble时,我遇到以下错误:

> Task :buildIDLParser FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/scott/Fast-DDS-Gen/thirdparty/idl-parser/build.gradle' line: 79

* What went wrong:
A problem occurred evaluating project ':idl-parser'.
> Could not set unknown property 'classifier' for task ':idl-parser:sourceJar' of type org.gradle.api.tasks.bundling.Jar.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
2 actionable tasks: 2 executed

下面是我的gradle信息:

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          19.0.2 (Homebrew 19.0.2)
OS:           Mac OS X 12.3.1 x86_64
niknxzdl

niknxzdl1#

Gradle 8不再允许在Jar任务中使用classifier。必须改用archiveClassifier
参见https://docs.gradle.org/current/userguide/upgrading_version_7.html
抽象归档任务API清理
已删除AbstractArchiveTask任务类型的过时附录、archiveName、archivePath、baseName、classifier、destinationDir、扩展名和版本属性。请改用archiveAppendix、archiveFileName、archiveFile、archiveBaseName、archiveClassifier、destinationDirectory、archiveExtension和archiveVersion属性。
(At在X1 E1 F1 X的官方文档中,现在仅提及新特性/属性X1 M2 N1 X。

  • 如果您要将Gradle 8用于此项目,则必须更改构建文件,使其与Gradle 8兼容。*

相关问题