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.