Skip to content

Instantly share code, notes, and snippets.

@marksnoopy
Last active October 19, 2015 02:43
Show Gist options
  • Save marksnoopy/51b3ea8cc27f2bfb6bbc to your computer and use it in GitHub Desktop.
Save marksnoopy/51b3ea8cc27f2bfb6bbc to your computer and use it in GitHub Desktop.
maven 命令常见错误

Analytics

mvn archetype:create 创建项目错误

1、错误输出

[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven
-archetype-plugin:2.3
Cause: Cannot assign configuration entry 'pomRemoteRepositories' to 'interface j
ava.util.List' from 'null', which is of type class java.lang.String

2、原因分析

3、解决方案

mvn archetype:generate -DgroupId=xxx -DartifactId=yyy

mvn 执行项目报 source 不支持

1、错误输出

for-each loops are not supported in -source 1.3

2、原因分析

maven 默认的编译插件版本很低,导致编译失败

3、解决方案

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>UTF-8</encoding>
        </configuration>
    </plugin>
</plugins>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment