From c0791523d82d566f9ed485643245c969e1f4ba00 Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 10:10:53 +0200 Subject: [PATCH 01/13] Ignore intellij files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 63afe7d..09396ba 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ target # git files *.swp readme.html + +# intellij +.idea \ No newline at end of file From 714bca97916927a3fe93a539dc1a1baa051ea4fe Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 10:17:37 +0200 Subject: [PATCH 02/13] Reformat xml files --- .../META-INF/maven/archetype-metadata.xml | 8 +- .../archetype-resources/plugin/pom.xml | 21 ++--- .../resources/archetype-resources/pom.xml | 67 +++++++-------- .../archetype-resources/test/pom.xml | 11 +-- .../archetype-resources/update-site/pom.xml | 83 ++++++++++--------- 5 files changed, 98 insertions(+), 92 deletions(-) diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml index 9e2d544..231e00f 100644 --- a/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -1,7 +1,9 @@ - + diff --git a/src/main/resources/archetype-resources/plugin/pom.xml b/src/main/resources/archetype-resources/plugin/pom.xml index 63e4041..59ca55f 100644 --- a/src/main/resources/archetype-resources/plugin/pom.xml +++ b/src/main/resources/archetype-resources/plugin/pom.xml @@ -1,14 +1,15 @@ - - 4.0.0 - ${groupId} - eclipse-plugin + + 4.0.0 + ${groupId} + eclipse-plugin - - ${groupId} - ${rootArtifactId} - ${version} - ../ - + + ${groupId} + ${rootArtifactId} + ${version} + ../ + diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index ba45e72..df592f3 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -1,35 +1,36 @@ - - 4.0.0 + + 4.0.0 ${groupId} - ${artifactId} + ${artifactId} ${version} - pom + pom - - UTF-8 - 1.0.0 - + + UTF-8 + 1.0.0 + - - - junit - junit - 4.12 + + + junit + junit + 4.12 test - - - com.siemens.bt.jazz.services.base - com.siemens.bt.jazz.services.base - 2.0.1-SNAPSHOT - - - com.google.code.gson - gson - 2.7 - - + + + com.siemens.bt.jazz.services.base + com.siemens.bt.jazz.services.base + 2.0.1-SNAPSHOT + + + com.google.code.gson + gson + 2.7 + + plugin @@ -39,14 +40,14 @@ - - - org.apache.maven.plugins - maven-dependency-plugin - 3.0.0 - - - copy-dependencies-init + + + org.apache.maven.plugins + maven-dependency-plugin + 3.0.0 + + + copy-dependencies-init initialize copy-dependencies diff --git a/src/main/resources/archetype-resources/test/pom.xml b/src/main/resources/archetype-resources/test/pom.xml index 39d5db4..73934ce 100644 --- a/src/main/resources/archetype-resources/test/pom.xml +++ b/src/main/resources/archetype-resources/test/pom.xml @@ -1,15 +1,16 @@ - - 4.0.0 + + 4.0.0 ${groupId}.test eclipse-test-plugin - + ${groupId} ${rootArtifactId} ${version} - ../ - + ../ + diff --git a/src/main/resources/archetype-resources/update-site/pom.xml b/src/main/resources/archetype-resources/update-site/pom.xml index c234e46..8ee9f39 100644 --- a/src/main/resources/archetype-resources/update-site/pom.xml +++ b/src/main/resources/archetype-resources/update-site/pom.xml @@ -1,46 +1,47 @@ - - 4.0.0 - ${groupId}.updatesite - eclipse-repository + + 4.0.0 + ${groupId}.updatesite + eclipse-repository - - ${groupId} - ${rootArtifactId} - ${version} - ../ - + + ${groupId} + ${rootArtifactId} + ${version} + ../ + - - - - templates/category - true - ../../ - - - templates/deployment - true - - - - - maven-assembly-plugin - + + + + templates/category + true + ../../ + + + templates/deployment + true + + + + + maven-assembly-plugin + false - - templates/zip.xml - - - - - package - - single - - - - - - + + templates/zip.xml + + + + + package + + single + + + + + + From 0389184f9bded03856e21eb60f585e2c8eeba82c Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 10:23:42 +0200 Subject: [PATCH 03/13] Use tycho version 1.1.0 --- src/main/resources/archetype-resources/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index df592f3..3f20144 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -10,7 +10,7 @@ UTF-8 - 1.0.0 + 1.1.0 From 86214f35f62927e5454179e9e8c0905ec6dc9b58 Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 10:26:12 +0200 Subject: [PATCH 04/13] Use newest stable gson --- src/main/resources/archetype-resources/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index 3f20144..3acc55f 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -28,7 +28,7 @@ com.google.code.gson gson - 2.7 + 2.8.5 From 744e62434aa44980f2a6212559a1525a10eb1127 Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 10:26:34 +0200 Subject: [PATCH 05/13] Move dependency to version 3 of base service --- src/main/resources/archetype-resources/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index 3acc55f..8939023 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -23,7 +23,7 @@ com.siemens.bt.jazz.services.base com.siemens.bt.jazz.services.base - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT com.google.code.gson From 92bcc519c17518ef7ad78b4e02dab5dd295d6a07 Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 11:11:51 +0200 Subject: [PATCH 06/13] Use new features in all examples --- .../plugin/META-INF/MANIFEST.MF | 4 +- .../plugin/src/main/java/__serviceName__.java | 6 +-- .../java/builder/HelloWorldPostService.java | 43 ++++++++----------- .../main/java/builder/HelloWorldService.java | 14 ++++-- .../test/META-INF/MANIFEST.MF | 4 +- 5 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF b/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF index 43d0572..bb1bc1e 100644 --- a/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF +++ b/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF @@ -31,8 +31,8 @@ Require-Bundle: com.ibm.team.jfs.app.error, com.ibm.team.process.common, com.ibm.team.process.service -Bundle-ClassPath: target/dependency/gson-2.7.jar, - target/dependency/com.siemens.bt.jazz.services.base-2.0.1-SNAPSHOT.jar, +Bundle-ClassPath: target/dependency/gson-2.8.5.jar, + target/dependency/com.siemens.bt.jazz.services.base-3.0.0-SNAPSHOT.jar, . Import-Package: com.ibm.team.jfs.app, com.ibm.team.jfs.app.http.util, diff --git a/src/main/resources/archetype-resources/plugin/src/main/java/__serviceName__.java b/src/main/resources/archetype-resources/plugin/src/main/java/__serviceName__.java index a225784..2fb4643 100644 --- a/src/main/resources/archetype-resources/plugin/src/main/java/__serviceName__.java +++ b/src/main/resources/archetype-resources/plugin/src/main/java/__serviceName__.java @@ -3,9 +3,7 @@ #set( $symbol_escape = '\' ) package ${package}; -import com.ibm.team.jfs.app.http.util.HttpConstants.HttpMethod; import com.siemens.bt.jazz.services.base.BaseService; -import com.siemens.bt.jazz.services.base.router.factory.RestFactory; import ${package}.builder.HelloWorldPostService; import ${package}.builder.HelloWorldService; @@ -23,7 +21,7 @@ public class ${serviceName} extends BaseService implements I${serviceName} { */ public ${serviceName}() { super(); - router.addService(HttpMethod.GET, "helloWorld", new RestFactory(HelloWorldService.class)); - router.addService(HttpMethod.POST, "helloWorld", new RestFactory(HelloWorldPostService.class)); + router.get("helloWorld", HelloWorldService.class); + router.post("helloWorld", HelloWorldPostService.class); } } diff --git a/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldPostService.java b/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldPostService.java index dd3c080..196676f 100644 --- a/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldPostService.java +++ b/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldPostService.java @@ -3,39 +3,32 @@ #set( $symbol_escape = '\' ) package ${package}.builder; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URISyntaxException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.siemens.bt.jazz.services.base.rest.RestRequest; +import com.ibm.team.repository.service.TeamRawService; +import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters; +import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest; +import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService; +import com.siemens.bt.jazz.services.base.utils.RequestReader; import org.apache.commons.logging.Log; import org.apache.http.auth.AuthenticationException; -import com.ibm.team.repository.service.TeamRawService; -import com.siemens.bt.jazz.services.base.rest.AbstractRestService; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URISyntaxException; public final class HelloWorldPostService extends AbstractRestService { - public HelloWorldPostService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService) { - super(log, request, response, restRequest, parentService); + public HelloWorldPostService( + Log log, HttpServletRequest request, + HttpServletResponse response, + RestRequest restRequest, + TeamRawService parentService, + PathParameters pathParameters) { + super(log, request, response, restRequest, parentService, pathParameters); } public void execute() throws IOException, URISyntaxException, AuthenticationException { - BufferedReader reader = new BufferedReader( - new InputStreamReader( - request.getInputStream())); - //BufferedReader reader = request.getReader(); - StringBuilder builder = new StringBuilder(request.getContentLength()); - - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - builder.append(line); - } - - String content = builder.toString(); - response.getWriter().write("POST successful! The following data was sent:${symbol_escape}n" + content); + String content = RequestReader.readAsString(request); + response.getWriter().write("POST successful! The following data was sent:\n" + content); } } diff --git a/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldService.java b/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldService.java index b242815..cc111d5 100644 --- a/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldService.java +++ b/src/main/resources/archetype-resources/plugin/src/main/java/builder/HelloWorldService.java @@ -3,6 +3,9 @@ #set( $symbol_escape = '\' ) package ${package}.builder; +import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters; +import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest; +import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService; import java.io.IOException; import java.io.Writer; import java.net.URISyntaxException; @@ -11,15 +14,18 @@ import javax.servlet.http.HttpServletResponse; import com.ibm.team.repository.service.TeamRawService; -import com.siemens.bt.jazz.services.base.rest.AbstractRestService; -import com.siemens.bt.jazz.services.base.rest.RestRequest; import org.apache.commons.logging.Log; import org.apache.http.auth.AuthenticationException; public class HelloWorldService extends AbstractRestService { - public HelloWorldService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService) { - super(log, request, response, restRequest, parentService); + public HelloWorldService( + Log log, HttpServletRequest request, + HttpServletResponse response, + RestRequest restRequest, + TeamRawService parentService, + PathParameters pathParameters) { + super(log, request, response, restRequest, parentService, pathParameters); } /** diff --git a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF index 2a21492..faa8748 100644 --- a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF +++ b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF @@ -7,8 +7,8 @@ Bundle-Vendor: VENDOR Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ClassPath: target/dependency/junit-4.12.jar, target/dependency/hamcrest-core-1.3.jar, - target/dependency/gson-2.7.jar, - target/dependency/com.siemens.bt.jazz.services.base-2.0.1-SNAPSHOT.jar, + target/dependency/gson-2.8.5.jar, + target/dependency/com.siemens.bt.jazz.services.base-3.0.0-SNAPSHOT.jar, . Require-Bundle: com.ibm.team.repository.common, com.ibm.team.repository.service, From d3c754a22244227e46acc8acfc5beaa6f0e471e4 Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 11:39:33 +0200 Subject: [PATCH 07/13] Match archetype version with base service --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d5b50e..bf00614 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.siemens.bt.jazz.services.archetype com.siemens.bt.jazz.services.archetype - 2.0.1-SNAPSHOT + 3.0.0-SNAPSHOT maven-archetype com.siemens.bt.jazz.services.archetype From 9cbad42cdfccf53699c5fa92a07ffbc367868ead Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 17:58:05 +0200 Subject: [PATCH 08/13] Add filtering for qualified version in build xml --- .../archetype-resources/plugin/plugin.xml | 2 +- .../resources/archetype-resources/plugin/pom.xml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/resources/archetype-resources/plugin/plugin.xml b/src/main/resources/archetype-resources/plugin/plugin.xml index 5741dd8..b1f8be4 100644 --- a/src/main/resources/archetype-resources/plugin/plugin.xml +++ b/src/main/resources/archetype-resources/plugin/plugin.xml @@ -14,7 +14,7 @@ name="REST Service" kind="MODELLED_REST" uri="${package}.I${serviceName}" - version="1"> + version="${qualifiedVersion}"> diff --git a/src/main/resources/archetype-resources/plugin/pom.xml b/src/main/resources/archetype-resources/plugin/pom.xml index 59ca55f..58645eb 100644 --- a/src/main/resources/archetype-resources/plugin/pom.xml +++ b/src/main/resources/archetype-resources/plugin/pom.xml @@ -12,4 +12,20 @@ ../ + + + + ${basedir} + true + + plugin.xml + + + + ${basedir}/src/main/resources + false + + + + From 0e032b9a77f435efee09366756fa95cb34e20b6a Mon Sep 17 00:00:00 2001 From: SBI- Date: Wed, 4 Jul 2018 18:19:58 +0200 Subject: [PATCH 09/13] Add project to test manifest --- src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF index faa8748..a7df5f3 100644 --- a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF +++ b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF @@ -9,6 +9,7 @@ Bundle-ClassPath: target/dependency/junit-4.12.jar, target/dependency/hamcrest-core-1.3.jar, target/dependency/gson-2.8.5.jar, target/dependency/com.siemens.bt.jazz.services.base-3.0.0-SNAPSHOT.jar, + target/dependency/${groupId}-1.0.0-SNAPSHOT.jar, . Require-Bundle: com.ibm.team.repository.common, com.ibm.team.repository.service, From 9b787e15f58c53a8fffdb5ab9fc6871662507328 Mon Sep 17 00:00:00 2001 From: SBI- Date: Thu, 5 Jul 2018 08:58:16 +0200 Subject: [PATCH 10/13] Add service jar with version to test manifest --- .../resources/archetype-resources/test/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF index a7df5f3..621940c 100644 --- a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF +++ b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Bundle-ClassPath: target/dependency/junit-4.12.jar, target/dependency/hamcrest-core-1.3.jar, target/dependency/gson-2.8.5.jar, target/dependency/com.siemens.bt.jazz.services.base-3.0.0-SNAPSHOT.jar, - target/dependency/${groupId}-1.0.0-SNAPSHOT.jar, + target/dependency/${groupId}-${version}.jar, . Require-Bundle: com.ibm.team.repository.common, com.ibm.team.repository.service, From 01527a31a5bca8b10ff6392fbf190563f7c7749c Mon Sep 17 00:00:00 2001 From: SBI- Date: Thu, 5 Jul 2018 09:49:53 +0200 Subject: [PATCH 11/13] Add snapshot implicitly to every project --- setup.ps1 | 6 ++---- setup.sh | 6 ++---- src/main/resources/archetype-resources/feature/feature.xml | 2 +- src/main/resources/archetype-resources/feature/pom.xml | 2 +- .../archetype-resources/plugin/META-INF/MANIFEST.MF | 2 +- src/main/resources/archetype-resources/plugin/pom.xml | 2 +- src/main/resources/archetype-resources/pom.xml | 2 +- .../resources/archetype-resources/test/META-INF/MANIFEST.MF | 4 ++-- src/main/resources/archetype-resources/test/pom.xml | 2 +- src/main/resources/archetype-resources/update-site/pom.xml | 2 +- 10 files changed, 13 insertions(+), 17 deletions(-) diff --git a/setup.ps1 b/setup.ps1 index f4c644e..b4f0f4c 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -1,6 +1,6 @@ param ( [Alias('g')][string]$group, - [Alias('v')][string]$version = "1.0.0-SNAPSHOT", + [Alias('v')][string]$version = "1.0.0", # maybe make sure that the service name is always # capitalized? [Alias('s')][string]$serviceName = "ExampleService" @@ -23,12 +23,10 @@ mvn archetype:generate -B ` "-DarchetypeCatalog=local" ` "-DarchetypeGroupId=com.siemens.bt.jazz.services.archetype" ` "-DarchetypeArtifactId=com.siemens.bt.jazz.services.archetype" ` - "-Dversion=1.0.0-SNAPSHOT" ` + "-Dversion=1.0.0" ` "-DgroupId=$group" ` "-DartifactId=$group.parent" ` "-Dpackage=$group" ` "-DserviceName=$serviceName" cd "$group.parent" - -mvn org.eclipse.tycho:tycho-versions-plugin:set-version "-DnewVersion=$version" diff --git a/setup.sh b/setup.sh index 069bed2..f5ca791 100755 --- a/setup.sh +++ b/setup.sh @@ -8,7 +8,7 @@ eval set -- "$temp" # default parameters group="com.siemens.example" serviceName="ExampleService" -version="1.0.0-SNAPSHOT" +version="1.0.0" # handle optional parameters while true; do @@ -34,7 +34,7 @@ mvn archetype:generate -B \ "-DarchetypeCatalog=local" \ "-DarchetypeGroupId=com.siemens.bt.jazz.services.archetype" \ "-DarchetypeArtifactId=com.siemens.bt.jazz.services.archetype" \ - "-Dversion=1.0.0-SNAPSHOT" \ + "-Dversion=$version" \ "-DgroupId=$group" \ "-DartifactId=$group.parent" \ "-Dpackage=$group" \ @@ -46,5 +46,3 @@ if [ $? -ne 0 ]; then fi cd "$group.parent" - -mvn org.eclipse.tycho:tycho-versions-plugin:set-version "-DnewVersion=$version" diff --git a/src/main/resources/archetype-resources/feature/feature.xml b/src/main/resources/archetype-resources/feature/feature.xml index e8dcd75..03cd2d0 100644 --- a/src/main/resources/archetype-resources/feature/feature.xml +++ b/src/main/resources/archetype-resources/feature/feature.xml @@ -5,7 +5,7 @@ diff --git a/src/main/resources/archetype-resources/feature/pom.xml b/src/main/resources/archetype-resources/feature/pom.xml index ec5df87..d762483 100644 --- a/src/main/resources/archetype-resources/feature/pom.xml +++ b/src/main/resources/archetype-resources/feature/pom.xml @@ -7,7 +7,7 @@ ${groupId} ${rootArtifactId} - ${version} + ${version}-SNAPSHOT ../ diff --git a/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF b/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF index bb1bc1e..cb31cab 100644 --- a/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF +++ b/src/main/resources/archetype-resources/plugin/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: ${groupId} Bundle-SymbolicName: ${groupId};singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: ${version}.qualifier Bundle-Vendor: VENDOR Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Require-Bundle: diff --git a/src/main/resources/archetype-resources/plugin/pom.xml b/src/main/resources/archetype-resources/plugin/pom.xml index 58645eb..6e12342 100644 --- a/src/main/resources/archetype-resources/plugin/pom.xml +++ b/src/main/resources/archetype-resources/plugin/pom.xml @@ -8,7 +8,7 @@ ${groupId} ${rootArtifactId} - ${version} + ${version}-SNAPSHOT ../ diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml index 8939023..4bf4a11 100644 --- a/src/main/resources/archetype-resources/pom.xml +++ b/src/main/resources/archetype-resources/pom.xml @@ -5,7 +5,7 @@ ${groupId} ${artifactId} - ${version} + ${version}-SNAPSHOT pom diff --git a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF index 621940c..a477578 100644 --- a/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF +++ b/src/main/resources/archetype-resources/test/META-INF/MANIFEST.MF @@ -2,14 +2,14 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: ${groupId} Bundle-SymbolicName: ${groupId}.test;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: ${version}.qualifier Bundle-Vendor: VENDOR Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ClassPath: target/dependency/junit-4.12.jar, target/dependency/hamcrest-core-1.3.jar, target/dependency/gson-2.8.5.jar, target/dependency/com.siemens.bt.jazz.services.base-3.0.0-SNAPSHOT.jar, - target/dependency/${groupId}-${version}.jar, + target/dependency/${groupId}-${version}-SNAPSHOT.jar, . Require-Bundle: com.ibm.team.repository.common, com.ibm.team.repository.service, diff --git a/src/main/resources/archetype-resources/test/pom.xml b/src/main/resources/archetype-resources/test/pom.xml index 73934ce..73434f2 100644 --- a/src/main/resources/archetype-resources/test/pom.xml +++ b/src/main/resources/archetype-resources/test/pom.xml @@ -8,7 +8,7 @@ ${groupId} ${rootArtifactId} - ${version} + ${version}-SNAPSHOT ../ diff --git a/src/main/resources/archetype-resources/update-site/pom.xml b/src/main/resources/archetype-resources/update-site/pom.xml index 8ee9f39..02e895a 100644 --- a/src/main/resources/archetype-resources/update-site/pom.xml +++ b/src/main/resources/archetype-resources/update-site/pom.xml @@ -8,7 +8,7 @@ ${groupId} ${rootArtifactId} - ${version} + ${version}-SNAPSHOT ../ From 471236f38f1b42392f257f85ba229538e7bf5d58 Mon Sep 17 00:00:00 2001 From: SBI- Date: Thu, 5 Jul 2018 09:54:18 +0200 Subject: [PATCH 12/13] Fix version in powershell setup file --- setup.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.ps1 b/setup.ps1 index b4f0f4c..cbaca2f 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -23,7 +23,7 @@ mvn archetype:generate -B ` "-DarchetypeCatalog=local" ` "-DarchetypeGroupId=com.siemens.bt.jazz.services.archetype" ` "-DarchetypeArtifactId=com.siemens.bt.jazz.services.archetype" ` - "-Dversion=1.0.0" ` + "-Dversion=$version" ` "-DgroupId=$group" ` "-DartifactId=$group.parent" ` "-Dpackage=$group" ` From a790584b3bfce2736f1afb01c3588f4a323d64fe Mon Sep 17 00:00:00 2001 From: SBI- Date: Thu, 5 Jul 2018 10:14:16 +0200 Subject: [PATCH 13/13] Update readme to account for implicit snapshot --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 662a6d0..9795626 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,12 @@ This section shows how to create an example service from the archetype. It uses 5. You can now run `mvn package` from inside the `target/com.siemens.example.parent` folder to build the example service plugin. ## Bootstrapping a new jazz service using this archetype -Using paramters when running the automated setup, a new service can be created with proper package declaration, groupId and names already set. Passing the right parameters will allow you to get coding right away. In this example, I will demonstrate how to create a service with the groupId `org.company.example`, a version of `0.0.1-SNAPSHOT` and a service named `GitHubExampleService`. +Using paramters when running the automated setup, a new service can be created with proper package declaration, groupId and names already set. Passing the right parameters will allow you to get coding right away. In this example, I will demonstrate how to create a service with the groupId `org.company.example`, a version of `0.0.1` and a service named `GitHubExampleService`. 1. Clone this repository: `git clone https://github.com/jazz-community/jazz-plugin-maven-archetype.git` 2. Run the setup script, but this time passing values to all parameters (chose your own values, short parameters are available): - * Windows Powershell: `.\setup.ps1 -group org.siemens.example -version 0.0.1-SNAPSHOT -serviceName GitHubExampleService` - * Linux: `./setup.sh --group com.siemens.example --serviceName GitHubExampleService --version 0.0.1-SNAPSHOT` + * Windows Powershell: `.\setup.ps1 -group org.siemens.example -version 0.0.1 -serviceName GitHubExampleService` + * Linux: `./setup.sh --group com.siemens.example --serviceName GitHubExampleService --version 0.0.1` 3. As above, this will place a plugin folder structure called `org.siemens.example.parent` in the target folder. 4. Copy this folder to wherever you want to work on your plugin. 5. Run `mvn package` to build the plugin files required to run the plugin as a service from this location, or run `mvn install` to make the package available in your maven repository. @@ -112,7 +112,9 @@ This also makes sure that the correct snapshot and qualifier strings are set in ## Dependency versions If the versions of your dependencies change, there is no other way than adjusting the pom and manifest.mf files by hand. Make sure that the versions you want to use are consistent across these files, otherwise you will get build errors. Use any text editor to make changes. -This is also necessesary when you add dependencies. Changes have to be made to the pom as well as the manifest.mf files. You can use the existing entries as a guide of how to define dependencies so that maven resolves and copies them to the right places. +This is also necessary when you add dependencies. Changes have to be made to the pom as well as the manifest.mf files. You can use the existing entries as a guide of how to define dependencies so that maven resolves and copies them to the right places. + +Make sure that you change the dependency on your own project in the test manifest when you adjust the project version. The test project has to depend on it's plugin, but these versions are not adjusted automatically. Remember to keep your test manifest file up to speed with your plugin manifest file. Your tests will likely use the same dependencies as the implementation.