maven 发布到tomcat 记录
mvn appfuse:full-source?from your project's root directory
- project facet还是要设置成dynamic ;futher configuration 设置修改成src/main/webapp,默认的是dyanmic工程的webContent。当前项目->properties->deployment assembly 中设置 maven 的依赖库 部署的位置,这里要改为:WEB-INFO/libbuild path 中默认的输出为:xxx/target/classes.这里的xxx 为工程名称。
常见错误:maven build 时出现有appfuse 单元测试的错误,可以先屏蔽掉pom.xml中单元测试的配置。如下图? ? ? ???<!--? ? ? ? ? ? ? ? ? ? <plugin>??????????????????????? <groupId>org.codehaus.mojo</groupId>??????????????????????? <artifactId>webtest-maven-plugin</artifactId>??????????????????????? <version>1.0.0</version>??????????????????????? <executions>??????????????????????????? <execution>??????????????????????????????? <id>webtest-test</id>??????????????????????????????? <phase>integration-test</phase>??????????????????????????????? <goals>??????????????????????????????????? <goal>test</goal>??????????????????????????????? </goals>??????????????????????????? </execution>??????????????????????????? <execution>??????????????????????????????? <id>webtest-verify</id>??????????????????????????????? <phase>verify</phase>??????????????????????????????? <goals>??????????????????????????????????? <goal>verify-result</goal>??????????????????????????????? </goals>??????????????????????????? </execution>??????????????????????????? <execution>??????????????????????????????? <id>webtest-report-html</id>??????????????????????????????? <phase>post-integration-test</phase>??????????????????????????????? <goals>??????????????????????????????????? <goal>report</goal>??????????????????????????????? </goals>??????????????????????????? </execution>??????????????????????? </executions>??????????????????????? <configuration>??????????????????????????? <host>${cargo.host}</host>??????????????????????????? <port>${cargo.port}</port>??????????????????????????? <sourcedirectory>src/test/resources</sourcedirectory>??????????????????????????? <sourcefile>web-tests.xml</sourcefile>??????????????????????????? <target>${webtest.target}</target>??????????????????????????? <basepath>${project.build.finalName}</basepath>??????????????????????????? <resultpath>target/webtest/webtest-results</resultpath>??????????????????????????? <haltonfailure>false</haltonfailure>??????????????????????????? <haltonerror>false</haltonerror>??????????????????????????? <loglevel>fatal</loglevel>??????????????????????? </configuration>??????????????????? </plugin>???????????????? -->?建议可以删除多余的数据库配置,比如oracle,h2等。如果出现mysql 方言的bug,将pom.xml中的org.hibernate.dialect.MySQL5InnoDBDialect 修改为:MySQL5Dialect.发布成功的标志是: