From 1be74769bf4c16a192610cb97da53088ed8c0660 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 21 Nov 2019 09:35:50 +0400 Subject: [PATCH] fix ports and dependencies --- build.gradle | 15 +++------- .../HttpListenerConfiguration.java | 30 ------------------- .../java/ru/ulstu/grant/page/KiasPage.java | 17 ++++------- .../ru/ulstu/grant/service/GrantService.java | 4 +-- .../ru/ulstu/grant/service/KiasService.java | 22 ++++---------- .../resources/META-INF/resources/index.xhtml | 4 ++- src/main/resources/application.properties | 5 ++-- 7 files changed, 24 insertions(+), 73 deletions(-) delete mode 100644 src/main/java/ru/ulstu/configuration/HttpListenerConfiguration.java diff --git a/build.gradle b/build.gradle index 04bdf8c..8005a51 100644 --- a/build.gradle +++ b/build.gradle @@ -90,19 +90,12 @@ repositories { mavenCentral() } -configurations { - compile.exclude module: "spring-boot-starter-tomcat" - compile.exclude module: "bcmail-jdk14" - compile.exclude module: "bcprov-jdk14" - compile.exclude module: "bctsp-jdk14" -} - dependencies { compile group: 'org.springframework.boot', name: 'spring-boot-starter-web' compile group: 'org.springframework.boot', name: 'spring-boot-starter-security' compile group: 'org.springframework.boot', name: 'spring-boot-starter-aop' compile group: 'org.springframework.boot', name: 'spring-boot-starter-mail' - compile group: 'org.springframework.boot', name: 'spring-boot-starter-jetty' + compile group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat' compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa' compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf' compile group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect' @@ -126,11 +119,11 @@ dependencies { compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.6.0' compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.6.0' - compile group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.35.0' + //compile group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.35.0' testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test' - compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.3.1' - testCompile group: 'org.seleniumhq.selenium', name: 'selenium-support', version: '3.3.1' + //compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.3.1' + //testCompile group: 'org.seleniumhq.selenium', name: 'selenium-support', version: '3.3.1' //testCompile group: 'com.google.guava', name: 'guava', version: '21.0' testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19' } diff --git a/src/main/java/ru/ulstu/configuration/HttpListenerConfiguration.java b/src/main/java/ru/ulstu/configuration/HttpListenerConfiguration.java deleted file mode 100644 index 514319d..0000000 --- a/src/main/java/ru/ulstu/configuration/HttpListenerConfiguration.java +++ /dev/null @@ -1,30 +0,0 @@ -package ru.ulstu.configuration; - -import org.eclipse.jetty.server.ServerConnector; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.embedded.jetty.JettyServerCustomizer; -import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory; -import org.springframework.boot.web.server.ConfigurableWebServerFactory; -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class HttpListenerConfiguration implements WebServerFactoryCustomizer { - @Value("${server.http.port}") - private int httpPort; - - private void configureJetty(JettyServletWebServerFactory jettyFactory) { - jettyFactory.addServerCustomizers((JettyServerCustomizer) server -> { - ServerConnector serverConnector = new ServerConnector(server); - serverConnector.setPort(httpPort); - server.addConnector(serverConnector); - }); - } - - @Override - public void customize(ConfigurableWebServerFactory factory) { - if (factory instanceof JettyServletWebServerFactory) { - configureJetty((JettyServletWebServerFactory) factory); - } - } -} diff --git a/src/main/java/ru/ulstu/grant/page/KiasPage.java b/src/main/java/ru/ulstu/grant/page/KiasPage.java index 49d54a0..dfdec63 100644 --- a/src/main/java/ru/ulstu/grant/page/KiasPage.java +++ b/src/main/java/ru/ulstu/grant/page/KiasPage.java @@ -1,17 +1,12 @@ package ru.ulstu.grant.page; -import com.gargoylesoftware.htmlunit.html.DomNode; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlTableRow; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; +//import com.gargoylesoftware.htmlunit.html.DomNode; +//import com.gargoylesoftware.htmlunit.html.HtmlElement; +//import com.gargoylesoftware.htmlunit.html.HtmlPage; +//import com.gargoylesoftware.htmlunit.html.HtmlTableRow; public class KiasPage { - private final static String KIAS_GRANT_DATE_FORMAT = "dd.MM.yyyy HH:mm"; + /* private final static String KIAS_GRANT_DATE_FORMAT = "dd.MM.yyyy HH:mm"; private final HtmlPage page; public KiasPage(HtmlPage page) { @@ -51,5 +46,5 @@ public class KiasPage { public boolean isTableRowGrantLine(DomNode grantElement) { return !((HtmlTableRow) grantElement).getAttribute("class").contains("pagerSavedHeightSpacer"); - } + }*/ } diff --git a/src/main/java/ru/ulstu/grant/service/GrantService.java b/src/main/java/ru/ulstu/grant/service/GrantService.java index 28d3f8c..f46313f 100644 --- a/src/main/java/ru/ulstu/grant/service/GrantService.java +++ b/src/main/java/ru/ulstu/grant/service/GrantService.java @@ -313,13 +313,13 @@ public class GrantService extends BaseService { @Transactional public void createFromKias() throws IOException, ParseException { - for (GrantDto grantDto : kiasService.getNewGrantsDto()) { + /* for (GrantDto grantDto : kiasService.getNewGrantsDto()) { if (saveFromKias(grantDto)) { log.debug("GrantScheduler.loadGrantsFromKias new grant was loaded"); } else { log.debug("GrantScheduler.loadGrantsFromKias grant wasn't loaded, cause it's already exists"); } - } + }*/ } public List findAllActiveDto() { diff --git a/src/main/java/ru/ulstu/grant/service/KiasService.java b/src/main/java/ru/ulstu/grant/service/KiasService.java index e8627d3..0f8d5d4 100644 --- a/src/main/java/ru/ulstu/grant/service/KiasService.java +++ b/src/main/java/ru/ulstu/grant/service/KiasService.java @@ -1,24 +1,14 @@ package ru.ulstu.grant.service; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.DomNode; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import org.springframework.stereotype.Service; -import ru.ulstu.configuration.ApplicationProperties; -import ru.ulstu.grant.model.GrantDto; -import ru.ulstu.grant.page.KiasPage; -import ru.ulstu.user.service.UserService; +//import com.gargoylesoftware.htmlunit.WebClient; +//mport com.gargoylesoftware.htmlunit.html.DomNode; +//import com.gargoylesoftware.htmlunit.html.HtmlPage; -import java.io.IOException; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.List; +import org.springframework.stereotype.Service; @Service public class KiasService { - private final static String BASE_URL = "https://www.rfbr.ru/rffi/ru/contest_search?CONTEST_STATUS_ID=%s&CONTEST_TYPE=%s&CONTEST_YEAR=%s"; + /* private final static String BASE_URL = "https://www.rfbr.ru/rffi/ru/contest_search?CONTEST_STATUS_ID=%s&CONTEST_TYPE=%s&CONTEST_YEAR=%s"; private final static String CONTEST_STATUS_ID = "1"; private final static String CONTEST_TYPE = "-1"; @@ -69,5 +59,5 @@ public class KiasService { private List generateGrantYears() { return Arrays.asList(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.YEAR) + 1); - } + }*/ } diff --git a/src/main/resources/META-INF/resources/index.xhtml b/src/main/resources/META-INF/resources/index.xhtml index 583486e..5b87160 100644 --- a/src/main/resources/META-INF/resources/index.xhtml +++ b/src/main/resources/META-INF/resources/index.xhtml @@ -9,7 +9,9 @@ style="text-align:center"> - + + + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 42368ba..c3b671e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,8 @@ # Server Settings spring.main.banner-mode=off -server.port=8443 -server.http.port=8080 +server.port=8080 +server.http.port=8443 +server.ssl.enabled=false multipart.maxFileSize=20MB multipart.maxRequestSize=20MB # Thymeleaf Settings