<commit_before>
package org.carlspring.strongbox.servers.jetty;

import java.io.File;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;

import org.eclipse.jetty.annotations.AnnotationConfiguration;
import org.eclipse.jetty.annotations.AnnotationConfiguration.ClassInheritanceMap;
import org.eclipse.jetty.plus.webapp.EnvConfiguration;
import org.eclipse.jetty.plus.webapp.PlusConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.ConcurrentHashSet;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.FragmentConfiguration;
import org.eclipse.jetty.webapp.JettyWebXmlConfiguration;
import org.eclipse.jetty.webapp.MetaInfConfiguration;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.webapp.WebInfConfiguration;
import org.eclipse.jetty.webapp.WebXmlConfiguration;

/**
 * @author mtodorov
 */
public class JettyLauncher
{

    // TODO: Get this from the strongbox.xml
    private int port = 48080;

    private String basedir;

    private String contextPath = "/";

    private String war;

    private Server server;


    public JettyLauncher()
    {
    }

    public JettyLauncher(String basedir)
    {
        this.basedir = basedir;
    }

    public Server createExplodedServerInstance() throws ClassNotFoundException, IOException
    {
        Server server = new Server(getPort());

        WebAppContext context = new WebAppContext();
        context.setResourceBase(getBasedir());<commit_msg>jetty will use strongbox.port property to use non default port<commit_after>
package org.carlspring.strongbox.servers.jetty;

import java.io.File;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;

import org.eclipse.jetty.annotations.AnnotationConfiguration;
import org.eclipse.jetty.annotations.AnnotationConfiguration.ClassInheritanceMap;
import org.eclipse.jetty.plus.webapp.EnvConfiguration;
import org.eclipse.jetty.plus.webapp.PlusConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.ConcurrentHashSet;
import org.eclipse.jetty.webapp.*;

/**
 * @author mtodorov
 */
public class JettyLauncher
{
    private int port;

    private String basedir;

    private String contextPath = "/";

    private String war;

    private Server server;


    public JettyLauncher()
    {
        // TODO: Get this from the strongbox.xml
        port = System.getProperty("strongbox.port") != null ? Integer.parseInt(System.getProperty("strongbox.port")) :
               48080;
    }

    public JettyLauncher(String basedir)
    {
        this.basedir = basedir;
    }

    public Server createExplodedServerInstance() throws ClassNotFoundException, IOException
    {
        Server server = new Server(getPort());

        WebAppContext context = new WebAppContext();
        context.setResourceBase(getBasedir());
{'fraction_non_alphanumeric': 0.09626388421406934, 'fraction_numerical': 0.003365870077415012, 'mean_word_length': 4.08034188034188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2410110', 'n_tokens_mistral': 877, 'n_tokens_neox': 847, 'n_words': 176}