我配置了Maven 3.0.3并尝试使用此命令使用archetypes下载示例项目:
mvn archetype:generate -DarchetypeGroupId=org.graniteds.archetypes
-DarchetypeArtifactId=graniteds-tide-spring-jpa-hibernate
-DgroupId=org.example
-DartifactId=gdsspringflex
-Dversion=1.0-SNAPSHOT
Run Code Online (Sandbox Code Playgroud)
(来自此链接的命令:http://java.dzone.com/articles/enterprise-ria-spring-3-flex-4)
我收到了这个错误:
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
.
.
.
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could …Run Code Online (Sandbox Code Playgroud) 我正在研究弱引用.我明白在OutOfMemoryError发生之前,所有弱引用都将被垃圾收集.我有一个像这样的简单测试(我知道捕获OOME不好但只是一个测试):
Integer weakInt = new Integer(10);
WeakReference<Integer> weakReference = new WeakReference<Integer>(weakInt);
try {
while (weakReference != null) {
String[] generateOutOfMemoryStr = new String[999999999];
}
}
catch (OutOfMemoryError oome) {
System.out.println(weakReference.get());
}
Run Code Online (Sandbox Code Playgroud)
我期望打印null,因为弱引用应该已经收集但我总是得到10的输出.
请让我知道我哪里出错了.可能是我理解弱引用的概念错了?