开发者

Configure Javamail JNDI for Jetty

My goal is simple. Configure the maven-jetty-plugin with a JNDI for javamail.

But after hours of googling and reading i cannot figure out exactly what to do....

Can someone please help me with a simple step-by-step instruction.

I just read the documentation at http开发者_C百科://docs.codehaus.org/display/JETTY/JNDI, but there is absolutly no information about what file i should be editing...

For example. Where am i supposed to put this???

<Configure id='wac' class="org.mortbay.jetty.webapp.WebAppContext">
...
<New id="mail" class="org.mortbay.jetty.plus.naming.Resource">
 <Arg><Ref id="wac"/></Arg>
 <Arg>mail/Session</Arg>
 <Arg>
   <New class="org.mortbay.naming.factories.MailSessionReference">
     <Set name="user">fred</Set>
     <Set name="password">OBF:1xmk1w261z0f1w1c1xmq</Set>
     <Set name="properties">
       <New class="java.util.Properties">
         <Put name="mail.smtp.host">XXX</Put>
         <Put name="mail.from">me@me</Put>
         <Put name="mail.debug">true</Put>
       </New>
      </Set>
   </New>
 </Arg>

And lastly. Since this is the maven-jetty-plugin, i do not have access to modify any core files, so should there be some kind of xml file i should create and set up to override jetty original configuration?


Add the following configuration to the maven-jetty-plugin:

<jettyEnvXml>src/jetty-env.xml</jettyEnvXml>

Then, you can place that file in that location.

Here are concrete examples:

  • pom.xml (line 536)
  • jetty-env.xml
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜