Skip to content

Commit

Permalink
Add parameter to generate jar with or without dependencies
Browse files Browse the repository at this point in the history
We generate 2 jars, one with dependencies to deploy it on Github and without dependency to deploy on maven central.
  • Loading branch information
gojoise authored Mar 17, 2022
1 parent addce75 commit d4d2aa8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The search is done only in the document and chapter. The bricks are ignored.

## edc Version

Current release is compatible with edc v3.2+
Current release is compatible with edc v3.2+ and it's built with Java 11

## How can I get the latest release?

Expand All @@ -22,13 +22,13 @@ You can pull it from the central Maven repositories:
<dependency>
<groupId>fr.techad</groupId>
<artifactId>edc-httpd</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

### Gradle
```groovy
implementation 'fr.techad:edc-httpd:2.0.0'
implementation 'fr.techad:edc-httpd:2.0.1'
```
## How can I create and run a docker image?
You have just to use this two commands in the repository, -v parameter is optional for the second command
Expand Down
22 changes: 15 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ plugins {
id 'signing'
}
group 'fr.techad'
version '2.0.0'
version '2.0.1'
sourceCompatibility = 1.8
ext.withDependencies=project.hasProperty('withDependencies')
//Used to be able to add dependencies to jar
if(withDependencies){
configurations.implementation.setCanBeResolved(true)
configurations.api.setCanBeResolved(true)
}



java {
Expand Down Expand Up @@ -40,12 +44,16 @@ dependencies {
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
if(withDependencies){
attributes(
'Main-Class': 'fr.techad.edc.httpd.EdcWebServer'
)
)
}
}
from {
configurations.implementation.collect { it.isDirectory() ? it : zipTree(it) }
if(withDependencies){
configurations.implementation.collect { it.isDirectory() ? it : zipTree(it) }
}
}
}
//Execute Junit tests
Expand Down Expand Up @@ -89,9 +97,9 @@ publishing {
}
}
scm {
connection = 'scm:git:git://github.com/tech-advantage/edc-httpd-java.git'
developerConnection = 'scm:git:ssh://github.com/tech-advantage/edc-httpd-java.git'
url = 'https://github.com/tech-advantage/edc-httpd-java'
connection = 'scm:git:git://github.com/tech-advantage/edc-httpd.git'
developerConnection = 'scm:git:ssh://github.com/tech-advantage/edc-httpd.git'
url = 'https://github.com/tech-advantage/edc-httpd'
}
}
}
Expand Down

0 comments on commit d4d2aa8

Please sign in to comment.