Is there a way of getting this to work?

We have a Maven project that depends on Apache's commons-email. We use JNDI
to look up a mail Session. We use the following in our POM:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <contextFile>tomcat/context.xml</contextFile>
                    <port>9000</port>
                    <path>/foo</path>
                    <fork>true</fork>
                    <extraDependencies>
                        <extraDependency>
                            <groupId>javax.mail</groupId>
                            <artifactId>mail</artifactId>
                            <version>1.4</version>
                        </extraDependency>
                        <extraDependency>
                            <groupId>javax.activation</groupId>
                            <artifactId>activation</artifactId>
                            <version>1.1.1</version>
                        </extraDependency>
                    </extraDependencies>
                </configuration>
                <executions>
                    <execution>
                        <id>start</id>
                        <goals>
                            <goal>run-war-only</goal>
                        </goals>
                        <phase>pre-integration-test</phase>
                    </execution>
                    <execution>
                        <id>shutdown</id>
                        <goals>
                            <goal>shutdown</goal>
                        </goals>
                        <phase>post-integration-test</phase>
                    </execution>
                </executions>
            </plugin>

Deployment fails with the following:

java.lang.ClassNotFoundException: javax.mail.Session

I have both mail and activation listed in the POM's dependencies with a
scope of provided.

Is further magic required?

Thanks,

James

Reply via email to