diff --git a/README.md b/README.md index 1e3b88a936..31ea088395 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,49 @@ _contractsDir_ - contract definitions: _generatedTestSourcesDir_ - Generated accurest specifications: /target/generated-test-sources/accurest + +Publishing wiremock stubs (projectF-stubs.jar) +--- + +Project configuration + +```xml + + io.codearte.accurest + accurest-maven-plugin + ${accurest.version} + + + + generateStubs + + + + + + maven-assembly-plugin + 2.6 + + + io.codearte.accurest + stubs-assembly-descriptor + ${accurest.version} + + + + + package + + single + + + + + + stubs + + + +``` + +Deploy to artifact repository using `mvn deploy` diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml new file mode 100644 index 0000000000..19ccaca94b --- /dev/null +++ b/maven-plugin/pom.xml @@ -0,0 +1,126 @@ + + + 4.0.0 + + + io.codearte.accurest + accurest-maven-project + 1.0-SNAPSHOT + + + accurest-maven-plugin + takari-maven-plugin + + + + io.codearte.accurest + accurest-core + 1.0.1 + + + io.codearte.accurest + accurest-converters + 1.0.1 + + + ch.qos.logback + logback-classic + 1.1.6 + test + + + + org.codehaus.groovy + groovy-all + 2.4.6 + + + + org.apache.maven + maven-core + ${mavenVersion} + test + + + org.apache.maven + maven-compat + ${mavenVersion} + test + + + + org.apache.maven + maven-plugin-api + ${mavenVersion} + provided + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${mavenPluginPluginVersion} + provided + + + + io.takari.maven.plugins + takari-plugin-testing + 2.8.0 + test + + + io.takari.maven.plugins + takari-plugin-integration-testing + 2.8.0 + pom + test + + + junit + junit + 4.12 + test + + + + + + io.takari.maven.plugins + takari-lifecycle-plugin + 1.11.12 + true + + none + + + + org.jacoco + jacoco-maven-plugin + 0.7.6.201602180812 + + + prepare-agent + + prepare-agent + + + + report + + report + + + + + + + org.eluder.coveralls + coveralls-maven-plugin + 4.1.0 + + + + + + \ No newline at end of file diff --git a/src/main/java/io/codearte/accurest/maven/GenerateSpecsMojo.java b/maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateSpecsMojo.java similarity index 100% rename from src/main/java/io/codearte/accurest/maven/GenerateSpecsMojo.java rename to maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateSpecsMojo.java diff --git a/src/main/java/io/codearte/accurest/maven/GenerateStubsMojo.java b/maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateStubsMojo.java similarity index 100% rename from src/main/java/io/codearte/accurest/maven/GenerateStubsMojo.java rename to maven-plugin/src/main/java/io/codearte/accurest/maven/GenerateStubsMojo.java diff --git a/src/test/java/io/codearte/accurest/maven/PluginIntegrationTest.java b/maven-plugin/src/test/java/io/codearte/accurest/maven/PluginIntegrationTest.java similarity index 100% rename from src/test/java/io/codearte/accurest/maven/PluginIntegrationTest.java rename to maven-plugin/src/test/java/io/codearte/accurest/maven/PluginIntegrationTest.java diff --git a/src/test/java/io/codearte/accurest/maven/PluginUnitTest.java b/maven-plugin/src/test/java/io/codearte/accurest/maven/PluginUnitTest.java similarity index 100% rename from src/test/java/io/codearte/accurest/maven/PluginUnitTest.java rename to maven-plugin/src/test/java/io/codearte/accurest/maven/PluginUnitTest.java diff --git a/src/test/projects/basic-with-execution/pom.xml b/maven-plugin/src/test/projects/basic-with-execution/pom.xml similarity index 100% rename from src/test/projects/basic-with-execution/pom.xml rename to maven-plugin/src/test/projects/basic-with-execution/pom.xml diff --git a/src/test/projects/basic-with-execution/src/test/resources/contracts/Sample.groovy b/maven-plugin/src/test/projects/basic-with-execution/src/test/resources/contracts/Sample.groovy similarity index 100% rename from src/test/projects/basic-with-execution/src/test/resources/contracts/Sample.groovy rename to maven-plugin/src/test/projects/basic-with-execution/src/test/resources/contracts/Sample.groovy diff --git a/src/test/projects/basic/pom.xml b/maven-plugin/src/test/projects/basic/pom.xml similarity index 100% rename from src/test/projects/basic/pom.xml rename to maven-plugin/src/test/projects/basic/pom.xml diff --git a/src/test/projects/basic/src/test/resources/contracts/Sample.groovy b/maven-plugin/src/test/projects/basic/src/test/resources/contracts/Sample.groovy similarity index 100% rename from src/test/projects/basic/src/test/resources/contracts/Sample.groovy rename to maven-plugin/src/test/projects/basic/src/test/resources/contracts/Sample.groovy diff --git a/src/test/projects/bootSimple/pom.xml b/maven-plugin/src/test/projects/bootSimple/pom.xml similarity index 73% rename from src/test/projects/bootSimple/pom.xml rename to maven-plugin/src/test/projects/bootSimple/pom.xml index 79ce6f2a4d..7dadbb7344 100644 --- a/src/test/projects/bootSimple/pom.xml +++ b/maven-plugin/src/test/projects/bootSimple/pom.xml @@ -21,6 +21,7 @@ UTF-8 1.8 + ${it-plugin.version} @@ -28,55 +29,22 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test test - org.codehaus.groovy groovy-all - - org.spockframework - spock-core - 1.0-groovy-2.4 - test - - - com.jayway.restassured - rest-assured - 2.9.0 - test - - - com.jayway.restassured - spring-mock-mvc - 2.9.0 - test - - - com.github.tomakehurst - wiremock - 2.0.4-beta - test - - - com.toomuchcoding.jsonassert - jsonassert - 0.2.2 - test - - - org.assertj - assertj-core - 2.3.0 - test + io.codearte.accurest + accurest-test-deps + ${accurest.version} + pom @@ -89,7 +57,7 @@ io.codearte.accurest accurest-maven-plugin - ${it-plugin.version} + ${accurest.version} @@ -142,8 +110,30 @@ + + maven-assembly-plugin + 2.6 + + + io.codearte.accurest + stubs-assembly-descriptor + ${accurest.version} + + + + + package + + single + + + + + + stubs + + + - - diff --git a/src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/PairIdController.groovy b/maven-plugin/src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/PairIdController.groovy similarity index 100% rename from src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/PairIdController.groovy rename to maven-plugin/src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/PairIdController.groovy diff --git a/src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/Tweet.java b/maven-plugin/src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/Tweet.java similarity index 100% rename from src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/Tweet.java rename to maven-plugin/src/test/projects/bootSimple/src/main/groovy/com/ofg/twitter/place/Tweet.java diff --git a/src/test/projects/bootSimple/src/main/java/io/codearte/sample/SampleSimpleBootApplication.java b/maven-plugin/src/test/projects/bootSimple/src/main/java/io/codearte/sample/SampleSimpleBootApplication.java similarity index 100% rename from src/test/projects/bootSimple/src/main/java/io/codearte/sample/SampleSimpleBootApplication.java rename to maven-plugin/src/test/projects/bootSimple/src/main/java/io/codearte/sample/SampleSimpleBootApplication.java diff --git a/src/test/projects/bootSimple/src/main/resources/application.properties b/maven-plugin/src/test/projects/bootSimple/src/main/resources/application.properties similarity index 100% rename from src/test/projects/bootSimple/src/main/resources/application.properties rename to maven-plugin/src/test/projects/bootSimple/src/main/resources/application.properties diff --git a/src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/AcceptanceSpec.groovy b/maven-plugin/src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/AcceptanceSpec.groovy similarity index 100% rename from src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/AcceptanceSpec.groovy rename to maven-plugin/src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/AcceptanceSpec.groovy diff --git a/src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/BaseMockMvcSpec.groovy b/maven-plugin/src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/BaseMockMvcSpec.groovy similarity index 100% rename from src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/BaseMockMvcSpec.groovy rename to maven-plugin/src/test/projects/bootSimple/src/test/groovy/com/ofg/twitter/place/BaseMockMvcSpec.groovy diff --git a/src/test/projects/bootSimple/src/test/java/io/codearte/sample/SampleSimpleBootApplicationTests.java b/maven-plugin/src/test/projects/bootSimple/src/test/java/io/codearte/sample/SampleSimpleBootApplicationTests.java similarity index 100% rename from src/test/projects/bootSimple/src/test/java/io/codearte/sample/SampleSimpleBootApplicationTests.java rename to maven-plugin/src/test/projects/bootSimple/src/test/java/io/codearte/sample/SampleSimpleBootApplicationTests.java diff --git a/src/test/projects/bootSimple/src/test/resources/logback-test.groovy b/maven-plugin/src/test/projects/bootSimple/src/test/resources/logback-test.groovy similarity index 100% rename from src/test/projects/bootSimple/src/test/resources/logback-test.groovy rename to maven-plugin/src/test/projects/bootSimple/src/test/resources/logback-test.groovy diff --git a/src/test/projects/bootSimple/src/test/resources/stubs/collerate_PlacesFrom_Tweet.groovy b/maven-plugin/src/test/projects/bootSimple/src/test/resources/stubs/collerate_PlacesFrom_Tweet.groovy similarity index 100% rename from src/test/projects/bootSimple/src/test/resources/stubs/collerate_PlacesFrom_Tweet.groovy rename to maven-plugin/src/test/projects/bootSimple/src/test/resources/stubs/collerate_PlacesFrom_Tweet.groovy diff --git a/src/test/projects/bootSimple/src/test/resources/stubs/moreComplexVersion.groovy b/maven-plugin/src/test/projects/bootSimple/src/test/resources/stubs/moreComplexVersion.groovy similarity index 100% rename from src/test/projects/bootSimple/src/test/resources/stubs/moreComplexVersion.groovy rename to maven-plugin/src/test/projects/bootSimple/src/test/resources/stubs/moreComplexVersion.groovy diff --git a/src/test/projects/withStubs/pom.xml b/maven-plugin/src/test/projects/withStubs/pom.xml similarity index 100% rename from src/test/projects/withStubs/pom.xml rename to maven-plugin/src/test/projects/withStubs/pom.xml diff --git a/src/test/projects/withStubs/src/test/resources/stubs/Sample.groovy b/maven-plugin/src/test/projects/withStubs/src/test/resources/stubs/Sample.groovy similarity index 100% rename from src/test/projects/withStubs/src/test/resources/stubs/Sample.groovy rename to maven-plugin/src/test/projects/withStubs/src/test/resources/stubs/Sample.groovy diff --git a/pom.xml b/pom.xml index 72faff14f2..8edbc6c529 100644 --- a/pom.xml +++ b/pom.xml @@ -5,10 +5,16 @@ 4.0.0 io.codearte.accurest - accurest-maven-plugin + accurest-maven-project 1.0-SNAPSHOT - takari-maven-plugin + + stubs-assembly-descriptor + test-deps + maven-plugin + + + pom 3.2.5 @@ -50,114 +56,78 @@ - - - io.codearte.accurest - accurest-core - 1.0.1 - - - io.codearte.accurest - accurest-converters - 1.0.1 - - - ch.qos.logback - logback-classic - 1.1.6 - test - + + + + io.codearte.accurest + accurest-core + 1.0.1 + + + io.codearte.accurest + accurest-converters + 1.0.1 + + + ch.qos.logback + logback-classic + 1.1.6 + test + - - org.codehaus.groovy - groovy-all - 2.4.6 - + + org.codehaus.groovy + groovy-all + 2.4.6 + - - org.apache.maven - maven-core - ${mavenVersion} - test - - - org.apache.maven - maven-compat - ${mavenVersion} - test - + + org.apache.maven + maven-core + ${mavenVersion} + test + + + org.apache.maven + maven-compat + ${mavenVersion} + test + - - org.apache.maven - maven-plugin-api - ${mavenVersion} - provided - - - org.apache.maven.plugin-tools - maven-plugin-annotations - ${mavenPluginPluginVersion} - provided - + + org.apache.maven + maven-plugin-api + ${mavenVersion} + provided + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${mavenPluginPluginVersion} + provided + - - io.takari.maven.plugins - takari-plugin-testing - 2.8.0 - test - - - io.takari.maven.plugins - takari-plugin-integration-testing - 2.8.0 - pom - test - - - junit - junit - 4.12 - test - - - - - + io.takari.maven.plugins - takari-lifecycle-plugin - 1.11.12 - true - - none - - - - org.jacoco - jacoco-maven-plugin - 0.7.6.201602180812 - - - prepare-agent - - prepare-agent - - - - report - - report - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - 4.1.0 - - - + takari-plugin-testing + 2.8.0 + test + + + io.takari.maven.plugins + takari-plugin-integration-testing + 2.8.0 + pom + test + + + junit + junit + 4.12 + test + + + diff --git a/stubs-assembly-descriptor/pom.xml b/stubs-assembly-descriptor/pom.xml new file mode 100644 index 0000000000..96d9ad628f --- /dev/null +++ b/stubs-assembly-descriptor/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + + io.codearte.accurest + accurest-maven-project + 1.0-SNAPSHOT + + + stubs-assembly-descriptor + + \ No newline at end of file diff --git a/stubs-assembly-descriptor/src/main/resources/assemblies/stubs.xml b/stubs-assembly-descriptor/src/main/resources/assemblies/stubs.xml new file mode 100644 index 0000000000..74c49b880b --- /dev/null +++ b/stubs-assembly-descriptor/src/main/resources/assemblies/stubs.xml @@ -0,0 +1,19 @@ + + stubs + + jar + + false + + + ${project.build.directory} + + mappings/** + + / + true + + + diff --git a/test-deps/pom.xml b/test-deps/pom.xml new file mode 100644 index 0000000000..0b6af3d4da --- /dev/null +++ b/test-deps/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + accurest-maven-project + io.codearte.accurest + 1.0-SNAPSHOT + + + accurest-test-deps + pom + + + + org.spockframework + spock-core + 1.0-groovy-2.4 + + + com.jayway.restassured + rest-assured + 2.9.0 + + + com.jayway.restassured + spring-mock-mvc + 2.9.0 + + + com.github.tomakehurst + wiremock + 2.0.4-beta + + + com.toomuchcoding.jsonassert + jsonassert + 0.2.2 + + + org.assertj + assertj-core + 2.3.0 + + + \ No newline at end of file