【发布时间】:2018-08-15 07:32:26
【问题描述】:
我试图创建一个 maven 项目并稍后添加 spring boot 依赖项,但我不断收到关于 maven 插件的错误突出显示。下面是截图: Maven Projects screenshot from intellij
还有我的 POM 文件内容:
<?xml version="1.0" encoding="UTF-8"?>
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>org.springframework</groupId>
<artifactId>gs-producing-web-service</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<repositories>
<repository>
<id>java.net</id>
<url>http://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<!-- tag::springws[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
<!-- end::springws[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- tag::xsd[] -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<clearOutputDir>false</clearOutputDir>
</configuration>
</plugin>
<!-- end::xsd[] -->
</plugins>
</build>
【问题讨论】:
-
您是否尝试过构建您的项目?如果有效,则可以,否则报告错误。通常这要么是 Eclipse 疯狂运行,要么是存储库设置不正确,要么是代理/防火墙。
-
是的,我正在修改 .m2 中的 settings.xml,发现私有仓库被设置为镜像,我用 repo.maven.apache.org/maven2 替换它,我只缺少两个(部署和安装插件)我会尝试更多。
-
你试过安装吗?
标签: java maven spring-boot