-
1. Re: Disabling WELD 2.3.0.Final for a particular servlet inside an embedded Tomcat.
mkouba Oct 15, 2015 11:15 AM (in response to chrisjr)I'm not aware of any way to disable the EnhancedListener in such an environment. Could you try to migrate to a managed Tomcat container adapter instead?
-
2. Re: Disabling WELD 2.3.0.Final for a particular servlet inside an embedded Tomcat.
chrisjr Oct 15, 2015 11:59 AM (in response to mkouba)The Arquillian tests are being run by maven-failsafe-plugin as part of a standard Maven project structure. So the project starts an embedded Tomcat via an Arquillian extension, executes the integration tests against it and the shuts the embedded Tomcat down again. I simply have no idea if this is even possible using the managed Tomcat container adapter, since the project would need to create its own Tomcat installation to manage in the first place.
-
3. Re: Disabling WELD 2.3.0.Final for a particular servlet inside an embedded Tomcat.
mkouba Oct 16, 2015 2:34 AM (in response to chrisjr)Well, you could make use of Tomcat dist artifact and maven-dependency-plugin, e.g.:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>process-test-classes</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat</artifactId> <version>7.0.64</version> <type>zip</type> <overWrite>false</overWrite> <outputDirectory>${project.build.directory}</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin>
And then set CATALINA_HOME to
${project.build.directory}/apache-tomcat-7.0.64
in maven-failsafe-plugin configuration. -
4. Re: Disabling WELD 2.3.0.Final for a particular servlet inside an embedded Tomcat.
chrisjr Oct 16, 2015 5:44 AM (in response to mkouba)Hi, that was a good starting point. I've moved the maven-dependency-plugin goal into the generate-test-resources phase so that I can rewrite the conf/server.xml file with Google's replacer plugin in the process-test-resouces phase, and I've added
<excludes>**/webapps/ROOT/**</excludes>
when unpacking Tomcat to remove its built-in ROOT.war.
And I've also needed to add a custom tomcat-users.xml file (copied from somewhere):
<?xml version="1.0" encoding="UTF-8"?> <tomcat-users> <role rolename="manager-gui"/> <role rolename="manager-jmx"/> <role rolename="manager-script"/> <user username="tomcat" password="tomcat" roles="manager-script, manager-jmx, manager-gui"/> <user username="${tomcat.user}" password="${tomcat.password}" roles="manager-script"/> </tomcat-users>
And then I still need to configure my application! But it looks promising.
Thanks,
Chris