изменение способа запуска
This commit is contained in:
34
pom.xml
34
pom.xml
@@ -15,6 +15,8 @@
|
||||
<slf4j.version>1.7.21</slf4j.version>
|
||||
<spring.version>4.2.5.RELEASE</spring.version>
|
||||
<jetty.version>9.4.0.v20161208</jetty.version>
|
||||
<dependencies.dir>lib</dependencies.dir>
|
||||
<main.class>ru.dmitriymx.skeleton.springmvc.WebApp</main.class>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -94,6 +96,38 @@
|
||||
<argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>${dependencies.dir}/</classpathPrefix>
|
||||
<mainClass>${main.class}</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/${dependencies.dir}/</outputDirectory>
|
||||
<excludeScope>provided</excludeScope>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -84,13 +84,8 @@ public class WebApp {
|
||||
* @param args параметры запуска
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
String host = "127.0.0.1";
|
||||
int port = 8080;
|
||||
|
||||
if (args.length == 2) {
|
||||
host = args[0];
|
||||
port = Integer.parseInt(args[1]);
|
||||
}
|
||||
final String host = System.getProperty("host", "127.0.0.1");
|
||||
final int port = Integer.parseInt(System.getProperty("port", "8080"));
|
||||
|
||||
log.info("Web app listen: {}:{}", host, port);
|
||||
WebApp app = new WebApp(host, port);
|
||||
|
||||
Reference in New Issue
Block a user