Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to build Shadow Jar #15

Closed
wants to merge 7 commits into from
Closed

Try to build Shadow Jar #15

wants to merge 7 commits into from

Conversation

Goooler
Copy link
Owner

@Goooler Goooler commented Feb 8, 2024

rickard-von-essen and others added 7 commits January 10, 2024 13:29
This builds a shadow jar with all dependencies bundled in the plugin and relocates
most dependencies under shadow. This will fix issues where other Gradle plugins uses
incompatible versions of the same dependencies.

Fixes diffplug#587
Some dependencies fails to load if they are relocated.
Example:

Execution failed for task ':tasks'.
> Could not create task ':spotlessGroovyGradle'.
   > java.io.IOException: Failed to load eclipse groovy formatter: java.lang.RuntimeException: java.lang.ClassNotFoundException: shadow.equo.solstice.p2.P2QueryResult
Only bundle com.diffplug.durian:* and org.eclipse.jgit:org.eclipse.jgit
Relocate JGit with spotless.shadow prefix.

This breaks most tests in plugin-gradle with:

  java.lang.NoClassDefFoundError: com/diffplug/spotless/Jvm
# Conflicts:
#	plugin-gradle/CHANGES.md
@Goooler
Copy link
Owner Author

Goooler commented Feb 8, 2024

./gradlew :plugin-gradle:assemble

cd plugin-gradle/build/libs

jar -xvf plugin-gradle-6.25.1-SNAPSHOT.jar
...

tree -d .                       
.
├── META-INF
│   ├── gradle-plugins
│   ├── maven
│   │   ├── com.googlecode.concurrent-trees
│   │   │   └── concurrent-trees
│   │   ├── com.googlecode.javaewah
│   │   │   └── JavaEWAH
│   │   ├── commons-codec
│   │   │   └── commons-codec
│   │   ├── org.eclipse.jgit
│   │   │   └── org.eclipse.jgit
│   │   ├── org.jetbrains
│   │   │   └── annotations
│   │   └── org.slf4j
│   │       └── slf4j-api
│   ├── native-image
│   ├── proguard
│   ├── services
│   └── versions
│       └── 9
├── about_files
├── com
│   └── diffplug
│       └── gradle
│           └── spotless
└── shadow
    ├── META-INF
    │   └── versions
    │       └── 9
    ├── com
    │   ├── diffplug
    │   │   ├── common
    │   │   │   ├── annotations
    │   │   │   ├── base
    │   │   │   │   └── internal
    │   │   │   ├── collect
    │   │   │   ├── hash
    │   │   │   ├── io
    │   │   │   ├── math
    │   │   │   ├── primitives
    │   │   │   ├── swt
    │   │   │   │   └── os
    │   │   │   └── tree
    │   │   └── spotless
    │   │       ├── annotations
    │   │       ├── antlr4
    │   │       ├── cpp
    │   │       ├── extra
    │   │       │   ├── cpp
    │   │       │   ├── eclipse_wtp_formatter
    │   │       │   ├── glue
    │   │       │   │   ├── cdt
    │   │       │   │   ├── groovy
    │   │       │   │   └── jdt
    │   │       │   ├── groovy
    │   │       │   ├── integration
    │   │       │   ├── java
    │   │       │   └── wtp
    │   │       ├── generic
    │   │       ├── gherkin
    │   │       ├── glue
    │   │       │   ├── diktat
    │   │       │   │   └── compat
    │   │       │   ├── gherkin
    │   │       │   ├── gson
    │   │       │   ├── java
    │   │       │   ├── json
    │   │       │   ├── ktfmt
    │   │       │   ├── ktlint
    │   │       │   │   └── compat
    │   │       │   ├── markdown
    │   │       │   ├── pjf
    │   │       │   ├── pom
    │   │       │   ├── scalafmt
    │   │       │   └── yaml
    │   │       ├── go
    │   │       ├── groovy
    │   │       ├── java
    │   │       ├── json
    │   │       │   └── gson
    │   │       ├── kotlin
    │   │       ├── markdown
    │   │       ├── npm
    │   │       ├── pom
    │   │       ├── protobuf
    │   │       ├── python
    │   │       ├── rome
    │   │       ├── scala
    │   │       ├── shell
    │   │       ├── sql
    │   │       │   └── dbeaver
    │   │       └── yaml
    │   └── googlecode
    │       ├── concurrenttrees
    │       │   ├── common
    │       │   ├── radix
    │       │   │   └── node
    │       │   │       ├── concrete
    │       │   │       │   ├── bytearray
    │       │   │       │   ├── chararray
    │       │   │       │   ├── charsequence
    │       │   │       │   └── voidvalue
    │       │   │       └── util
    │       │   ├── radixinverted
    │       │   ├── radixreversed
    │       │   ├── solver
    │       │   └── suffix
    │       ├── javaewah
    │       │   ├── datastructure
    │       │   └── symmetric
    │       └── javaewah32
    │           └── symmetric
    ├── dev
    │   └── equo
    │       ├── ide
    │       │   └── ui
    │       └── solstice
    │           ├── p2
    │           └── platform
    ├── kotlin
    │   ├── annotation
    │   ├── collections
    │   │   ├── builders
    │   │   ├── jdk8
    │   │   └── unsigned
    │   ├── comparisons
    │   ├── concurrent
    │   ├── contracts
    │   ├── coroutines
    │   │   ├── cancellation
    │   │   ├── intrinsics
    │   │   └── jvm
    │   │       └── internal
    │   ├── enums
    │   ├── experimental
    │   ├── internal
    │   │   ├── jdk7
    │   │   └── jdk8
    │   ├── io
    │   │   ├── encoding
    │   │   └── path
    │   ├── jdk7
    │   ├── js
    │   ├── jvm
    │   │   ├── functions
    │   │   ├── internal
    │   │   │   ├── markers
    │   │   │   └── unsafe
    │   │   ├── jdk8
    │   │   └── optionals
    │   ├── math
    │   ├── native
    │   │   └── concurrent
    │   ├── properties
    │   ├── random
    │   │   └── jdk8
    │   ├── ranges
    │   ├── reflect
    │   ├── sequences
    │   ├── streams
    │   │   └── jdk8
    │   ├── system
    │   ├── text
    │   │   └── jdk8
    │   └── time
    │       └── jdk8
    ├── okhttp3
    │   └── internal
    │       ├── authenticator
    │       ├── cache
    │       ├── cache2
    │       ├── concurrent
    │       ├── connection
    │       ├── http
    │       ├── http1
    │       ├── http2
    │       ├── io
    │       ├── platform
    │       │   └── android
    │       ├── proxy
    │       ├── publicsuffix
    │       ├── tls
    │       └── ws
    ├── okio
    │   └── internal
    └── org
        ├── apache
        │   ├── commons
        │   │   └── codec
        │   │       ├── binary
        │   │       ├── cli
        │   │       ├── digest
        │   │       ├── language
        │   │       │   └── bm
        │   │       └── net
        │   └── felix
        │       └── resolver
        │           ├── reason
        │           └── util
        ├── eclipse
        │   ├── core
        │   │   └── runtime
        │   │       ├── adaptor
        │   │       └── internal
        │   │           └── adaptor
        │   ├── equinox
        │   │   └── log
        │   ├── jgit
        │   │   ├── annotations
        │   │   ├── api
        │   │   │   └── errors
        │   │   ├── attributes
        │   │   ├── blame
        │   │   ├── diff
        │   │   ├── dircache
        │   │   ├── errors
        │   │   ├── events
        │   │   ├── fnmatch
        │   │   ├── gitrepo
        │   │   │   └── internal
        │   │   ├── hooks
        │   │   ├── ignore
        │   │   │   └── internal
        │   │   ├── internal
        │   │   │   ├── diff
        │   │   │   ├── diffmergetool
        │   │   │   ├── fsck
        │   │   │   ├── revwalk
        │   │   │   ├── storage
        │   │   │   │   ├── commitgraph
        │   │   │   │   ├── dfs
        │   │   │   │   ├── file
        │   │   │   │   ├── io
        │   │   │   │   ├── memory
        │   │   │   │   ├── pack
        │   │   │   │   └── reftable
        │   │   │   ├── submodule
        │   │   │   ├── transport
        │   │   │   │   ├── connectivity
        │   │   │   │   ├── http
        │   │   │   │   ├── parser
        │   │   │   │   └── ssh
        │   │   │   └── util
        │   │   ├── lib
        │   │   │   └── internal
        │   │   ├── logging
        │   │   ├── merge
        │   │   ├── nls
        │   │   ├── notes
        │   │   ├── patch
        │   │   ├── revplot
        │   │   ├── revwalk
        │   │   │   └── filter
        │   │   ├── storage
        │   │   │   ├── file
        │   │   │   └── pack
        │   │   ├── submodule
        │   │   ├── transport
        │   │   │   ├── http
        │   │   │   └── resolver
        │   │   ├── treewalk
        │   │   │   └── filter
        │   │   └── util
        │   │       ├── io
        │   │       ├── sha1
        │   │       └── time
        │   └── osgi
        │       ├── container
        │       │   ├── builders
        │       │   └── namespaces
        │       ├── framework
        │       │   ├── console
        │       │   ├── eventmgr
        │       │   ├── internal
        │       │   │   └── reliablefile
        │       │   ├── log
        │       │   └── util
        │       ├── internal
        │       │   ├── cds
        │       │   ├── connect
        │       │   ├── container
        │       │   ├── debug
        │       │   ├── framework
        │       │   │   └── legacy
        │       │   ├── hookregistry
        │       │   ├── hooks
        │       │   ├── loader
        │       │   │   ├── buddy
        │       │   │   ├── classpath
        │       │   │   └── sources
        │       │   ├── location
        │       │   ├── log
        │       │   ├── messages
        │       │   ├── permadmin
        │       │   ├── provisional
        │       │   │   ├── service
        │       │   │   │   └── security
        │       │   │   └── verifier
        │       │   ├── service
        │       │   │   └── security
        │       │   ├── serviceregistry
        │       │   ├── signedcontent
        │       │   ├── url
        │       │   ├── util
        │       │   └── weaving
        │       ├── launch
        │       ├── report
        │       │   └── resolution
        │       ├── service
        │       │   ├── datalocation
        │       │   ├── debug
        │       │   ├── environment
        │       │   ├── localization
        │       │   ├── pluginconversion
        │       │   ├── resolver
        │       │   ├── runnable
        │       │   ├── security
        │       │   └── urlconversion
        │       ├── signedcontent
        │       ├── storage
        │       │   ├── bundlefile
        │       │   └── url
        │       │       ├── bundleentry
        │       │       ├── bundleresource
        │       │       └── reference
        │       ├── storagemanager
        │       └── util
        ├── intellij
        │   └── lang
        │       └── annotations
        ├── jetbrains
        │   └── annotations
        ├── osgi
        │   ├── dto
        │   ├── framework
        │   │   ├── connect
        │   │   ├── dto
        │   │   ├── hooks
        │   │   │   ├── bundle
        │   │   │   ├── resolver
        │   │   │   ├── service
        │   │   │   └── weaving
        │   │   ├── launch
        │   │   ├── namespace
        │   │   ├── startlevel
        │   │   │   └── dto
        │   │   └── wiring
        │   │       └── dto
        │   ├── resource
        │   │   └── dto
        │   ├── service
        │   │   ├── condition
        │   │   ├── condpermadmin
        │   │   ├── log
        │   │   │   └── admin
        │   │   ├── packageadmin
        │   │   ├── permissionadmin
        │   │   ├── resolver
        │   │   ├── startlevel
        │   │   └── url
        │   └── util
        │       └── tracker
        ├── slf4j
        │   ├── event
        │   ├── helpers
        │   └── spi
        └── tukaani
            └── xz
                ├── check
                ├── common
                ├── delta
                ├── index
                ├── lz
                ├── lzma
                ├── rangecoder
                └── simple

377 directories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants