Skip to content

Commit

Permalink
Adjust Maven integration test to Java 11 and migrated TNG Nexus
Browse files Browse the repository at this point in the history
Issue: #117
Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
  • Loading branch information
codecholeric committed Nov 8, 2018
1 parent 2de78eb commit 560eb6a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 18 deletions.
3 changes: 2 additions & 1 deletion archunit-junit/build.gradle
Expand Up @@ -87,4 +87,5 @@ ext.configureJUnitArchive = { configureDependencies ->

this.with addCleanThirdPartyTask

javadoc.enabled = false
javadoc.enabled = false
uploadArchives.enabled = false
6 changes: 5 additions & 1 deletion archunit-maven-test/pom.xml.template
Expand Up @@ -53,6 +53,11 @@
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>#{archunitTestArtifact}</artifactId>
Expand Down Expand Up @@ -105,7 +110,6 @@
<fork>true</fork>
<source>#{javaVersion}</source>
<target>#{javaVersion}</target>
#{extraCompilerArgs}
</configuration>
</plugin>
</plugins>
Expand Down
48 changes: 34 additions & 14 deletions build-steps/maven-integration-test/maven-integration-test.gradle
Expand Up @@ -4,8 +4,8 @@ import java.nio.file.Files

def repositoryUrls = [
tng : [
snapshots: 'https://nexus.int.tngtech.com/content/repositories/snapshots',
releases : 'https://nexus.int.tngtech.com/content/repositories/releases'
snapshots: 'https://nexus.int.tngtech.com/repository/maven-snapshots',
releases : 'https://nexus.int.tngtech.com/repository/maven-releases'
],
sonatype: [
snapshots: 'https://oss.sonatype.org/content/repositories/snapshots',
Expand All @@ -28,6 +28,34 @@ def createRepositoriesTag = { repoUrls ->
</repositories>
"""
}
def createPluginRepositoriesTag = { repoUrls ->
"""
<pluginRepositories>
<pluginRepository>
<id>snapshots</id>
<name>Snapshots</name>
<url>${repoUrls.snapshots}</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>releases</id>
<name>Releases</name>
<url>${repoUrls.releases}</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
"""
}
def createAllRepositoryTags = { repoUrls ->
"""
${createRepositoriesTag(repoUrls)}
${createPluginRepositoriesTag(repoUrls)}
"""
}

def getRepoUrls = {
def repoUrls = repositoryUrls.get(it)
Expand Down Expand Up @@ -79,15 +107,14 @@ def addMavenTest = { config ->
Files.copy(mavenPomTemplate.toPath(), mavenPom.toPath())

def repositories = project.hasProperty('mavenRepos') ?
createRepositoriesTag(getRepoUrls(project.getProperty('mavenRepos'))) :
createAllRepositoryTags(getRepoUrls(project.getProperty('mavenRepos'))) :
''

mavenPom.text = mavenPom.text
.replace('#{archunit.version}', "${version}")
.replace('#{archunitTestArtifact}', config.archunitTestArtifact)
.replace('#{repositories}', repositories)
.replace('#{javaVersion}', "${config.javaVersion}")
.replace('#{extraCompilerArgs}', config.extraCompilerArgs ?: '')
.replace('#{surefireDependencies}', config.surefireDependencies ?: '')
.replace('#{surefireExampleConfiguration}', config.surefireExampleConfiguration)

Expand Down Expand Up @@ -156,16 +183,9 @@ def addMavenTest = { config ->
def javaConfigs = [
[suffix: "java7", javaVersion: JavaVersion.VERSION_1_7, jdkProp: "java7Home"],
[suffix: "java8", javaVersion: JavaVersion.VERSION_1_8, jdkProp: "java8Home"],
[suffix: "java9", javaVersion: JavaVersion.VERSION_1_9, jdkProp: "java9Home", extraCompilerArgs:
"""<compilerArgs>
<arg>--add-modules</arg>
<arg>java.xml.ws.annotation</arg>
</compilerArgs>"""],
[suffix: "java10", javaVersion: JavaVersion.VERSION_1_10, jdkProp: "java10Home", extraCompilerArgs:
"""<compilerArgs>
<arg>--add-modules</arg>
<arg>java.xml.ws.annotation</arg>
</compilerArgs>"""]
[suffix: "java9", javaVersion: JavaVersion.VERSION_1_9, jdkProp: "java9Home"],
[suffix: "java10", javaVersion: JavaVersion.VERSION_1_10, jdkProp: "java10Home"],
[suffix: "java11", javaVersion: JavaVersion.VERSION_11, jdkProp: "java11Home"]
]

javaConfigs = javaConfigs.findAll { project.hasProperty(it.jdkProp) }
Expand Down
4 changes: 2 additions & 2 deletions build-steps/publish/publish.gradle
Expand Up @@ -36,10 +36,10 @@ releaseProjects*.with {
}
}
if (project.hasProperty('tngNexusUsername') && project.hasProperty('tngNexusPassword')) {
repository(url: 'https://nexus.int.tngtech.com/content/repositories/releases') {
repository(url: 'https://nexus.int.tngtech.com/repository/maven-releases/') {
authentication(userName: tngNexusUsername, password: tngNexusPassword)
}
snapshotRepository(url: 'https://nexus.int.tngtech.com/content/repositories/snapshots') {
snapshotRepository(url: 'https://nexus.int.tngtech.com/repository/maven-snapshots/') {
authentication(userName: tngNexusUsername, password: tngNexusPassword)
}
}
Expand Down

0 comments on commit 560eb6a

Please sign in to comment.