Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo
Commits
349e5627
Commit
349e5627
authored
Oct 25, 2015
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#12037
TODO: 读取 host、port 配置
parent
f574cef6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
20 deletions
+110
-20
pom.xml
pom.xml
+16
-9
src/main/java/org/b3log/solo/Starter.java
src/main/java/org/b3log/solo/Starter.java
+81
-0
src/main/resources/local.properties
src/main/resources/local.properties
+13
-11
No files found.
pom.xml
View file @
349e5627
<?xml version="1.0" encoding="UTF-8"?>
<!--
Description: Solo POM.
Version: 2.
5.1.7, Oct 17
, 2015
Version: 2.
6.1.7, Oct 25
, 2015
Author: Liang Ding
-->
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
...
...
@@ -113,6 +113,7 @@
<jsoup.version>
1.5.2
</jsoup.version>
<markdownpapers-core.version>
1.4.2
</markdownpapers-core.version>
<qiniu.version>
7.0.4.1
</qiniu.version>
<jetty.version>
9.2.13.v20150730
</jetty.version>
<!-- maven plugin -->
<maven-compiler-plugin.version>
3.3
</maven-compiler-plugin.version>
...
...
@@ -125,7 +126,7 @@
<testng.version>
6.1.1
</testng.version>
<gae.version>
1.8.1.1
</gae.version>
<!-- JDBC Drivers -->
<mysql-connector-java.version>
5.1.3
6
</mysql-connector-java.version>
<mysql-connector-java.version>
5.1.3
7
</mysql-connector-java.version>
</properties>
<dependencies>
...
...
@@ -134,10 +135,6 @@
<artifactId>
latke
</artifactId>
<version>
${org.b3log.latke.version}
</version>
<exclusions>
<exclusion>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
</exclusion>
<exclusion>
<groupId>
com.jolbox
</groupId>
<artifactId>
bonecp
</artifactId>
...
...
@@ -153,7 +150,6 @@
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
<version>
${servlet.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
...
...
@@ -168,6 +164,11 @@
<version>
${org.b3log.latke.version}
</version>
</dependency>
<dependency>
<groupId>
org.b3log
</groupId>
<artifactId>
latke-repository-h2
</artifactId>
<version>
${org.b3log.latke.version}
</version>
</dependency>
<dependency>
<groupId>
org.testng
</groupId>
...
...
@@ -200,7 +201,13 @@
<version>
${qiniu.version}
</version>
</dependency>
<!-- BEGIN GAE related dependencies just for test -->
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-webapp
</artifactId>
<version>
${jetty.version}
</version>
</dependency>
<!-- BEGIN: GAE related dependencies just for testing -->
<dependency>
<groupId>
org.b3log
</groupId>
<artifactId>
latke-gae
</artifactId>
...
...
@@ -221,7 +228,7 @@
<version>
${gae.version}
</version>
<scope>
test
</scope>
</dependency>
<!-- END
GAE related dependencies just for test
-->
<!-- END
: GAE related dependencies just for testing
-->
</dependencies>
<build>
...
...
src/main/java/org/b3log/solo/Starter.java
0 → 100644
View file @
349e5627
/*
* Copyright (c) 2010-2015, b3log.org
*
* 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
*
* http://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
org
.
b3log
.
solo
;
import
java.awt.Desktop
;
import
java.io.File
;
import
java.net.URI
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.webapp.WebAppContext
;
/**
* Solo with embedded Jetty.
*
* <ul>
* <li>Windows: java -cp WEB-INF/lib/*;WEB-INF/classes org.b3log.solo.Solo</li>
* <li>Unix-like: java -cp WEB-INF/lib/*:WEB-INF/classes org.b3log.solo.Solo</li>
* </ul>
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Oct 25, 2015
* @since 1.2.0
*/
public
final
class
Starter
{
/**
* Main.
*
* @param args the specified arguments
* @throws java.lang.Exception if start failed
*/
public
static
void
main
(
final
String
[]
args
)
throws
Exception
{
String
webappDirLocation
=
"src/main/webapp/"
;
// POM structure in dev env
final
File
file
=
new
File
(
webappDirLocation
);
if
(!
file
.
exists
())
{
webappDirLocation
=
"."
;
// Release prod env
}
final
int
port
=
8080
;
// TODO: read from conf
final
String
contextPath
=
"/"
;
// TODO: read from conf
Server
server
=
new
Server
(
port
);
WebAppContext
root
=
new
WebAppContext
();
root
.
setContextPath
(
contextPath
);
root
.
setDescriptor
(
webappDirLocation
+
"/WEB-INF/web.xml"
);
root
.
setResourceBase
(
webappDirLocation
);
server
.
setHandler
(
root
);
server
.
start
();
try
{
Desktop
.
getDesktop
().
browse
(
new
URI
(
"http://localhost:"
+
port
));
}
catch
(
final
Throwable
e
)
{
e
.
printStackTrace
();
}
server
.
join
();
}
/**
* Private constructor.
*/
private
Starter
()
{
}
}
src/main/resources/local.properties
View file @
349e5627
...
...
@@ -18,23 +18,25 @@
# Description: Solo local environment configurations. Configures this file
# if Solo runs on a standard Servlet container or Baidu App Engine,
# it is unnecessary to care this file if Solo runs on Google App Engine.
# Version: 1.
0.2.6, Feb 11
, 2015
# Version: 1.
1.2.6, Oct 25
, 2015
# Author: Liang Ding
#
#### Runtime Database (RuntimeDatabase) ####
runtimeDatabase
=
MYSQL
#### MySQL runtime ####
#runtimeDatabase=MYSQL
#jdbc.username=root
#jdbc.password=
#jdbc.driver=com.mysql.jdbc.Driver
#jdbc.URL=jdbc:mysql://localhost:3306/b3log?useUnicode=yes&characterEncoding=UTF-8
#jdbc.pool=c3p0
#### JDBC database Configurations ####
jdbc.driver
=
com.mysql.jdbc.Driver
jdbc.URL
=
jdbc:mysql://localhost:3306/b3log?useUnicode=yes&characterEncoding=UTF-8
#### H2 runtime ####
runtimeDatabase
=
H2
jdbc.username
=
root
jdbc.password
=
# database connection pool
#jdbc.pool=BoneCP
#jdbc.pool=druid
jdbc.pool
=
c3p0
jdbc.driver
=
org.h2.Driver
jdbc.URL
=
jdbc:h2:~/b3log_solo_h2/db
jdbc.pool
=
h2
# The minConnCnt MUST larger or equal to 3
jdbc.minConnCnt
=
5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment