Hi Here is the tomee mvn plugin doc http://tomee.apache.org/tomee-maven-plugin.html
I think your path is wrong (seems you put a name and not a path) Le 24 sept. 2013 00:15, "Esben Rugbjerg" <[email protected]> a écrit : > Hi, > > I am trying to do some integration testing using Maven and TomEE. But I > have problems deploying the WAR using the Maven plugin. > > I have a small servlet which should deploy applications using our own old > deployment system. > I have a deployment motor for test (DummyDeploymentMotor) and one for > production (NshDeploymentMotor). > > I have a pom.xml where I build both a test-war and a production-war > including different deployment motor classes. The correct class > is injected into the servlet using the @Inject and @Alternative annotations > and the beans.xml pointing at the correct class is generated during build. > > The main servlet is annotated with: > @WebServlet(name = "DeployServiceServlet", urlPatterns = { "/deployee" }, > loadOnStartup = 0) > @MultipartConfig > > I can execute the integration tests against the test version of the > application if I start up TomEE from Maven in the pre-integration-test > phase, run the tests in the > integration-test phase and close down the TomEE in the > post-integration-test phase. I am using the following configuration in the > pom.xml > > <plugin> > <groupId>org.apache.openejb.maven</groupId> > <artifactId>tomee-maven-plugin</artifactId> > <version>1.0.1</version> > <executions> > <execution> > <id>tomee-run</id> > <phase>pre-integration-test</phase> > <goals> > <goal>start</goal> > </goals> > <configuration> > <tomeeVersion>1.5.2</tomeeVersion> > <tomeeClassifier>plus</tomeeClassifier> > <tomeeHttpPort>${tomee.http.port}</tomeeHttpPort> > <path>/${project.build.finalName}</path> > <fork>true</fork> > </configuration> > </execution> > <execution> > <id>tomee-shutdown</id> > <goals> > <goal>stop</goal> > </goals> > <phase>post-integration-test</phase> > </execution> > </executions> > </plugin> > As far as I can see the WAR is actually not deployed the TomEE is simply > pointed to the path of the directory containing the files that will go into > the > WAR. Is this correct ? > I try to deploy the WAR using the following configuration: > <plugin> > <groupId>org.apache.openejb.maven</groupId> > <artifactId>tomee-maven-plugin</artifactId> > <version>1.0.1</version> > <executions> > <execution> > <id>tomee-deploy</id> > <phase>pre-integration-test</phase> > <goals> > <goal>deploy</goal> > </goals> > <configuration> > <tomeeVersion>1.5.2</tomeeVersion> > <tomeeClassifier>plus</tomeeClassifier> > <tomeeHost>${tomeeHostName}</tomeeHost> > <tomeeHttpPort>${tomee.http.port}</tomeeHttpPort> > <path>${project.build.finalName}</path> > > <warFile>${project.build.directory}${file.separator}${project.build.finalName}.${project.packaging}</warFile> > </configuration> > </execution> > <execution> > <id>tomee-undeploy</id> > <goals> > <goal>undeploy</goal> > </goals> > <phase>post-integration-test</phase> > </execution> > </executions> > </plugin> > > When I try to run Maven with a profile containing this configuration I get > the following error: > > [ERROR] Failed to execute goal > org.apache.openejb.maven:tomee-maven-plugin:1.0.1:deploy (tomee-deploy) on > project DeployService: > Execution tomee-deploy of goal > org.apache.openejb.maven:tomee-maven-plugin:1.0.1:deploy failed: > org.apache.openejb.loader.Files$FileDoesNotExistException: > Does not exist: C:\Program Files\apache-tomee-plus-1.5.2\bin\DeployService: > Does not exist: C:\Program Files\apache-tomee-plus-1.5.2\bin\DeployService > -> [Help 1] > > Nothing appears in the webapps folder on the server but in the bin folder a > empty folder called 'DeployService.unpacked' is created > > If I change the <path> to > > ${project.build.directory}${file.separator}${project.build.finalName}.${project.packaging} > i.e. the same as the <warFile> then I get the following error: > > [ERROR] Failed to execute goal > org.apache.openejb.maven:tomee-maven-plugin:1.0.1:deploy (tomee-deploy) on > project DeployService: > Execution tomee-deploy of goal > org.apache.openejb.maven:tomee-maven-plugin:1.0.1:deploy failed: The bean > encountered a non-application exception; > nested exception is: > [ERROR] org.apache.openejb.OpenEJBRuntimeException: > java.io.FileNotFoundException: > Y:\tp124295DDrev\workspaceJenkins\DeployService\target\DeployService.war > > The file is of course prestent at the listed path. > > There is not created any new folder in the bin folder. > > The TomEE I try to deploy on is version 1.5.2 just like the one referenced > in the pom.xml. > > What could the problem be and where should I start looking ? > > My Java version is oracle170-64 on a Windows 7. > > Please tell if you need more information in order to help me. > > Regards > Esben Rugbjerg > > -- > ================= > cand.polyt. > Esben Rugbjerg > Guldborgvej 44, 3.th. > 2000 Frederiksberg > Danmark > email: [email protected] > mobil-tlf.: +45 28715166 > ================= >
