Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit a9c5fca

Browse files
authored
Merge pull request #1080 from kishansagathiya/issue_1078
Issue #1078 Gradle Task to create executable fatJar
2 parents bb0d8b6 + b01c4ac commit a9c5fca

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ git clone https://github.com/ethereum/ethereumj
4242
cd ethereumj
4343
cp ethereumj-core/src/main/resources/ethereumj.conf ethereumj-core/src/main/resources/user.conf
4444
vim ethereumj-core/src/main/resources/user.conf # adjust user.conf to your needs
45-
./gradlew clean shadowJar
45+
./gradlew clean fatJar
4646
java -jar ethereumj-core/build/libs/ethereumj-core-*-all.jar
4747
```
4848

ethereumj-core/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ javadoc {
165165
)
166166
}
167167

168+
//create a single Jar with all dependencies
169+
task fatJar(type: Jar) {
170+
classifier = 'all'
171+
manifest {
172+
attributes 'Main-Class' : mainClassName
173+
attributes 'Class-Path' : configurations.compile.collect { 'lib/' + it.getName() }.join(' ')
174+
}
175+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
176+
with jar
177+
}
168178

169179
task sourcesJar(type: Jar, dependsOn: classes) {
170180
classifier = 'sources'

0 commit comments

Comments
 (0)