0

I'm trying to view detailed debug information from the Jetty Maven Plugin version 9 in order to diagnose an unrelated error. I've looked at a post here Configure logging for Jetty's maven plugin? that describes version 7, and another post here Use Log4j with jetty-maven-plugin 9.x that describes logging with logback. I've tried the suggestions mentioned, including setting various system properties, both in the command line and under the plugin's configuration in pom.xml. I've also tried adding various dependencies under the plugin in pom.xml. None of the suggestions seem to work, and I'm wondering if perhaps I'm doing something wrong or something changed in the latest version. Regardless of what I put in, no detailed logging information is shown in standard out. (See below). At this point, I don't even need to integration with logback or log4j. All I need is any kind of logging -- standard out or standard err would be fine. I know there's something very basic I'm missing. Below is the relevant information.

command:

mvn jetty:run

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
     xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<modelVersion>4.0.0</modelVersion>
<groupId>me.question</groupId>
<artifactId>question1</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


<build>
    <plugins>

        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.4.6.v20170531</version>
            <configuration>
                <webApp>

                    <!--
                    <defaultsDescriptor>src/main/webapp/resources/webdefault.xml</defaultsDescriptor>
                    -->
                </webApp>
                <httpConnector>
                    <port>8080</port>
                </httpConnector>
                <stopKey>jetty-stop</stopKey>
                <stopPort>54326</stopPort>

                <systemProperties>


                </systemProperties>
            </configuration>

            <dependencies>

            </dependencies>

        </plugin>

    </plugins>
</build>

Standard out:

[INFO] jetty-9.4.6.v20170531
[INFO] Scanning elapsed time=41ms
[INFO] DefaultSessionIdManager workerName=node0
[INFO] No SessionScavenger set, using defaults
[INFO] Scavenging every 660000ms
[INFO] Started o.e.j.m.p.JettyWebAppContext@25b865b5{/,file:///Users/me/projects/log/src/main/webapp/,AVAILABLE}{file:///Users/me/projects/log/src/main/webapp/}
[INFO] Started ServerConnector@6abae708{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO] Started @2055ms
[INFO] Started Jetty Server
user64141
  • 5,141
  • 4
  • 37
  • 34

1 Answers1

0

I figured out what went wrong. I was trying to set the system properties inside the jetty-maven-plugin instead of beforehand using the properties-maven-plugin. Here is what I have in my pom.xml:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>set-system-properties</goal>
                    </goals>
                    <configuration>
                        <properties>
                            <property>
                                <name>org.eclipse.jetty.util.log.class</name>
                                <value>org.eclipse.jetty.util.log.StdErrLog</value>
                            </property>
                            <property>
                                <name>org.eclipse.jetty.LEVEL</name>
                                <value>DEBUG</value>
                            </property>
                        </properties>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.20.v20170531</version>
            <configuration>
                <webApp>
                    <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
                        <resourcesAsCSV>
                            src/main/webapp
                        </resourcesAsCSV>
                    </baseResource>
                </webApp>
                <httpConnector>
                    <port>8080</port>
                </httpConnector>
                <useTestScope>false</useTestScope>
                <stopKey>foo</stopKey>
                <stopPort>52042</stopPort>
            </configuration>
        </plugin>
user64141
  • 5,141
  • 4
  • 37
  • 34