我是Maven的新手,第一次尝试设置我的工作区,直到构建才看到错误
格式错误的POM G:\ WorkSpace \ Test \ pom.xml:无法识别的标记:'pluginRepositories'
<properties>
<maven.compiler.source>7.0</maven.compiler.source>
<maven.compiler.target>7.0</maven.compiler.target>
<maven.compiler.release>7.0</maven.compiler.release>
<java.version>12.0.2</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<pluginRepositories>
<pluginRepository>
<id>bintray</id>
<name>Groovy Bintray</name>
<url>https://dl.bintray.com/groovy/maven</url>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version><!-- 3.6.2 is the minimum -->
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<compilerArguments>
<indy /><!-- optional; supported by batch 2.4.12-04+ -->
<configScript>config.groovy</configScript><!-- optional; supported
by batch 2.4.13-02+ -->
</compilerArguments>
<failOnWarning>true</failOnWarning><!-- optional; supported by batch
2.5.8-02+ -->
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.5.0-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.5.8-02</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginRepository>
</pluginRepositories>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
提供的任何帮助都将非常有用,如果您需要更多信息,请告诉我。
最佳答案
pluginRepositories
元素不属于build
元素。它应该在<project>
元素下(与<dependencies>
相同级别)