Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-140

Roo's configure email template does not set up dependencies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 1.0.0.M2
    • Fix Version/s: 1.0.0.RC1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OS X, Java 1.6

      Description

      When creating a roo project from scratch, then issuing a 'configure email template' command, the following actions need to be taken (and are not currently). Tested against trunk.

      1. Add the Java activation framework, java mail and spring context support jars to the pom.xml file (see below)
      2. Set up an applicationContext-mail.xml file and put all mail configuration settings in that file (as per jms, security sub-configurations)
      3. Install the MailSender - should either take a default (JavaMail or Jason Hunter's mail sender) or offer both as options. Should expose
      options such as host, port, username, password, smtp required support, etc...
      4. Should externalize mail server configuration in a smtp.properties file (or appropriately named file)

      Once I took those manual steps, everything worked fine.

      The maven dependencies I've added:

      <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
      <version>1.4.1</version>
      </dependency>
      <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>1.1</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>org.springframework.context.support</artifactId>
      <version>${spring.version}</version>
      </dependency>

      A sample applicationContext.xml file fragment configuring the rest of JavaMail (in this case I was using google mail):

      <!-- this is already here -->
      <bean class="org.springframework.mail.SimpleMailMessage" id="templateMessage">
      <property name="from" value="${email.from}" />
      </bean>
      <!-- this is needed -->
      <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
      <property name="host" value="${mail.server.host}" />
      <property name="port" value="${mail.server.port}" />
      <property name="username" value="${mail.server.username}" />
      <property name="password" value="${mail.server.password}" />
      <property name="protocol" value="${mail.server.protocol}" />
      <property name="javaMailProperties">
      <props>
      <prop key="mail.smtp.socketFactory.port">${mail.server.mail.smtp.socketfactory.port}</prop>
      <prop key="mail.smtp.socketFactory.class">${mail.server.mail.smtp.socketfactory.class}</prop>
      <prop key="mail.smtp.socketFactory.fallback">${mail.server.mail.smtp.socketfactory.fallback}</prop>
      </props>
      </property>
      </bean>

        Attachments

          Activity

            People

            Assignee:
            sschmidt Stefan Schmidt
            Reporter:
            krimple Ken Rimple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: