Thursday, June 27, 2013

publish with maven in tomcat7

There're a bug in plugin
   org.apache.tomcat.maven
   tomcat7-maven-plugin
   2.1
dont read the tag configuration you must put each var in section properties
      
  http://localhost:port/manager/text
  TomcatServer
  ${project.artifactId}
  true
  /${project.build.finalName}
 
and execute goal mvn tomcat:redeploy this work¡

Wednesday, June 5, 2013

integration-test with web server

I want created a integration-test with web server tomcat to launch integration test execute
mvn integration-test -Ptomcat 
to generate war file
mvn package
In a hand i have web server tomcat: to launch integration-test i have a this file pom.xml to start and stop tomcat web service

   tomcat
   
 
      org.codehaus.mojo
      tomcat-maven-plugin
      1.1
      
       true
       true
       /${project.build.finalName}
       ${project.build.directory}/${project.build.finalName}.war
       9876
      
      
       
        start-tomcat
        pre-integration-test
        
         run-war
        
       
       
        stop-tomcat
        post-integration-test
        
         shutdown
        
       
      
     
and the other hand i have the integration test

   
    maven-surefire-plugin
    
     true
    
   
   
    maven-failsafe-plugin
    2.7.2
    
     
      **/*Test.java
     
    
    
     
      integration-test
      integration-test
      
       integration-test
      
     
     
      verify
      verify
      
       verify
      
     
    
   
  
But I have a problem to add resources files. you need add this line in your pom.xml file

     
      src/test/resources
      
       app.properties
      
     
    
and add this line in pom.xml file to erase previous resources files generate with execute integration test

      org.apache.maven.plugins
      maven-clean-plugin
      2.5
      
       
        clean
        generate-resources
        
         clean