如何使用 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章