diff options
-rw-r--r-- | build.gradle | 17 | ||||
-rw-r--r-- | src/main/java/com/juick/ws/XMPPConnection.java | 5 | ||||
-rw-r--r-- | src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java | 4 |
3 files changed, 19 insertions, 7 deletions
diff --git a/build.gradle b/build.gradle index 7f0bbe52..bea96871 100644 --- a/build.gradle +++ b/build.gradle @@ -4,9 +4,19 @@ subprojects { mavenCentral() } } +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'org.akhikhl.gretty:gretty:+' + } +} + apply plugin: 'java' apply plugin: 'war' +apply plugin: 'org.akhikhl.gretty' repositories { mavenCentral() @@ -51,3 +61,10 @@ dependencies { } compileJava.options.encoding = 'UTF-8' + +gretty { + httpPort = 8080 + contextPath = '' + servletContainer = 'tomcat8' +} + diff --git a/src/main/java/com/juick/ws/XMPPConnection.java b/src/main/java/com/juick/ws/XMPPConnection.java index 802271a0..8194862c 100644 --- a/src/main/java/com/juick/ws/XMPPConnection.java +++ b/src/main/java/com/juick/ws/XMPPConnection.java @@ -31,15 +31,14 @@ public class XMPPConnection implements Runnable, Stream.StreamListener, Message. @Inject JdbcTemplate sql; - @Inject - Environment env; Stream xmpp; String xmppPassword; MessageSerializer ms; @Inject WebsocketComponent ws; - public XMPPConnection() { + @Inject + public XMPPConnection(Environment env) { xmppPassword = env.getProperty("xmpp_password"); ms = new MessageSerializer(); new Thread(this).start(); diff --git a/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index 46ef8486..b0393038 100644 --- a/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -41,10 +41,6 @@ public class WebsocketConfiguration extends WebMvcConfigurerAdapter implements W dataSource.setUrl(env.getProperty("datasource_url")); return new JdbcTemplate(dataSource); } - @Bean - XMPPConnection xmpp() { - return new XMPPConnection(); - } @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { registry.addHandler(wsHandler(), "/"); |