Maven packs multiple source directory projects and Jenkins cannot start Tomcat

Source: Internet
Author: User

When you encounter multiple source directory in a Java project, MAVEN is not packaged properly, can only package the content under Src/main/java, need to introduce a plug-in to solve this problem.

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/mail/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

You can package multiple different source directory when you implement Maven.

In addition, when you perform the automatic compilation and packaging command with Jenkins and restart the server, Tomcat is seen to be killed as the Jenkins process completes after Tomcat is started.

You need to add the export Build_id=pleasedonotkillme to the script that starts Tomcat. To avoid being killed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.