blob: f366536136c321c4fb19fe9a0fca2501cf2e60d7 [file] [log] [blame]
<!--
/***************************************************************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to you 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.
***************************************************************************************************************************/
-->
{8.0.0-new,8.1.2-deprecated}
Building and Running from Command-Line
<p>
The <l>pom.xml</l> file is a basic Maven build script for creating the examples microservice
as an executable uber-jar.
</p>
<p>
The easiest way to build the microservice is to run the following from the project root.
</p>
<p class='bpcode w800'>
mvn clean install
</p>
<p>
Your <c>target</c> directory should now contain the following files:
</p>
<ul>
<li><c>juneau-examples-rest-jetty-1.0.jar</c>
<li><c>juneau-examples-rest-jetty.cfg</c>
</ul>
<p>
To start from a command line, run the following command from inside your <c>target</c> directory:
</p>
<p class='bpcode w800'>
java -jar juneau-examples-rest-jetty-1.0.jar
</p>
<p>
You should see the following console output:
</p>
<p class='bpcode w800 console'>
Running class 'JettyMicroservice' using config file 'juneau-examples-rest-jetty.cfg'.
Server started on port 10000
List of available commands:
exit -- Shut down service
restart -- Restarts service
help -- Commands help
>
</p>
<p>
If you get this error message: <code class='snippet'>java.net.BindException: Address already in use</code>,
then this microservice is already running elsewhere and so it cannot bind to port 10000.
</p>