如何配置maven编译器使用java 5作为我的测试代码,java 1.4作为我的主代码?
作为我项目配置的一部分,我正在尝试从GitHub存储库中签出特定标记.目前插件配置如下:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<executions>
<execution><!-- checkout the msgppack-rpc project -->
<id>msgpack-rpc-checkout</id>
<phase>validate</phase>
<goals>
<goal>checkout</goal>
</goals>
<configuration>
<goals>checkout</goals>
<connectionUrl>scm:git:https://github.com/msgpack/msgpack-rpc.git</connectionUrl>
<tag>java-0.6.0</tag>
<checkoutDirectory>repoCode/msgpack-rpc</checkoutDirectory>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但是,Git SCM提供程序似乎忽略了"tag"元素.我也尝试将标记直接放在URL中,例如:
scm:git:https://github.com/msgpack/msgpack-rpc.git/refs/tags/java-0.6.0
不幸的是,这种格式的这种和其他排列会产生错误.我没有其他想法,我也没能在任何地方找到这个用例的例子.
与此问题类似,我收到以下错误:
[INFO] --- android-maven-plugin:3.3.0:dex (default-dex) @ betodef-android ---
[INFO] /usr/lib/jvm/java-6-sun-1.6.0.32/jre/bin/java [-Xmx1024M, {snip}
[INFO]
[INFO] UNEXPECTED TOP-LEVEL ERROR:
[INFO] java.lang.OutOfMemoryError: GC overhead limit exceeded
Run Code Online (Sandbox Code Playgroud)
这是在我向Android项目中添加了几个依赖项(包括fastutil)之后发生的.但是,增加可用内存dex并不能解决问题.
我有几个Maven项目,比如a,b,c,从一个单亲继承(让我们称之为parent),并且也正在模块(不同的项目比parent,让我们叫它super).
这些项目都有pom包装.这些项目中的每一个都有特定的配置,但它们也有一个共同的部分.为了更具说明性,每个项目都有两个JMeter测试配置文件:一个专用于给定项目,另一个专用于所有项目.
问题是 - 我应该如何配置POM,以便在项目之间共享这个通用配置文件?
解决方法是将所有这些内容合并到一起super,然后使用配置文件.但是,在这种情况下,我必须手动为每个配置单独构建(而现在我可以构建super).
有类似的问题,比如这个,但是它们处理jar插件,这与这种情况无关.
结构,供参考:
POM继承:
parent
|
-------------
| | |
a b c
Run Code Online (Sandbox Code Playgroud)文件结构:
super
|
|-a
|
|-b
|
|-c
Run Code Online (Sandbox Code Playgroud)我已经使用 Android Maven 集成在 Eclipse 中设置了一个项目,并使用 Robolectric 进行了一些测试。
当我将它们部署在 Eclipse 中时,测试运行良好。然而,当我尝试使用Maven“安装”目标构建项目时(这实际上是我本地 Maven 存储库中需要的库),它在这些相同的测试中失败了。
日志显示以下错误:
testAll((package).MyTest) Time elapsed: 0.006 sec <<< ERROR!
java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an exception while obtaining a class file for (package).R
at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:316)
at com.xtremelabs.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:270)
at com.xtremelabs.robolectric.RobolectricTestRunner.internalBeforeTest(RobolectricTestRunner.java:221)
at com.xtremelabs.robolectric.RobolectricTestRunner.methodBlock(RobolectricTestRunner.java:201)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350) …Run Code Online (Sandbox Code Playgroud) 由于ZooKeeper集成,SolrCloud有一些很好的实用程序来管理和重新加载核心/集合配置.
但是,这仅仅完全涵盖了微不足道的更新 - 但也有非常重要的更新.非平凡在这种情况下,意味着产生了一些变化,使一个更新的节点和/或它的芯用一些以前的状态不兼容的.
特别是,我想到了这些子类:
我的问题是:如何使用SolrCloud和相关的Zookeeper服务来使这些更新更容易,更可靠和/或确保更高的可用性?
注意:我希望有一些"理解"此类更新的API /功能.到目前为止,我发现最值得注意的是CoreAdmin中的集合别名,这将允许"旧"和"新"版本之间更平滑的过渡 - 考虑到上述希望,这有点令人失望.
我正在使用Box2D通过Libgdx创建一个场景.我有一个场景,我想不断推进一个特定的对象applyForce(方向会不时改变),但只能达到给定的速度.
想象一下由火箭发动机(所有侧面都有喷嘴)推动的圆形物体,零G,用于说明.
有没有办法在不重新计算所施加的力量的情况下执行此操作,或者在每次更新时执行重复计算?我只知道如何为所有对象设置最大速度.我目前最好的选择是以linearDamping某种方式使用,但我希望有一个更简单的解决方案.
将模板从Java转换为Scala时,我注意到以下带有多行注释的怪癖可以简化为以下代码段:
/**
* /*
*/
class Blah {}
Run Code Online (Sandbox Code Playgroud)
上述代码无法使用"error:unclosed comment"编译,而在Java中有效.
这证明是有问题的,因为它使得更难以记录例如接受全球型字符串(例如"需要类似路径something/*.myformat").
这是一个错误还是一个功能?