aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-05-13 09:32:46 +0300
committerGravatar Vitaly Takmazov2016-05-13 09:32:46 +0300
commitdaab143efa277ca42e60dcd29daeddbfa5179ace (patch)
treec271bbf7a18beb3f9cda2821a840b0a9de3d70f9
parent846d0b67d11ba9444a8a32ee173bb431683fa572 (diff)
gretty
-rw-r--r--build.gradle26
-rw-r--r--src/main/java/com/juick/api/Main.java13
2 files changed, 17 insertions, 22 deletions
diff --git a/build.gradle b/build.gradle
index b76df16a..84617e95 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,21 +4,20 @@ subprojects {
mavenCentral()
}
}
-
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
- classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.+'
+ classpath 'org.akhikhl.gretty:gretty:+'
classpath 'com.tkruse.gradle:gradle-groovysh-plugin:1.0.7'
}
}
apply plugin: 'java'
apply plugin: 'war'
-apply plugin: 'com.bmuschko.tomcat'
+apply plugin: 'org.akhikhl.gretty'
apply plugin: 'com.github.tkruse.groovysh'
repositories {
@@ -35,39 +34,34 @@ project(':deps:com.juick.server') {
compile core
}
}
-
project(':deps:com.juick.xmpp') {
dependencies {
compile core
}
}
-
project(':deps:com.juick.json') {
dependencies {
compile core
}
}
-
+configurations.all {
+ exclude group: "commons-logging", module: "commons-logging"
+}
dependencies {
compile core
compile server
compile xmpp
compile json
compile "org.apache.commons:commons-lang3:3.4"
- compile "org.springframework:spring-jdbc:4.2.4.RELEASE"
+ compile "org.springframework:spring-jdbc:4.2.6.RELEASE"
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
- def tomcatVersion = '7.0.+'
- tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
- "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
- "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"
- testCompile 'junit:junit:4.12'
- runtime 'mysql:mysql-connector-java:5.1.37'
+ compile 'javax.inject:javax.inject:1'
+ runtime 'mysql:mysql-connector-java:5.1.39'
testRuntime 'com.h2database:h2:1.4.190'
}
-
compileJava.options.encoding = 'UTF-8'
-
-tomcat {
+gretty {
httpPort = 8080
contextPath = '/'
+ servletContainer = 'tomcat8'
}
diff --git a/src/main/java/com/juick/api/Main.java b/src/main/java/com/juick/api/Main.java
index c43804d7..09fb51ec 100644
--- a/src/main/java/com/juick/api/Main.java
+++ b/src/main/java/com/juick/api/Main.java
@@ -19,7 +19,10 @@ package com.juick.api;
import com.juick.Tag;
import com.juick.json.MessageSerializer;
-import com.juick.server.*;
+import com.juick.server.MessagesQueries;
+import com.juick.server.SubscriptionsQueries;
+import com.juick.server.TagQueries;
+import com.juick.server.UserQueries;
import com.juick.xmpp.JID;
import com.juick.xmpp.Message;
import com.juick.xmpp.Stream;
@@ -40,8 +43,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.URL;
-import java.net.URLEncoder;
-import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -68,11 +69,11 @@ public class Main extends HttpServlet implements Stream.StreamListener {
public void init() throws ServletException {
super.init();
try {
- LogManager.getLogManager().readConfiguration(getServletContext().getResourceAsStream("WEB-INF/logging.properties"));
+ LogManager.getLogManager().readConfiguration(getServletContext().getResourceAsStream("/WEB-INF/logging.properties"));
Properties conf = new Properties();
- conf.load(getServletContext().getResourceAsStream("WEB-INF/juick.conf"));
+ conf.load(getServletContext().getResourceAsStream("/WEB-INF/juick.conf"));
DriverManagerDataSource dataSource = new DriverManagerDataSource();
- dataSource.setDriverClassName(conf.getProperty("datasource_driver"));
+ dataSource.setDriverClassName(conf.getProperty("datasource_driver", "com.mysql.jdbc.Driver"));
dataSource.setUrl(conf.getProperty("datasource_url"));
jdbc = new JdbcTemplate(dataSource);
messages = new Messages(jdbc);