我正在使用spring和maven开发一个webapp,希望能够在本地tomcat服务器和intellij中运行应用程序。这种依赖似乎是罪魁祸首。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>当我移除这个依赖项时,由于另一个依赖项,应用程序在intellij中运行良好,但是不能在tomcat上运行。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>我可以设置一些东西来自动使用intellij的正确依赖项吗?
发布于 2015-04-01 18:06:20
您可以在pom.xml中设置maven配置文件,然后为Intellij使用特定的配置文件。Intellij允许您在运行构建时选择配置文件。
<profiles>
<profile>
<id>intellij</id>
…
<dependencies>
<dependency>…</dependency>
</dependencies>
…
</profile>
<profile>
<id>release</id>
…
<dependencies>
<dependency>…</dependency>
</dependencies>
…
</profile>
https://stackoverflow.com/questions/29397550
复制相似问题