diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 475042ba46..6e45c8d767 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -36,7 +36,6 @@ dependencies { implementation localGroovy() implementation 'com.github.ben-manes:gradle-versions-plugin:0.25.0' - implementation 'gradle.plugin.org.gretty:gretty:3.0.1' implementation 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.21.1' implementation 'io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE' implementation 'io.spring.gradle:docbook-reference-plugin:0.3.1' diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSampleBootPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSampleBootPlugin.groovy deleted file mode 100644 index 2d7ee845e5..0000000000 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSampleBootPlugin.groovy +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2002-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package io.spring.gradle.convention; - -import org.gradle.api.Project; -import org.gradle.api.plugins.PluginManager; -import org.gradle.api.plugins.WarPlugin -import org.gradle.api.plugins.JavaPlugin; -import org.gradle.api.tasks.testing.Test - -/** - * @author Rob Winch - */ -public class SpringSampleBootPlugin extends SpringSamplePlugin { - - @Override - public void additionalPlugins(Project project) { - super.additionalPlugins(project); - - PluginManager pluginManager = project.getPluginManager(); - - pluginManager.apply("org.springframework.boot"); - - project.repositories { - maven { url 'https://repo.spring.io/snapshot' } - maven { url 'https://repo.spring.io/milestone' } - } - } -} diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSamplePlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSamplePlugin.groovy deleted file mode 100644 index 37ae6cfb34..0000000000 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSamplePlugin.groovy +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2002-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package io.spring.gradle.convention; - -import org.gradle.api.Project -import org.sonarqube.gradle.SonarQubePlugin; - -/** - * @author Rob Winch - */ -public class SpringSamplePlugin extends AbstractSpringJavaPlugin { - - @Override - public void additionalPlugins(Project project) { - project.plugins.withType(SonarQubePlugin) { - project.sonarqube.skipProject = true - } - } -} diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSampleWarPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSampleWarPlugin.groovy deleted file mode 100644 index 59bb1545c9..0000000000 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/SpringSampleWarPlugin.groovy +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2016-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package io.spring.gradle.convention - -import org.gradle.api.Project -import org.gradle.api.Task -import org.gradle.api.plugins.PluginManager -import org.gradle.api.tasks.testing.Test - -/** - * @author Rob Winch - */ -public class SpringSampleWarPlugin extends SpringSamplePlugin { - - @Override - public void additionalPlugins(Project project) { - super.additionalPlugins(project); - - PluginManager pluginManager = project.getPluginManager(); - - pluginManager.apply("war"); - pluginManager.apply("org.gretty"); - - project.gretty { - servletContainer = 'tomcat85' - contextPath = '/' - fileLogEnabled = false - } - - Task prepareAppServerForIntegrationTests = project.tasks.create('prepareAppServerForIntegrationTests') { - group = 'Verification' - description = 'Prepares the app server for integration tests' - doFirst { - project.gretty { - httpPort = getRandomFreePort() - httpsPort = getRandomPort() - } - } - } - project.tasks.withType(org.akhikhl.gretty.AppBeforeIntegrationTestTask).all { task -> - task.dependsOn prepareAppServerForIntegrationTests - } - - project.tasks.withType(Test).all { task -> - if("integrationTest".equals(task.name)) { - applyForIntegrationTest(project, task) - } - } - } - - def applyForIntegrationTest(Project project, Task integrationTest) { - project.gretty.integrationTestTask = integrationTest.name - - integrationTest.doFirst { - def gretty = project.gretty - String host = project.gretty.host ?: 'localhost' - boolean isHttps = gretty.httpsEnabled - Integer httpPort = integrationTest.systemProperties['gretty.httpPort'] - Integer httpsPort = integrationTest.systemProperties['gretty.httpsPort'] - int port = isHttps ? httpsPort : httpPort - String contextPath = project.gretty.contextPath - String httpBaseUrl = "http://${host}:${httpPort}${contextPath}" - String httpsBaseUrl = "https://${host}:${httpsPort}${contextPath}" - String baseUrl = isHttps ? httpsBaseUrl : httpBaseUrl - integrationTest.systemProperty 'app.port', port - integrationTest.systemProperty 'app.httpPort', httpPort - integrationTest.systemProperty 'app.httpsPort', httpsPort - integrationTest.systemProperty 'app.baseURI', baseUrl - integrationTest.systemProperty 'app.httpBaseURI', httpBaseUrl - integrationTest.systemProperty 'app.httpsBaseURI', httpsBaseUrl - - integrationTest.systemProperty 'geb.build.baseUrl', baseUrl - integrationTest.systemProperty 'geb.build.reportsDir', 'build/geb-reports' - } - } - - def getRandomPort() { - ServerSocket ss = new ServerSocket(0) - int port = ss.localPort - ss.close() - return port - } -} diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample-boot.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample-boot.properties deleted file mode 100644 index 6daff6d336..0000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample-boot.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=io.spring.gradle.convention.SpringSampleBootPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample-war.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample-war.properties deleted file mode 100644 index 54daa2ada2..0000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample-war.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=io.spring.gradle.convention.SpringSampleWarPlugin \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample.properties deleted file mode 100644 index 24714047ca..0000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/io.spring.convention.spring-sample.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=io.spring.gradle.convention.SpringSamplePlugin \ No newline at end of file diff --git a/buildSrc/src/test/groovy/io/spring/gradle/convention/ShowcaseITest.groovy b/buildSrc/src/test/groovy/io/spring/gradle/convention/ShowcaseITest.groovy index 6bbe925966..6001b9daf7 100644 --- a/buildSrc/src/test/groovy/io/spring/gradle/convention/ShowcaseITest.groovy +++ b/buildSrc/src/test/groovy/io/spring/gradle/convention/ShowcaseITest.groovy @@ -34,12 +34,6 @@ class ShowcaseITest extends Specification { .build(); then: 'entire build passes' result.output.contains("BUILD SUCCESSFUL") - - and: 'javadoc api works' - - and: 'integration tests run' - new File(testKit.getRootDir(), 'samples/sgbcs-sample-war/build/test-results/integrationTest/').exists() - new File(testKit.getRootDir(), 'samples/sgbcs-sample-war/build/reports/tests/integrationTest/').exists() } def "install"() { diff --git a/buildSrc/src/test/resources/samples/javadocapi/multimodule/build.gradle b/buildSrc/src/test/resources/samples/javadocapi/multimodule/build.gradle index 203102f976..ce456f2d6c 100644 --- a/buildSrc/src/test/resources/samples/javadocapi/multimodule/build.gradle +++ b/buildSrc/src/test/resources/samples/javadocapi/multimodule/build.gradle @@ -1,5 +1,4 @@ plugins { id 'io.spring.convention.javadoc-api' id 'io.spring.convention.spring-module' apply false - id 'io.spring.convention.spring-sample' apply false } diff --git a/buildSrc/src/test/resources/samples/javadocapi/multimodule/sample/build.gradle b/buildSrc/src/test/resources/samples/javadocapi/multimodule/sample/build.gradle index 1bf7c89a4f..bbfeb03c22 100644 --- a/buildSrc/src/test/resources/samples/javadocapi/multimodule/sample/build.gradle +++ b/buildSrc/src/test/resources/samples/javadocapi/multimodule/sample/build.gradle @@ -1 +1 @@ -apply plugin: 'io.spring.convention.spring-sample' \ No newline at end of file +apply plugin: 'java' diff --git a/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/build.gradle b/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/build.gradle deleted file mode 100644 index 6ef34f76a8..0000000000 --- a/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -apply plugin: 'io.spring.convention.spring-sample-war' - -dependencies { - provided 'javax.servlet:javax.servlet-api' - testCompile 'commons-io:commons-io' - testCompile 'junit:junit' -} \ No newline at end of file diff --git a/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/src/integration-test/java/sample/HelloServletTest.java b/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/src/integration-test/java/sample/HelloServletTest.java deleted file mode 100644 index fad44d0c98..0000000000 --- a/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/src/integration-test/java/sample/HelloServletTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package sample; - -import static org.junit.Assert.assertEquals; - -import java.io.InputStream; -import java.net.URL; -import java.nio.charset.Charset; - -import org.apache.commons.io.IOUtils; -import org.junit.Test; - -public class HelloServletTest { - - @Test - public void hello() throws Exception { - String url = System.getProperty("app.baseURI"); - try(InputStream get = new URL(url).openConnection().getInputStream()) { - String hello = IOUtils.toString(get, Charset.defaultCharset()); - assertEquals("Hello", hello); - } - - } -} diff --git a/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/src/main/java/sample/HelloServlet.java b/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/src/main/java/sample/HelloServlet.java deleted file mode 100644 index 8d74375dab..0000000000 --- a/buildSrc/src/test/resources/samples/showcase/samples/sgbcs-sample-war/src/main/java/sample/HelloServlet.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package sample; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/") -public class HelloServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - resp.getWriter().write("Hello"); - } - - private static final long serialVersionUID = -166535360229360350L; -}