问题:
moduleA pom 类型聚合模块
moduleB jar 普通模块
moduleC jar 要打包成可执行的jar 包
一开始没注意在modelA 的pom的build中添加了
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
如下依赖,结果mvn 以为要把所有的模块打包成可以执行的jar 包, 如果module 中没有可以执行的main 方法, 就会报找不到main 方法的错误,如果你不小心在这个模块中写了main方法, 他就会把他当成可执行的jar 打包, 结果打了一个特别大的jar包,
正确的做法是在想要执行的module 上添加如上依赖, 打包即可
遗留的问题
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<dependencies>
<dependency>
<groupId>com.oracle.driver</groupId>
<artifactId>jdbc-driver</artifactId>
<version>11g</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>3.4.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<phase>package</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<overwrite>false</overwrite>
<configurationFile>src/main/resources/mybatis-generator.xml</configurationFile>
</configuration>
</plugin>
modelA 加上如上依赖会报错