maven
jetty-maven-plugin setting buffers sizes
Returning to jetty-maven-plugin I've trouble to set buffers size. My use-case imply file upload (usual size is ~700Ko). Because the upload is too big for jetty-maven-plugin default configuration I get Http response with error status code 413 (request too large) I tryied using plugin configuration : <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty-maven.version}</version> <configuration> <scanIntervalSeconds>3</scanIntervalSeconds> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>8080</port> <maxIdleTime>60000</maxIdleTime> <requestHeaderSize>8192</requestHeaderSize> <requestBufferSize>2097152</requestBufferSize> </connector> </connectors> </configuration> </plugin> Then I tried to use jetty-maven-plugin with a jetty.xml file <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty-maven.version}</version> <configuration> <scanIntervalSeconds>3</scanIntervalSeconds> <jettyConfig>${basedir}/src/main/config/jetty/jetty.xml</jettyConfig> </configuration> </plugin> The jetty.xml is below: <?xml version="1.0"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> <Configure id="Server" class="org.eclipse.jetty.server.Server"> <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set> <Set name="requestHeaderSize">8192</Set> <Set name="requestBufferSize">2097152</Set> </New> </Arg> </Call> </Configure> Nothing works. Could someone hand me the correct configuration please?
I'm not sure whether this fixes the problem in your use case, but you could try adding the following to your <configuration> section of the maven-jetty-plugin: <systemProperties> <systemProperty> <name>org.eclipse.jetty.server.Request.maxFormContentSize</name> <value>-1</value> <!-- or any other value -1 is for max --> </systemProperty> <systemProperties> as mentioned by jesse mcconnell the property was renamed in jetty 7/8 to org.eclipse.jetty.server.Request.maxFormContentSize. For jetty 6 for me org.mortbay.jetty.Request.maxFormContentSize is working.
change your pom as per this and add this two xml file into your project. I hope, it will work for you. <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.11.v20150529</version> <configuration> <contextPath>/random-api</contextPath> <scanIntervalSeconds>5</scanIntervalSeconds> <jettyXml>jetty.xml,jetty-http.xml</jettyXml> </configuration> </plugin> ===============jetty.xml and jetty-http.xml================= https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty.xml https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http.xml
After a pause (lunch) I grabed the code of the web-app I was supposed to test. There was a redundant limitation into its "internal" configuration (use an upload agent with it's own size limit). In fact the two configuration proposed for jetty are working (now that web-app doesn't have any redundant limitation)
Related Links
Deploy p2 repo to Nexus
System.Diagnostics.Debug.WriteLine() Does Not Work Under NUnit Console
how to use maven with intellij 13
Automatically download missing artifacts if missing in Artifactory
How to package up a leiningen project for recompilation with all the libraries included? [for users without an internet connection]
How to fail when maven profile does not exist?
Sharing dependencies not in central repo with the project
license issue in mule when building with junit test cases
Change Maven repository that NetBeans uses
Maven release-plugin doesn't update LATEST version
How to configure pom.xml so deploy custom artifact to remote repo (archiva)
Making sure all dependency versions are specified in dependencyManagement in maven
How to update archetype-catalog in Nexus repository
deployment of an ejb maven project from eclipse
Maven gwt:compile produces no hosted html file
Grails 2.3.7 repository issues