我正在运行一个简单的java webapp mvn jetty:run,使用最新的jetty插件,但我似乎找不到告诉jetty将DEBUG消息输出到控制台的方法(对于嵌入式jetty实例,而不是插件本身).它目前只输出WARN和INFO消息.我试过设置-DDEBUG和-DVERBOSE,但他们没有做任何事情.我已经看过文档,但它似乎没有涵盖这一点.
我有一个Jetty服务器在/app上下文中运行Spring应用程序.该应用程序使用会话,因此它设置会话cookie,响应如下:
set-cookie:JSESSIONID=679b6291-d1cc-47be-bbf6-7ec75214f4e5; Path=/app; HttpOnly
Run Code Online (Sandbox Code Playgroud)
我需要cookie来获取路径/而不是webapp的上下文.另外,我想使用安全的cookie.我想要这个回复:
set-cookie:JSESSIONID=679b6291-d1cc-47be-bbf6-7ec75214f4e5; Path=/; HttpOnly; Secure
Run Code Online (Sandbox Code Playgroud)
在哪里配置会话cookie的适当位置?春天有助于此吗?它应该在web.xml吗?或者我是否需要以容器特定的方式配置它,例如jetty-web.xml?
我尝试了很多东西,但到目前为止还没有任何工作.以下是我尝试过的一些事情.
创建WEB-INF/jetty-web.xml如下:
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Get name="sessionHandler">
<Get name="sessionManager">
<Set name="sessionCookie">MYJETTYSESSION</Set>
<Set name="sessionPath">/</Set>
<Set name="secureCookies" type="boolean">true</Set>
<Set name="httpOnly" type="boolean">true</Set>
</Get>
</Get>
</Configure>
Run Code Online (Sandbox Code Playgroud)
这会导致抛出异常:
2012-10-05 02:41:41.180:WARN:oejx.XmlConfiguration:Config error at <Set name="sessionPath">/</Set> java.lang.NoSuchMethodException: class org.eclipse.jetty.server.session.HashSessionManager.setSessionPath(class java.lang.String)
2012-10-05 02:41:41.180:WARN:oejx.XmlConfiguration:Config error at <Get name="sessionManager"><Set name="sessionCookie">MYJETTYSESSION</Set><Set name="sessionPath">/</Set><Set name="secureCookies">true</Set><Set name="httpOnly">true</Set></Get> java.lang.NoSuchMethodException: class org.eclipse.jetty.server.session.HashSessionManager.setSessionPath(class java.lang.String)
2012-10-05 02:41:41.180:WARN:oejx.XmlConfiguration:Config error at <Get name="sessionHandler"><Get name="sessionManager"><Set name="sessionCookie">MYJETTYSESSION</Set><Set name="sessionPath">/</Set><Set name="secureCookies">true</Set><Set name="httpOnly">true</Set></Get></Get> java.lang.NoSuchMethodException: class …Run Code Online (Sandbox Code Playgroud) 我有一个Spring Roo项目,我用它mvn jetty:run来运行我的应用程序.唯一的问题是*.java类的更改不热部署,而*.jspx热部署的更改很好.
那么如何为java类配置mvn jetty到hotdeploy呢?
我在eclipse中使用maven创建了一个Web应用程序.我正在使用jetty来运行应用程序.我可以使用maven jetty插件运行应用程序.但是我在调试应用程序时遇到了困难 - 我设置调试设置的步骤来自以下链接 http://www.clickonchris.com/2010/05/configuring-jetty-maven-and-eclipse-together -with-热部署/
我可以在端口8080运行应用程序,它继续侦听传输dt_socket地址:4000.为了调试我给了端口4000.但是当我在eclipse中启动调试器时,它给了我一个窗口,出现以下错误 - "连接失败到远程VM.连接被拒绝.连接被拒绝:连接"有人可以帮助我解决这个问题以调试应用程序.
谢谢!!!
我试图通过在webdefault.xml 中设置为false 的技术来解决Jetty在Windows上锁定静态文件的常见问题useFileMappedBuffer.不幸的是,Jetty每次都没有拿起我的自定义webdefault.xml.
我正在使用Apache Maven 3.0.2.我尝试过使用maven-jetty-plugin(v6.1.26)和jetty-maven-plugin(v8.0.0.M2),但没有区别.在运行Jetty之前,我已经尝试过运行干净和重建.
我每次验证我的webdefault.xml是从与插件相同的版本获得并且具有正确的设置,即仅将此设置从true更改为false:
...
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>
...
Run Code Online (Sandbox Code Playgroud)
这是我的pom.xml Jetty插件部分的样子:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<contextPath>/</contextPath>
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我也尝试改变文件的路径:
<webDefaultXml>${basedir}/src/main/resources/webdefault.xml</webDefaultXml>
Run Code Online (Sandbox Code Playgroud)
我到处都看到了这个确切的解决方案,听起来它正在为其他人工作(虽然我找到了一个有人有我问题的实例).jetty的启动在输出中有这个:
> mvn jetty:run
...
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
...
Run Code Online (Sandbox Code Playgroud)
这进一步让我觉得它没有得到应用.输出中的所有其他路径都是正确的.
我在Jetty运行时看到的最直接的问题是,每当我使用IntelliJ IDEA 10编辑静态文件(JavaScript,CSS等)时,我都会收到以下错误消息:
Cannot save file:
D:\...\... (The requested operation cannot be performed on a file with a user-mapped section open)
Run Code Online (Sandbox Code Playgroud)
在我停止Jetty后,它保存得很好.每次都会发生这种情况
我有什么想法可能做错了吗?提前致谢.
我正在使用maven和maven-failsafe-plugin在集成测试生命周期阶段启动jetty.然后,我对运行的webapp执行了许多(*IT.java)junit测试.这是按预期工作的.
但是,我想连接到测试数据库进行集成测试.我正在存储它的URL
${basedir}/src/test/resources/jdbc.properties
Run Code Online (Sandbox Code Playgroud)
当jetty插件运行(jetty:run)时,它会使用
${basedir}/src/main/resources/jdbc.propertes
Run Code Online (Sandbox Code Playgroud)
代替.我尝试通过classesDirectory属性重新配置jetty插件来使用
${project.build.testOutputDirectory}
Run Code Online (Sandbox Code Playgroud)
但是test-classes目录缺少我实际编译的项目类,以及存储的资源
${basedir}/src/main/resources
Run Code Online (Sandbox Code Playgroud)
注意:surefire将测试资源添加到类路径中,然后是主资源,这样两者中的任何内容都将使用测试版本,因为它首先在类路径中找到.
有关如何正确设置此设置的任何想法?
谢谢!
编辑:
好吧,似乎jetty-plugin上有配置属性来处理这个问题:
不幸的是,它们不起作用.
这是我的pom.xml的相关部分:
Run Code Online (Sandbox Code Playgroud)<testResources> <testResource> <filtering>true</filtering> <directory>src/test/resources</directory> </testResource> </testResources> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> <configuration> <contextPath>/</contextPath> <stopPort>8005</stopPort> <stopKey>STOP</stopKey> </configuration> <executions> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> <goals> <goal>run</goal> </goals> <configuration> <daemon>true</daemon> <useTestClasspath>true</useTestClasspath> <testClassesDirectory>${project.build.testOutputDirectory}</testClassesDirectory> </configuration> </execution> <execution> <id>stop-jetty</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>2.6</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> <configuration> <useFile>false</useFile> </configuration> </plugin>
嗨,我有以下配置.
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.3.v20120416</version>
</plugin>
Run Code Online (Sandbox Code Playgroud)
在我的jetty-env.xml中我有
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
</Configure>
Run Code Online (Sandbox Code Playgroud)
当我用mvn jetty运行时:运行我得到以下错误.
Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.webapp.WebAppCont
ext
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:92)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClas
s(XmlConfiguration.java:349)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configur
e(XmlConfiguration.java:314)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.jav
a:279)
at org.mortbay.jetty.plugin.AbstractJettyMojo.applyJettyXml(AbstractJett
yMojo.java:449)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMo
jo.java:467)
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我想在Eclipse中运行我的webapp(使用JSf)Jetty 8.1.1.v20120215.我为Jetty下载了Jettey Adapter,然后在Eclipse中添加了Jetty Server 8.1.然后我在Jetty网络服务器下盯着我的webapp.并得到了以下错误.从statck跟踪看起来Jetting没有得到一些必需的罐子.因为我正在使用maven,所以那些jar在我的webapp中依赖于依赖.我还可以在eclipse中看到Eclipse中列出的那些文件在Refrenced Libaries下.
2012-03-01 16:46:00.492:INFO:oejs.Server:jetty-8.1.1.v20120215
2012-03-01 16:46:00.515:INFO:oejdp.ScanningAppProvider:Deployment monitor /home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/webapps at interval 1
2012-03-01 16:46:00.519:INFO:oejdp.ScanningAppProvider:Deployment monitor /home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/contexts at interval 1
2012-03-01 16:46:00.521:INFO:oejd.DeploymentManager:Deployable added: /home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/contexts/mc-webapp.xml
2012-03-01 16:46:03.223:WARN:oejuc.AbstractLifeCycle:FAILED o.e.j.w.WebAppContext{/mc-webapp,[file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/blitzer-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/dark-hive-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/ui-lightness-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/sam-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/rocket-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/myfaces-api-2.1.5.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/swanky-purse-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/trontastic-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/south-street-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/primefaces-3.0.1.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/hot-sneaks-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/glass-x-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/le-frog-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/casablanca-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/overcast-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/ui-darkness-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/midnight-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/eggplant-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/humanity-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/smoothness-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/flick-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/vader-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/cupertino-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/black-tie-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/bluesky-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/pepper-grinder-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/mc-theme.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/home-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/mint-choc-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/sunny-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/excite-bike-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/start-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/redmond-1.0.3.jar!/META-INF/resources/, jar:file:/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp/WEB-INF/lib/myfaces-impl-2.1.5.jar!/META-INF/resources/]},/home/mitesh.patel/dev/mc-sandbox/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/mc-webapp: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
at org.eclipse.jetty.annotations.AnnotationConfiguration.createAnnotationParser(AnnotationConfiguration.java:111)
at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:73)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:428)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1208)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:699)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
at …Run Code Online (Sandbox Code Playgroud) 每当我部署jetty应用程序时,我都遇到了这个问题.看起来有些人jar或班级被打破了.
git和maven)~/.m2和重建没有帮助.jar被打破了.试过jar tvf $every_jar,没有找到任何东西.任何想法如何调试这个?看起来真的很神秘,我怀疑是有些文件被破坏了.
Stack trace:
2014-10-21 13:29:25.123:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/XYZ/},/XYZ/webapps/root
javax.servlet.ServletException: jersey-serlvet
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:553)
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:39)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:494)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:141)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:145)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:56)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:615)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:121)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:555)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:230)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) …Run Code Online (Sandbox Code Playgroud) 我正在Jenkins构建服务器上构建Maven Java应用程序.我java.lang.OutOfMemoryError: PermGen space在Jenkins构建期间遇到了很多次(但从未在我的localhost上),因此它无法构建.
我已经尝试过设置MAVEN_OPTSJenkins:我进入了Jenkins- > Manage Jenkins- > Configure system- > Global MAVEN_OPTS并且设置为-Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=512m.尽管将其设置为这个高价值,我们仍然会遇到PermGen空间问题.我不想将MAVEN_OPTS设置为更高的值; 我不知道我的应用程序如何需要一个空间,我宁愿深入研究高内存使用问题.
最近,我一直在想,也许permgen空间问题不是来自Maven本身,而是来自Maven旋转的JVM进程之一(例如:插件).我提出这个假设,因为Maven仍然能够执行TestNG测试,尽管已经吐出了我们的permgen空间错误线.导致PermGen错误的一个这样的插件是Jetty:
Oct 31, 2012 7:55:37 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: handle failed
java.lang.OutOfMemoryError: PermGen space
Run Code Online (Sandbox Code Playgroud)
因此,我想知道:
该MAVEN_OPTS变量是否也适用于Maven构建旋转的子JVM进程?如果没有,那么如何为这些子进程(如Jetty)设置JVM选项?
注意:我使用的是Maven 3.0.4.