如何使用 gradle 构建源 jar? - How to build sources jar with gradle?

问题:

I am working with an open source project that is built with gradle.我正在使用一个用 gradle 构建的开源项目。 I would like to generate a (project)-sources.jar file that I can load into my IDE (IntelliJ IDEA) and debug through the project.我想生成一个(项目)-sources.jar 文件,我可以将其加载到我的 IDE(IntelliJ IDEA)中并通过项目进行调试。 I know how to load the file if I can generate it.如果可以生成文件,我知道如何加载文件。

I have looked through the available gradle tasks for the project and there isn't one that generates a sources jar file.我已经查看了该项目的可用 gradle 任务,但没有生成源 jar 文件的任务。

What is the easiest way to generate a sources jar file for this project?为该项目生成源 jar 文件的最简单方法是什么?

Adding the source into the jar file that contains the compiled class files would be fine as well.将源代码添加到包含已编译类文件的 jar 文件中也可以。


解决方案:

参考一: https://en.stackoom.com/question/m96H
参考二: https://stackoom.com/question/m96H
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章