用Maven运行mvn包找不到目标'单'

时间:2017-12-02 20:16:02

标签: java maven

我正在尝试用maven编译一些java类来生成一个独立的可执行jar文件

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MainMap_Challange 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.335 s
[INFO] Finished at: 2017-12-02T20:08:49Z
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'single' in plugin org.apache.maven.plugins:maven-compiler-plugin:3.5.1 among available goals compile, help, testCompile -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException

我想生成一个独立的jar文件,就像这里解释的那样 https://maven.apache.org/plugins/maven-assembly-plugin/usage.html

我得到的错误是:

split /dev/null -n900 -a3 --additional-suffix=".txt" ""

在命令行上运行“mvn package”时

1 个答案:

答案 0 :(得分:2)

不使用<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background_flat_720x1280" tools:context="com.andrewvanpeter.upandaway.MainActivity"> ,请使用maven-compiler-plugin

maven-assembly-plugin

source