[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy-dependencies (default-cli) on project net-scan: Execution default-cli of goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy-dependencies failed: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-artifact:jar:2.0.9, org.apache.maven:maven-plugin-api:jar:2.0.9, org.apache.maven:maven-project:jar:2.0.9, org.apache.maven:maven-settings:jar:2.0.9, org.apache.maven:maven-profile:jar:2.0.9, org.apache.maven:maven-plugin-registry:jar:2.0.9, org.apache.maven:maven-model:jar:2.0.9, org.apache.maven:maven-core:jar:2.0.9, org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9, org.apache.maven:maven-error-diagnostics:jar:2.0.9, org.apache.maven:maven-plugin-descriptor:jar:2.0.9, org.apache.maven:maven-monitor:jar:2.0.9, org.apache.maven:maven-artifact-manager:jar:2.0.9, org.apache.maven:maven-repository-metadata:jar:2.0.9, org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6: Cannot access repo2 (http://repo2.maven.org/maven2/) in offline mode and the artifact org.apache.maven:maven-artifact:jar:2.0.9 has not been downloaded from it before. -> [Help 1]
1、第一步

maven buid 导出项目依赖的jar包问题-冯金伟博客园

2、第二步

maven buid 导出项目依赖的jar包问题-冯金伟博客园

2、第三步

org.apache.maven.plugins:maven-jar-plugin:2.4:jar dependency:copy-dependencies

dependency:copy-dependencies

maven buid 导出项目依赖的jar包问题-冯金伟博客园

注: Myeclipse10以管理员身份运行。

解决-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match.

1.添加M2_HOME的环境变量

如:Z:EnvironmentJavaapache-maven-3.3.9

2.Preference->Java->Installed JREs->Edit 选择一个jdk,
修改Default VM arguments的值:
-Dmaven.multiModuleProjectDirectory=$M2_HOME