如何发现和修复eclipse和maven构建之间的差异?

时间:2016-01-23 22:14:11

标签: eclipse maven

我的项目在Eclipse下构建和测试,导出的产品运行良好。

同一个项目未通过UI测试,导出的产品在使用maven编译时也无法运行。

我的目标是能够使用maven。

来源:https://github.com/magwas/zenta/tree/62066a22663d90fd6f036c9b6b5f34911f875bd1

两个生成的产品的文件列表之间的差异(DATE表示类似日期的字符串,这两个产品不同;当没有.jar结束时,则有一个目录包含额外的内容而不是jar eclipse版本的打包jre是openjdk 8):

--- Zenta.eclipse.list  2016-01-23 22:39:30.783376017 +0100
+++ Zenta.mvn.list  2016-01-23 22:39:30.803376017 +0100
@@ -1,511 +1,27 @@
+./Zenta/artifacts.xml
-./Zenta/.eclipseproduct
 ./Zenta/icon.xpm
-./Zenta/jre
+./Zenta/p2
-./Zenta/plugins/org.eclipse.draw2d_3.9.101.201408150207.jar
+./Zenta/plugins/org.eclipse.draw2d_3.10.1.201508170204.jar
-./Zenta/plugins/org.rulez.magwas.zenta.canvas_2.4.0.DATE
-./Zenta/plugins/org.rulez.magwas.zenta.editor_2.4.0.DATE
-./Zenta/plugins/org.rulez.magwas.zenta.export_2.2.0.DATE
+./Zenta/plugins/org.rulez.magwas.zenta.canvas_2.4.0.DATE.jar
+./Zenta/plugins/org.rulez.magwas.zenta.editor_2.4.0.DATE.jar
+./Zenta/plugins/org.rulez.magwas.zenta.export_2.2.0.DATE.jar
 ./Zenta/plugins/org.rulez.magwas.zenta.help_2.4.0.DATE
-./Zenta/plugins/org.rulez.magwas.zenta.model_2.4.0.DATE
-./Zenta/plugins/org.rulez.magwas.zenta.templates_2.4.0.DATE
-./Zenta/plugins/org.rulez.magwas.zenta.widgets_2.4.0.DATE
+./Zenta/plugins/org.rulez.magwas.zenta.model_2.4.0.DATE.jar
+./Zenta/plugins/org.rulez.magwas.zenta.templates_2.4.0.DATE.jar
+./Zenta/plugins/org.rulez.magwas.zenta.widgets_2.4.0.DATE.jar
-./Zenta/plugins/org.w3c.dom.smil_1.0.0.v200806040011.jar
+./Zenta/plugins/org.w3c.dom.smil_1.0.1.v200903091627.jar
-./Zenta/plugins/uk.ac.bolton.jdom_1.1.1.DATE
+./Zenta/plugins/uk.ac.bolton.jdom_1.1.1.DATE.jar
+./Zenta/Zenta.ini

运行maven构建产品的日志文件:

!SESSION 2016-01-23 23:00:47.725 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_72-internal
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2016-01-23 23:00:48.935
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

org.eclipse.core.runtime似乎对两者都是一样的:

$ find |grep org.eclipse.core.runtime
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/.api_description
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF/ECLIPSE_.SF
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF/ECLIPSE_.RSA
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF/MANIFEST.MF
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/fragment.properties
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/about.html
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/runtime_registry_compatibility.jar
./Zenta.eclipse/Zenta/plugins/org.eclipse.core.runtime.compatibility_3.2.200.v20140128-0851.jar
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.manager
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.manager/.fileTable.7
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.manager/.fileTable.8
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.manager/.fileTableLock
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.mainData.1
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.contributors.1
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.contributions.1
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.table.1
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.orphans.1
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.namespaces.1
./Zenta.eclipse/Zenta/configuration/org.eclipse.core.runtime/.extraData.1
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/.api_description
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF/ECLIPSE_.SF
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF/ECLIPSE_.RSA
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/META-INF/MANIFEST.MF
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/fragment.properties
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/about.html
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/runtime_registry_compatibility.jar
./Zenta.mvn/Zenta/plugins/org.eclipse.core.runtime.compatibility_3.2.200.v20140128-0851.jar

1 个答案:

答案 0 :(得分:1)

至少有四个问题:

  • 避免消息"无法获取PlatformAdmin服务器"在UT和IT期间,添加到父pom,在target-platform-configuration的配置部分:

<dependency-resolution>
  <extraRequirements>
    <requirement>
      <type>eclipse-plugin</type>
      <id>org.eclipse.osgi.compatibility.state</id>
      <versionRange>0.0.0</versionRange>
    </requirement>
  </extraRequirements>
</dependency-resolution>

和org.rulez.magwas.zenta.integrationtests pom,在tycho-surefire-plugin的配置部分:

<dependency>
  <type>eclipse-plugin</type>
  <artifactId>org.eclipse.core.runtime.compatibility.registry</artifactId>
  <version>0.0.0</version>
</dependency>

<repository>
  <id>4.5</id>
  <layout>p2</layout>
  <url>http://download.eclipse.org/eclipse/updates/4.5</url>
</repository>
<repository>
  <id>orbit</id>
  <layout>p2</layout>
  <url>http://download.eclipse.org/tools/orbit/downloads/drops/R20150821153341/repository/</url>
</repository>
  • 后果:自Eclipse Mars以来,32位可可支持已被删除。 比照http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg07799.html 删除对Mac OS X 32位的支持:

    • org.rulez.magwas.zenta.editor.launch.macos
    • org.rulez.magwas.zenta.editor.fullscreen.macos
  • 从org.rulez.magwas.zenta.integrationtests&#39;删除mockito-core-debian.jar。 .classpath

集成测试期间仍有6个错误。它们似乎与测试本身有关。