Spring Maven Jetty运行JNDI配置
我的项目结构如下所示:Spring Maven Jetty运行JNDI配置,spring,maven,jndi,maven-jetty-plugin,Spring,Maven,Jndi,Maven Jetty Plugin,我的项目结构如下所示: parent POM |-- app-core |-- app-model |-- app-services `-- app-web 在我的pom.xml应用程序web中: <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.
parent POM
|-- app-core
|-- app-model
|-- app-services
`-- app-web
在我的pom.xml
应用程序web中:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<webDefaultXml>src/test/resources/webdefault.xml</webDefaultXml>
</configuration>
</plugin>
我的jetty.xml如下所示:
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<New id="icatDB" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/testDB</Arg>
<Arg>
<New class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
<Set name="serverName">localhost</Set>
<Set name="databaseName">test</Set>
<Set name="user">sa</Set>
<Set name="password"></Set>
</New>
</Arg>
</New>
</Configure>
- 有关Jetty中JNDI的配置,请参见此
- 有关如何将配置文件添加到构建过程的方法,请参见此
- 好的,这对我来说很有用:
我需要使用jettyEnvXml而不是jettyConfig
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
<jettyEnvXml>src/main/resources/jetty.xml</jettyEnvXml>
</configuration>
</plugin>
org.mortbay.jetty
maven jetty插件
6.1.10
src/main/resources/webdefault.xml
src/main/resources/jetty.xml
按照您的说明操作,出现错误请检查我的更新问题链接不再工作,因为Codehaus已不存在。可能值得更新它以指向Eclipse Jetty配置。
Failure: Object is not of type class org.mortbay.jetty.webapp.WebAppContext
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml>
<jettyEnvXml>src/main/resources/jetty.xml</jettyEnvXml>
</configuration>
</plugin>