diff --git a/.travis.yml b/.travis.yml index 36b582b2..76f41494 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,17 @@ language: java - jdk: - - oraclejdk8 - +- oraclejdk8 branches: only: - master - services: - - docker +- docker env: global: - - GIT_MAJOR_VERSION=1 - - GIT_MINOR_VERSION=3 + - GIT_MAJOR_VERSION=1 + - GIT_MINOR_VERSION=3 after_success: - - if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == "master" ]; then - +- if [ $TRAVIS_PULL_REQUEST == false ] && [ $TRAVIS_BRANCH == "master" ]; then docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD; docker tag continuityproject/idpa-annotation continuityproject/idpa-annotation:$GIT_MAJOR_VERSION.$GIT_MINOR_VERSION.$TRAVIS_BUILD_NUMBER; @@ -57,7 +53,16 @@ after_success: docker push continuityproject/eureka:$GIT_MAJOR_VERSION.$GIT_MINOR_VERSION.$TRAVIS_BUILD_NUMBER; docker tag continuityproject/eureka continuityproject/eureka:latest; docker push continuityproject/eureka:latest; - fi + ./gradlew -Psigning.keyId=$KEY_ID -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=../secring.gpg -Psonatype.username=$SONATYPE_USERNAME -Psonatype.password=$SONATYPE_PASSWORD -DRELEASE_VERSION=$GIT_MAJOR_VERSION.$GIT_MINOR_VERSION.$TRAVIS_BUILD_NUMBER :continuity.api:uploadArchives :continuity.api:closeAndReleaseRepository; + ./gradlew -Psigning.keyId=$KEY_ID -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=../secring.gpg -Psonatype.username=$SONATYPE_USERNAME -Psonatype.password=$SONATYPE_PASSWORD -DRELEASE_VERSION=$GIT_MAJOR_VERSION.$GIT_MINOR_VERSION.$TRAVIS_BUILD_NUMBER :continuity.idpa:uploadArchives :continuity.idpa:closeAndReleaseRepository; + ./gradlew -Psigning.keyId=$KEY_ID -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=../secring.gpg -Psonatype.username=$SONATYPE_USERNAME -Psonatype.password=$SONATYPE_PASSWORD -DRELEASE_VERSION=$GIT_MAJOR_VERSION.$GIT_MINOR_VERSION.$TRAVIS_BUILD_NUMBER :continuity.commons:uploadArchives :continuity.commons:closeAndReleaseRepository; + fi script: -- ./gradlew build docker +- "./gradlew build docker" +secring: + gpg: + secure: gxZ/tlbcZujjzu0JEMOn8E/fLfXEXKWEtbIYQoetLnjwsFI0GLak2gxH/X21HJwztbjrTCuBktKkKCDuDV4iWexQiHMo08rV4p5pMCvIiiEZ7uzJXuUKnD4jNCpGOsv5y4wtQklo+l6ZEm2c8yPSWROe9481Aklk7F44tFEmxXkH7sGnINVxh3i7mnxa/m095+WaGNh9PVP9CJI5tNXOSC5nHDr7FDP1Ay+qxv7+3A0rSlpuby+ws+5G7+6EhYlzRKkohCLfomZpm8VFFqqnfSawg/qYM26yANqGiZ25McESyBfNykWWlhvtttIngVVVdwYskBtUqlWhJxsvcj6gQIWFRoY8l1D+v/JuZHiZDDoe6tO1RwLojPjIpjWmUqQeg4FvWV7Th9GMwU2C3H1hNDbY8w3Ie+kp+Hy0ZM6fXI1wuqOFLLdA0LNRPBjValjc/CA13Q6hGYActKo+1YPFYxMhvYsEea2i8VFcZSw5aW6N0BGsMJTfqtkxXitTdRHRP+nH0yrQ+3WR739Oqf5ZzvC9hPKnxZ0LbOM35+mWdrMy+fQsXEo0BEDy2QFtEyaolyZLC5QWAa4+U8VVRHm2I4TkrQny6JDBhSVqpiOjIdX2TeheTUoTzj1SXqbmkAB2Q3/fzdb7jEWvabcpHqSHeHKCEkfzTZoiMPr5BUl3TCg= +before_install: +- openssl aes-256-cbc -K $encrypted_2a73fd4d5098_key -iv $encrypted_2a73fd4d5098_iv + -in secring.gpg.enc -out secring.gpg -d diff --git a/continuity.api/continuity.api.gradle b/continuity.api/continuity.api.gradle index e76e5304..0ff50a6a 100644 --- a/continuity.api/continuity.api.gradle +++ b/continuity.api/continuity.api.gradle @@ -1,5 +1,11 @@ +/** Required plugins */ +plugins { + id "io.codearte.nexus-staging" version "0.8.0" +} + apply plugin: 'io.spring.dependency-management' + dependencyManagement { imports { mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Finchley.M4' @@ -23,4 +29,114 @@ dependencies { compile (group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '3.1') { exclude group: 'org.mongodb', module: 'mongo-java-driver' } -} \ No newline at end of file +} + + + +/** + * Creates jar with sources. + */ +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} +/** + * Creates jar with javadocs. + */ +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +/** + * Pushing to maven centeral. + */ +apply plugin: 'maven' +apply plugin: 'signing' +apply plugin: 'io.codearte.nexus-staging' +/** + * When uploading the archives it has to be done using the full task name: + * > gradle :continuity.api:uploadArchives + */ +if (gradle.startParameter.getTaskNames().contains(":continuity.api:uploadArchives")) { + // Artifacts to build + artifacts { + archives sourcesJar, javadocJar + } + // Sign the artifacts + signing { + sign configurations.archives + } + group = "com.github.continuity-project" + archivesBaseName = "continuity.api" + // Uploads the signed artifacts + uploadArchives { + repositories { + mavenDeployer { + // check if necessary parameter exists + if (!project.hasProperty('sonatype.username') || !project.hasProperty('sonatype.password')) { + throw new GradleException('Credentials for Sonytype are missing.') + } + if (System.getProperty('RELEASE_VERSION') == null) { + throw new GradleException('The version of the library has to be specified. (Specified by "RELEASE_VERSION")') + } + + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: project.property('sonatype.username'), password: project.property('sonatype.password')) + } + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") { + authentication(userName: project.property('sonatype.username'), password: project.property('sonatype.password')) + } + version = System.getProperty('RELEASE_VERSION') + pom.project { + name 'continuity.api' + packaging 'jar' + description 'Library of continuITy defining exchange entities' + url 'https://continuity-project.github.io/' + scm { + url "https://github.com/ContinuITy-Project/ContinuITy" + connection "scm:git:https://github.com/ContinuITy-Project/ContinuITy.git" + developerConnection "scm:git:git@github.com:ContinuITy-Project/ContinuITy.git" + } + issueManagement { + system 'jira' + url 'https://continuity-project.atlassian.net' + } + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + developers { + developer { + id 'ContinuITy-team' + name 'The ContinuITy Research Team' + organizationUrl 'https://continuity-project.github.io/' + } + } + } + } + } + } +} +/** + * When closing or releasing the staging repository it has to be done using the full task name: + * > gradle :continuity.api.java.sdk: + * + * Note: Always use the 'closeAndReleaseRepository' in the Jenkins build process. + */ +if (gradle.startParameter.getTaskNames().contains(":continuity.api:closeAndReleaseRepository") + || gradle.startParameter.getTaskNames().contains(":continuity.api:closeRepository") + || gradle.startParameter.getTaskNames().contains(":continuity.api:releaseRepository")) { + nexusStaging { + // check if necessary parameter exists + if (!project.hasProperty('sonatype.username') || !project.hasProperty('sonatype.password')) { + throw new GradleException('Credentials for Sonytype are missing.') + } + username = project.property('sonatype.username') + password = project.property('sonatype.password') + packageGroup = "com.github.continuity-project" + } +} \ No newline at end of file diff --git a/continuity.api/src/main/java/org/continuity/api/rest/RestApi.java b/continuity.api/src/main/java/org/continuity/api/rest/RestApi.java index 2ce28b66..cf2fbf45 100644 --- a/continuity.api/src/main/java/org/continuity/api/rest/RestApi.java +++ b/continuity.api/src/main/java/org/continuity/api/rest/RestApi.java @@ -779,7 +779,7 @@ private Paths() { /** * Generic, abstract REST endpoints. The implementing endpoints can be retrieved via the - * {@link Map#get(Object)} method, e.g., the JMeter {@link Model#OVERVIEW} via + * {@link Map#get(Object)} method, e.g., the JMeter {@link RestApi.Wessbas.Model#OVERVIEW} via * {@link Generic#WORKLOAD_MODEL_LINK}.get("jmeter"). * * @author Henning Schulz diff --git a/continuity.commons/continuity.commons.gradle b/continuity.commons/continuity.commons.gradle index 0aca18ca..89e37266 100644 --- a/continuity.commons/continuity.commons.gradle +++ b/continuity.commons/continuity.commons.gradle @@ -1,3 +1,8 @@ +/** Required plugins */ +plugins { + id "io.codearte.nexus-staging" version "0.8.0" +} + dependencies { compile project(':continuity.idpa') @@ -28,4 +33,112 @@ dependencies { // CSV parsing compile group: 'com.univocity', name: 'univocity-parsers', version: '2.7.5' -} \ No newline at end of file +} + +/** + * Creates jar with sources. + */ +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} +/** + * Creates jar with javadocs. + */ +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +/** + * Pushing to maven centeral. + */ +apply plugin: 'maven' +apply plugin: 'signing' +apply plugin: 'io.codearte.nexus-staging' +/** + * When uploading the archives it has to be done using the full task name: + * > gradle :continuity.commons:uploadArchives + */ +if (gradle.startParameter.getTaskNames().contains(":continuity.commons:uploadArchives")) { + // Artifacts to build + artifacts { + archives sourcesJar, javadocJar + } + // Sign the artifacts + signing { + sign configurations.archives + } + group = "com.github.continuity-project" + archivesBaseName = "continuity.commons" + // Uploads the signed artifacts + uploadArchives { + repositories { + mavenDeployer { + // check if necessary parameter exists + if (!project.hasProperty('sonatype.username') || !project.hasProperty('sonatype.password')) { + throw new GradleException('Credentials for Sonytype are missing.') + } + if (System.getProperty('RELEASE_VERSION') == null) { + throw new GradleException('The version of the library has to be specified. (Specified by "RELEASE_VERSION")') + } + + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: project.property('sonatype.username'), password: project.property('sonatype.password')) + } + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") { + authentication(userName: project.property('sonatype.username'), password: project.property('sonatype.password')) + } + version = System.getProperty('RELEASE_VERSION') + pom.project { + name 'continuity.commons' + packaging 'jar' + description 'Commons library of ContinuITy. Provides common functionalities.' + url 'https://continuity-project.github.io/' + scm { + url "https://github.com/ContinuITy-Project/ContinuITy" + connection "scm:git:https://github.com/ContinuITy-Project/ContinuITy.git" + developerConnection "scm:git:git@github.com:ContinuITy-Project/ContinuITy.git" + } + issueManagement { + system 'jira' + url 'https://continuity-project.atlassian.net' + } + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + developers { + developer { + id 'ContinuITy-team' + name 'The ContinuITy Research Team' + organizationUrl 'https://continuity-project.github.io/' + } + } + } + } + } + } +} +/** + * When closing or releasing the staging repository it has to be done using the full task name: + * > gradle :continuity.commons.java.sdk: + * + * Note: Always use the 'closeAndReleaseRepository' in the Jenkins build process. + */ +if (gradle.startParameter.getTaskNames().contains(":continuity.commons:closeAndReleaseRepository") + || gradle.startParameter.getTaskNames().contains(":continuity.commons:closeRepository") + || gradle.startParameter.getTaskNames().contains(":continuity.commons:releaseRepository")) { + nexusStaging { + // check if necessary parameter exists + if (!project.hasProperty('sonatype.username') || !project.hasProperty('sonatype.password')) { + throw new GradleException('Credentials for Sonytype are missing.') + } + username = project.property('sonatype.username') + password = project.property('sonatype.password') + packageGroup = "com.github.continuity-project" + } +} \ No newline at end of file diff --git a/continuity.commons/src/main/java/org/continuity/commons/idpa/RequestUriMapper.java b/continuity.commons/src/main/java/org/continuity/commons/idpa/RequestUriMapper.java index 67ee90b3..ac6e46a6 100644 --- a/continuity.commons/src/main/java/org/continuity/commons/idpa/RequestUriMapper.java +++ b/continuity.commons/src/main/java/org/continuity/commons/idpa/RequestUriMapper.java @@ -63,8 +63,8 @@ public HttpEndpoint mapRespectingWildcards(String uri, String method) { /** * Maps the specified URI to an {@link HttpEndpoint} that has the same URI. First, the URI is - * tested for exact similarity (by calling {@link #mapExactly(String)} and then, if there is not - * exact match, wildcards are respected (by calling {@link #mapRespectingWildcards(String)}. + * tested for exact similarity (by calling {@link #mapExactly(String, String)} and then, if there is not + * exact match, wildcards are respected (by calling {@link #mapRespectingWildcards(String, String)}. * * @param uri * The URI to be mapped. diff --git a/continuity.idpa/continuity.idpa.gradle b/continuity.idpa/continuity.idpa.gradle index a063d47c..a40d08fc 100644 --- a/continuity.idpa/continuity.idpa.gradle +++ b/continuity.idpa/continuity.idpa.gradle @@ -1,7 +1,119 @@ +/** Required plugins */ +plugins { + id "io.codearte.nexus-staging" version "0.8.0" +} dependencies { compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.1' compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.1' compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.1' compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1' -} \ No newline at end of file +} + +/** + * Creates jar with sources. + */ +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} +/** + * Creates jar with javadocs. + */ +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +/** + * Pushing to maven centeral. + */ +apply plugin: 'maven' +apply plugin: 'signing' +apply plugin: 'io.codearte.nexus-staging' +/** + * When uploading the archives it has to be done using the full task name: + * > gradle :continuity.idpa:uploadArchives + */ +if (gradle.startParameter.getTaskNames().contains(":continuity.idpa:uploadArchives")) { + // Artifacts to build + artifacts { + archives sourcesJar, javadocJar + } + // Sign the artifacts + signing { + sign configurations.archives + } + group = "com.github.continuity-project" + archivesBaseName = "continuity.idpa" + // Uploads the signed artifacts + uploadArchives { + repositories { + mavenDeployer { + // check if necessary parameter exists + if (!project.hasProperty('sonatype.username') || !project.hasProperty('sonatype.password')) { + throw new GradleException('Credentials for Sonytype are missing.') + } + if (System.getProperty('RELEASE_VERSION') == null) { + throw new GradleException('The version of the library has to be specified. (Specified by "RELEASE_VERSION")') + } + + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: project.property('sonatype.username'), password: project.property('sonatype.password')) + } + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") { + authentication(userName: project.property('sonatype.username'), password: project.property('sonatype.password')) + } + version = System.getProperty('RELEASE_VERSION') + pom.project { + name 'continuity.idpa' + packaging 'jar' + description 'Defines entities of the IDPA annotation model and the IDPA application model' + url 'https://continuity-project.github.io/' + scm { + url "https://github.com/ContinuITy-Project/ContinuITy" + connection "scm:git:https://github.com/ContinuITy-Project/ContinuITy.git" + developerConnection "scm:git:git@github.com:ContinuITy-Project/ContinuITy.git" + } + issueManagement { + system 'jira' + url 'https://continuity-project.atlassian.net' + } + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + developers { + developer { + id 'ContinuITy-team' + name 'The ContinuITy Research Team' + organizationUrl 'https://continuity-project.github.io/' + } + } + } + } + } + } +} +/** + * When closing or releasing the staging repository it has to be done using the full task name: + * > gradle :continuity.idpa.java.sdk: + * + * Note: Always use the 'closeAndReleaseRepository' in the Jenkins build process. + */ +if (gradle.startParameter.getTaskNames().contains(":continuity.idpa:closeAndReleaseRepository") + || gradle.startParameter.getTaskNames().contains(":continuity.idpa:closeRepository") + || gradle.startParameter.getTaskNames().contains(":continuity.idpa:releaseRepository")) { + nexusStaging { + // check if necessary parameter exists + if (!project.hasProperty('sonatype.username') || !project.hasProperty('sonatype.password')) { + throw new GradleException('Credentials for Sonytype are missing.') + } + username = project.property('sonatype.username') + password = project.property('sonatype.password') + packageGroup = "com.github.continuity-project" + } +} \ No newline at end of file diff --git a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/AbstractValueExtraction.java b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/AbstractValueExtraction.java index 795be972..087b2073 100644 --- a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/AbstractValueExtraction.java +++ b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/AbstractValueExtraction.java @@ -44,7 +44,7 @@ public WeakReference> getFrom() { /** * Sets the interface from which the value is extracted. * - * @param extracted + * @param from * The extracted interface. */ public void setFrom(WeakReference> from) { @@ -55,7 +55,7 @@ public void setFrom(WeakReference> from) { * Gets the key. Can be used to specify a specific response, e.g., the header or body of an HTTP * response. * - * @return {@link #key} The key. + * @return {@link #responseKey} The key. */ @Override public String getResponseKey() { @@ -66,7 +66,7 @@ public String getResponseKey() { * Sets the key. Can be used to specify a specific response, e.g., the header or body of an HTTP * response. * - * @param key + * @param responseKey * The key. */ public void setResponseKey(String responseKey) { diff --git a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/CsvInput.java b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/CsvInput.java index 49240161..f58c1b9e 100644 --- a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/CsvInput.java +++ b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/CsvInput.java @@ -40,7 +40,7 @@ public String getFilename() { /** * Sets the filename of the CSV file. * - * @param name + * @param filename * The filename. */ public void setFilename(String filename) { diff --git a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/OverrideableAnnotation.java b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/OverrideableAnnotation.java index 259a2583..79816dc8 100644 --- a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/OverrideableAnnotation.java +++ b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/OverrideableAnnotation.java @@ -10,7 +10,7 @@ * * @author Henning Schulz * - * @param + * @param * Annotated type. */ public class OverrideableAnnotation extends AbstractIdpaElement { diff --git a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/PropertyOverrideKey.java b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/PropertyOverrideKey.java index a393fbc5..d663c28c 100644 --- a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/PropertyOverrideKey.java +++ b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/PropertyOverrideKey.java @@ -70,8 +70,6 @@ public static Any fromPrintableString(String string) { * * @author Henning Schulz * - * @param - * The type of element holding the overridden value. */ @JsonTypeInfo(use = Id.NAME, include = As.PROPERTY) @JsonSubTypes({ @Type(value = HttpEndpoint.class), @Type(value = HttpParameter.class) }) diff --git a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/ValueExtraction.java b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/ValueExtraction.java index f4ec1817..dcdf7ada 100644 --- a/continuity.idpa/src/main/java/org/continuity/idpa/annotation/ValueExtraction.java +++ b/continuity.idpa/src/main/java/org/continuity/idpa/annotation/ValueExtraction.java @@ -17,7 +17,7 @@ public interface ValueExtraction extends IdpaElement { * Gets the key. Can be used to specify a specific response, e.g., the header or body of an HTTP * response. * - * @return {@link #key} The key. + * @return The key. */ String getResponseKey(); diff --git a/continuity.idpa/src/main/java/org/continuity/idpa/visitor/FindBy.java b/continuity.idpa/src/main/java/org/continuity/idpa/visitor/FindBy.java index 0f36e071..e8bfffa4 100644 --- a/continuity.idpa/src/main/java/org/continuity/idpa/visitor/FindBy.java +++ b/continuity.idpa/src/main/java/org/continuity/idpa/visitor/FindBy.java @@ -50,7 +50,7 @@ public static FindBy find(Predicate condition, Cla * The id of the element to be found. * @param type * The type of the element to be found. - * @return A created instance of {@link FindById}. + * @return A created instance of {@link FindBy}. */ public static FindBy findById(String id, Class type) { return new FindBy<>(elem -> Objects.equals(id, elem.getId()), type); @@ -62,7 +62,7 @@ public static FindBy findById(String id, Class typ * * @param element * The model element to search in. - * @return The same instance of {@link FindById}. + * @return The same instance of {@link FindBy}. */ public FindBy in(IdpaElement element) { IdpaByClassSearcher searcher = new IdpaByClassSearcher<>(type, this::accept); diff --git a/secring.gpg.enc b/secring.gpg.enc new file mode 100644 index 00000000..43366731 Binary files /dev/null and b/secring.gpg.enc differ