【发布时间】:2018-05-04 21:05:25
【问题描述】:
我有一个基于 Spring Boot 的项目,它托管在一个 google drive 共享文件夹上,它可以帮助我和我的团队实时协作。
我想更改默认目标目录,这样当我运行我的项目时,我的团队成员不必同步构建,而只需同步我的编码。
我做了一些研究,但我尝试在这里不起作用的是我的基础构建 maven
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<directory>c:/myProject</directory>
<outputDirectory>c:/myProject/classes</outputDirectory>
</build>
但这不起作用,maven 说他可以找到主类
默认的maven配置如下
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
我应该怎么做才能使这个目标转到 c:/myProject
【问题讨论】:
-
据我所知,您可以从 google 驱动器同步中排除文件夹,这可能是比更改输出路径更好的方法。
-
这些是来自super pom的maven默认值
<project>...<build> <directory>${project.basedir}/target</directory> <outputDirectory>${project.build.directory}/classes</outputDirectory>......并且可以被单个pom覆盖...我认为这是一个非常“硬开关”,应该会影响所有(不太花哨)插件。