Jetty Maven插件-将属性文件放在类路径中 [英] Jetty Maven plugin - Put properties file in classpath

查看:75
本文介绍了Jetty Maven插件-将属性文件放在类路径中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用了eclipse码头插件:

I'm using the eclipse jetty plugin in my project:

<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.3.v20130506</version>

我的应用程序读取了 classpath中的文件 ,但我无法将其放入Jetty类路径中。

I have my application that read a file in the classpath of the server, but I can't manage to put it in the Jetty classpath...

我希望将其放入项目中的文件夹中并将该文件夹作为Jetty类路径的一部分,我该怎么做?

是否有更好的解决方案将该文件置于应用程序外部?

I would to put it in a folder in my project and make that folder part of the Jetty classpath, how can I do it?
Is there a better solution to make that file external to the application?

推荐答案

这只是Maven插件的配置问题

It was just a matter of configuration of the maven plugin


<configuration>
    <scanIntervalSeconds>10</scanIntervalSeconds>
    <jettyXml>jetty/jetty.xml</jettyXml>
    <webApp>
        <extraClasspath>${basedir}/jetty/classpath</extraClasspath>
    </webApp>
</configuration>

要将 classpath 文件夹添加到Jetty,它需要在 extraClasspath 文件夹中 webApp 标签。

to add a classpath folder to Jetty, it needs the extraClasspath folder in the webApp tag.

这篇关于Jetty Maven插件-将属性文件放在类路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆