Gradle provided dependencies with Intellij

后端 未结 3 1298
感动是毒
感动是毒 2021-01-21 10:48

I\'m trying to build a Bukkit plugin. The plugin also uses exp4j. The final result needs to have the exp4j code included in the released jar but not have the Bu

3条回答
  •  执笔经年
    2021-01-21 11:07

    I did find a very hacky solution. But it's so bad I feel bad posting it here :P

    1. Declare the provided dependencies as runtime dependencies
    2. Regenerate the idea files: gradle cleanIdea idea
    3. Idea should now recognise the dependences
    4. Change the provided dependencies back to provided
    5. Go into the project settings and convert all the dependencies with runtime scope to Intellij's provided scope
    6. Stuff works :) (Just don't ever regenerate the idea files)

    Obvious problems, anyone using your project has to do the same hack. And every time you regenerate the idea files, the same thing will have to be repeated.

提交回复
热议问题