Skip to content
This repository was archived by the owner on Mar 28, 2026. It is now read-only.

Commit 5d5dccf

Browse files
Upgrade to Java 17 and Gradle 7.
1 parent 8e677dc commit 5d5dccf

8 files changed

Lines changed: 98 additions & 195 deletions

File tree

build.gradle

Lines changed: 33 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
task wrapper(type: Wrapper) {
2-
gradleVersion = '4.0'
3-
}
4-
51
defaultTasks 'clean', 'compileJava', 'test'
62

73
subprojects { proj ->
84

9-
apply plugin: 'idea'
105
apply plugin: 'java'
116
apply plugin: 'maven-publish'
12-
apply plugin: 'maven'
137
apply plugin: 'signing'
148

159
description = 'Structurizr'
@@ -18,7 +12,6 @@ subprojects { proj ->
1812

1913
repositories {
2014
mavenCentral()
21-
mavenLocal()
2215
}
2316

2417
sourceSets {
@@ -34,125 +27,74 @@ subprojects { proj ->
3427
}
3528
}
3629

37-
dependencies {
38-
compile 'com.google.code.findbugs:jsr305:3.0.2'
39-
}
40-
4130
compileJava.options.encoding = 'UTF-8'
4231
compileTestJava.options.encoding = 'UTF-8'
4332

4433
sourceCompatibility = 1.8
4534
targetCompatibility = 1.8
4635

36+
java {
37+
withJavadocJar()
38+
withSourcesJar()
39+
}
40+
4741
jar {
4842
manifest {
4943
attributes(
50-
"Implementation-Title": "Structurizr for Java",
51-
"Implementation-Version": version
44+
"Implementation-Title": "Structurizr for Java",
45+
"Implementation-Version": version
5246
)
5347
}
5448
}
5549

56-
task sourcesJar(type: Jar) {
57-
classifier = 'sources'
58-
from sourceSets.main.allJava
59-
}
60-
61-
task javadocJar(type: Jar) {
62-
classifier = 'javadoc'
63-
from javadoc
64-
}
65-
66-
artifacts {
67-
archives javadocJar, sourcesJar
68-
}
69-
70-
signing {
71-
sign configurations.archives
72-
}
73-
74-
uploadArchives {
50+
publishing {
7551
repositories {
76-
mavenDeployer {
77-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
78-
79-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
80-
authentication(userName: ossrhUsername, password: ossrhPassword)
52+
maven {
53+
name = "ossrh"
54+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
55+
credentials {
56+
username = findProperty('ossrhUsername')
57+
password = findProperty('ossrhPassword')
8158
}
59+
}
60+
}
8261

83-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
84-
authentication(userName: ossrhUsername, password: ossrhPassword)
85-
}
62+
publications {
63+
mavenJava(MavenPublication) {
64+
from components.java
8665

87-
pom.project {
88-
name 'Structurizr for Java'
89-
packaging 'jar'
90-
description 'Structurizr for Java'
91-
url 'https://github.com/structurizr/java'
66+
pom {
67+
name = 'Structurizr for Java'
68+
description = 'Structurizr for Java'
69+
url = 'https://github.com/structurizr/java'
9270

9371
scm {
94-
connection 'scm:git:git://github.com/structurizr/structurizr-java.git'
95-
developerConnection 'scm:git:git@github.com:structurizr/structurizr-java.git'
96-
url 'https://github.com/structurizr/java'
72+
connection = 'scm:git:git://github.com/structurizr/structurizr-java.git'
73+
developerConnection = 'scm:git:git@github.com:structurizr/structurizr-java.git'
74+
url = 'https://github.com/structurizr/java'
9775
}
9876

9977
licenses {
10078
license {
101-
name 'The Apache License, Version 2.0'
102-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
79+
name = 'The Apache License, Version 2.0'
80+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
10381
}
10482
}
10583

10684
developers {
10785
developer {
108-
id "simon"
109-
name "Simon Brown"
110-
email "simon@structurizr.com"
86+
id = "simon"
87+
name = "Simon Brown"
88+
email = "simon@structurizr.com"
11189
}
11290
}
11391
}
11492
}
11593
}
11694
}
11795

118-
def pomConfig = {
119-
licenses {
120-
license {
121-
name "The Apache Software License, Version 2.0"
122-
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
123-
distribution "repo"
124-
}
125-
}
126-
developers {
127-
developer {
128-
id "simon"
129-
name "Simon Brown"
130-
email "simon@structurizr.com"
131-
}
132-
}
133-
}
134-
135-
publishing {
136-
publications {
137-
mavenJava(MavenPublication) {
138-
from components.java
139-
artifact sourcesJar
140-
artifact javadocJar
141-
pom.withXml {
142-
def root = asNode()
143-
root.appendNode('description', 'Visualise, document and explore your software architecture with the C4 model.')
144-
root.appendNode('name', 'Structurizr for Java')
145-
root.appendNode('url', 'https://github.com/structurizr/java')
146-
root.children().last() + pomConfig
147-
}
148-
}
149-
}
150-
151-
repositories {
152-
maven {
153-
url "$buildDir/repo"
154-
}
155-
}
96+
signing {
97+
sign publishing.publications.mavenJava
15698
}
15799

158100
}

gradle/gradle.iml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon Nov 19 10:27:00 CET 2018
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

structurizr-client/build.gradle

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
dependencies {
22

3-
compile project(':structurizr-core')
3+
implementation project(':structurizr-core')
44

5-
compile 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
5+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
66

7-
compile 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
7+
implementation 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
88

9-
compile 'javax.xml.bind:jaxb-api:2.3.0'
9+
implementation 'javax.xml.bind:jaxb-api:2.3.0'
1010

11-
testCompile 'junit:junit:4.12'
12-
}
11+
implementation 'commons-logging:commons-logging:1.2'
1312

14-
sourceSets {
15-
main {
16-
java {
17-
srcDir 'src'
18-
}
19-
}
20-
test {
21-
java {
22-
srcDir 'test/unit'
23-
srcDir 'test/integration'
24-
}
25-
}
26-
}
13+
testImplementation 'junit:junit:4.12'
14+
}

structurizr-client/test/unit/com/structurizr/view/ThemeUtilsTests.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ public void test_findElementStyle_WithThemes() {
8686
workspace.getViews().getConfiguration().getStyles().addStylesFromTheme("url2", elementStyles, relationshipStyles);
8787

8888
ElementStyle style = workspace.getViews().getConfiguration().getStyles().findElementStyle(softwareSystem);
89-
assertEquals(new Integer(450), style.getWidth());
90-
assertEquals(new Integer(300), style.getHeight());
89+
assertEquals(Integer.valueOf(450), style.getWidth());
90+
assertEquals(Integer.valueOf(300), style.getHeight());
9191
assertEquals("#ff0000", style.getBackground()); // from theme 2
9292
assertEquals("#ffffff", style.getColor()); // from theme 1
93-
assertEquals(new Integer(24), style.getFontSize());
93+
assertEquals(Integer.valueOf(24), style.getFontSize());
9494
assertEquals(Shape.RoundedBox, style.getShape()); // from workspace
9595
assertNull(style.getIcon());
9696
assertEquals(Border.Solid, style.getBorder());
9797
assertEquals("#b20000", style.getStroke());
98-
assertEquals(new Integer(100), style.getOpacity());
98+
assertEquals(Integer.valueOf(100), style.getOpacity());
9999
assertEquals(true, style.getMetadata());
100100
assertEquals(true, style.getDescription());
101101
}
@@ -120,14 +120,14 @@ public void test_findRelationshipStyle_WithThemes() {
120120
workspace.getViews().getConfiguration().getStyles().addStylesFromTheme("url2", elementStyles, relationshipStyles);
121121

122122
RelationshipStyle style = workspace.getViews().getConfiguration().getStyles().findRelationshipStyle(relationship);
123-
assertEquals(new Integer(4), style.getThickness()); // from theme 1
123+
assertEquals(Integer.valueOf(4), style.getThickness()); // from theme 1
124124
assertEquals("#0000ff", style.getColor()); // from theme 2
125125
Assert.assertFalse(style.getDashed()); // from workspace
126126
assertEquals(Routing.Direct, style.getRouting());
127-
assertEquals(new Integer(24), style.getFontSize());
128-
assertEquals(new Integer(200), style.getWidth());
129-
assertEquals(new Integer(50), style.getPosition());
130-
assertEquals(new Integer(100), style.getOpacity());
127+
assertEquals(Integer.valueOf(24), style.getFontSize());
128+
assertEquals(Integer.valueOf(200), style.getWidth());
129+
assertEquals(Integer.valueOf(50), style.getPosition());
130+
assertEquals(Integer.valueOf(100), style.getOpacity());
131131
}
132132

133133
}

structurizr-core/build.gradle

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
dependencies {
22

3-
compile 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
3+
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
4+
implementation 'com.google.code.findbugs:jsr305:3.0.2'
45

5-
compile 'commons-logging:commons-logging:1.2'
6+
implementation 'commons-logging:commons-logging:1.2'
67

7-
testCompile 'junit:junit:4.12'
8-
testCompile 'org.assertj:assertj-core:3.9.1'
9-
}
10-
11-
sourceSets {
12-
main {
13-
java {
14-
srcDir 'src'
15-
}
16-
}
17-
test {
18-
java {
19-
srcDir 'test/unit'
20-
}
21-
}
22-
}
8+
testImplementation 'junit:junit:4.12'
9+
testImplementation 'org.assertj:assertj-core:3.9.1'
10+
}

structurizr-core/test/unit/com/structurizr/view/RelationshipStyleTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,32 @@ public void test_setPosition_SetsPositionToNull_WhenNullIsSpecified() {
2020
@Test
2121
public void test_setPosition_SetsPositionToZero_WhenANegativeNumberIsSpecified() {
2222
relationshipStyle.setPosition(-1);
23-
assertEquals(new Integer(0), relationshipStyle.getPosition());
23+
assertEquals(Integer.valueOf(0), relationshipStyle.getPosition());
2424
}
2525

2626
@Test
2727
public void test_setPosition_SetsPositionToOneHundred_WhenANumberGreaterThanOneHundredIsSpecified() {
2828
relationshipStyle.setPosition(101);
29-
assertEquals(new Integer(100), relationshipStyle.getPosition());
29+
assertEquals(Integer.valueOf(100), relationshipStyle.getPosition());
3030
}
3131

3232
@Test
3333
public void test_setPosition_SetsPosition_WhenANumberBetweenZeroAndOneHundredIsSpecified() {
3434
relationshipStyle.setPosition(0);
35-
assertEquals(new Integer(0), relationshipStyle.getPosition());
35+
assertEquals(Integer.valueOf(0), relationshipStyle.getPosition());
3636

3737
relationshipStyle.setPosition(1);
38-
assertEquals(new Integer(1), relationshipStyle.getPosition());
38+
assertEquals(Integer.valueOf(1), relationshipStyle.getPosition());
3939

4040
relationshipStyle.setPosition(50);
41-
assertEquals(new Integer(50), relationshipStyle.getPosition());
41+
assertEquals(Integer.valueOf(50), relationshipStyle.getPosition());
4242

4343

4444
relationshipStyle.setPosition(99);
45-
assertEquals(new Integer(99), relationshipStyle.getPosition());
45+
assertEquals(Integer.valueOf(99), relationshipStyle.getPosition());
4646

4747
relationshipStyle.setPosition(100);
48-
assertEquals(new Integer(100), relationshipStyle.getPosition());
48+
assertEquals(Integer.valueOf(100), relationshipStyle.getPosition());
4949
}
5050

5151
@Test

0 commit comments

Comments
 (0)