从头开始构建Eclipse IDE - 如何指定目标操作系统? [英] Building Eclipse IDE from scratch - how to specify the target OS?

查看:260
本文介绍了从头开始构建Eclipse IDE - 如何指定目标操作系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这篇文章是关于从源代码构建整个Eclipse IDE,特别是如何指定要构建可执行文件的目标操作系统。





我发现以下教程指导我完成构建过程: http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html



特别是该教程的第13章是有帮助的。我会描述在这里需要逐步采取的步骤,所以你不需要阅读vogella教程。



需要的软件: strong>



显然,您需要在(Windows)机器上安装以下软件:




  • Git

  • Maven版本3.3.1(请确保您将提取Maven的bin文件夹添加到PATH中。有关安装说明,请参阅 https://maven.apache.org/install.html

  • Oracle 1.8 JDK或更高版本(不要忘记设置JAVA_HOME环境变量)



现在您可以开始:



步骤1:



C中创建一个新文件夹: \ 磁盘。让我们命名为 C:\myEclipse 。这将是我们提取最新Eclipse版本的Git仓库的文件夹。



步骤2:



以管理员权限打开Windows cmd shell(右键单击 cmd 图标,如果您在桌面上创建一个,并选择打开管理员权限)。通过命令 cd C:\myEclipse 转到该文件夹​​。现在键入以下命令: git config --system core.longpaths true 。这将通知Git可以在存储库中发生长名称。



步骤3:



克隆Git仓库:

  git clone -b master --recursive git://git.eclipse.org/gitroot /platform/eclipse.platform.releng.aggregator.git 

现在你应该对所有的源代码被复制到您的本地文件夹。



步骤4:



最后现在是开始构建的时候了。构建过程已经需要几个小时,所以跳过单元测试是明智之举。因此,不要忘记添加 -DskipTests 参数。这是开始构建的命令:

  mvn clean verify -DskipTests 
/ pre>

几个小时后,构建应该完成。



步骤5:



构建的结果现在应该在以下文件夹:



C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.releng.tychoeclipsebuilder\sdk \target\products



请注意,Eclipse IDE是为所有可能的目标机器构建的。 32位Windows,64位Windows,Macintosh,Linux,...难怪需要几个小时!我想为仅一个目标构建一个目标,例如我的64位Windows机器。这将有望大大减少构建时间,并允许我更快地验证代码更改。



有没有人知道如何实现?






编辑:



我添加了参数 -Dnative = win32.win32.x86_64 到构建命令。不幸的是,15到20分钟后我收到错误。这一次,我也添加了参数 -X ,以获取调试信息:

  ... 

[INFO] equinox-sdk ........................... ............. SKIPPED
[INFO] org.eclipse.rcp.id ...................... ........... SKIPPED
[INFO] org.eclipse.rcp.sdk.id ...................... ....... SKIPPED
[INFO] org.eclipse.platform.ide ........................... SKIPPED
[INFO] org.eclipse.platform.sdk ........................... SKIPPED
[INFO] org .eclipse.sdk.ide ................................ SKIPPED
[INFO] eclipse-junit-测试................................ SKIPPED
[INFO] eclipse.platform.repository .... .................... SKIPPED
[INFO] platform-aggregator ................... ............. SKIPPED
[INFO] ----------------------------- ------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------ -----------------------------
[INFO]总时间:23:54分钟
[INFO]完成于:2016-06-19T18:12:14 + 02:00
[INFO] Final Memory:668M / 3263M
[INFO] --------------------------------------------- --------------------------
[ERROR]无法执行目标org.apache.maven.plugins:maven-antrun-plugin :1.8:run(natives)on project org.eclipse.swt.win32.win32.x86_64:Ant BuildException已发生:执行此行时发生以下错误:
[ERROR] C:\myEclipse\ eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915:执行此行时发生以下错误:
[ERROR] C: \myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012:exec returned:1
[ERROR] around Ant部分...< ant antfile =build.xmltarget =build_libraries/> ... @ 4:54在C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.pl atform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
[ERROR] - > [帮助1]
org.apache.maven.lifecycle.LifecycleExecutionException:无法执行目标org.apache.maven.plugins:maven-antrun-plugin:1.8:
在项目组织上运行(本机)。 eclipse.swt.win32.win32.x86_64:
Ant BuildException已发生:
执行此行时发生以下错误:
C:\myEclipse\eclipse.platform.releng。 aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915:执行此行时发生以下错误:
C:\myEclipse\eclipse.platform。 releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012:exec返回:1在Ant部分附近...< ant antfile =build.xmltarget = C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32中的build_libraries/> ... @ 4:54。 win32.x86_64\target\antrun\build-为主。 xml
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153 )
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116 )
在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
在org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder .java:51)
在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307 )
在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:19 3)
在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
在org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
在org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect .NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:498)
在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
在org.codehaus .plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launc her.java:415)
在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
导致:
org.apache.maven.plugin。 MojoExecutionException:
Ant BuildException已发生:

执行此行时发生以下错误:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse .platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915:

执行此行时发生以下错误:
C:\myEclipse\ eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012:exec返回:1在Ant部分附近...< ant antfile =build。 xmltarget =build_libraries/> ... @ 4:54在C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse中。 swt.win32.win32.x86_64\target \antrun\build-main.xml
在org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:342)
在org.apache.maven.plugin.DefaultBuildPluginManager。 executeMojo(默认BuildPluginManager.java:134)
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20更多
导致: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-主.xml

:4:执行此行时发生以下错误:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles \org.eclipse.swt\buildSWT.xml

:915:执行此行时发生以下错误:
C:\myEclipse\\ eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012:exec返回:1
在org.apache.tools.ant.ProjectHelper .addLocationToBuildException(ProjectHelper.java:568)
在org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:443)
在org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang .reflect.Method.invoke(Method.java:498)
在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
在org.apache.tools.ant .Task.perform(Task.java:348)
在org.apache.tools.ant.Target.execute(Target.java:435)
在org.apache.tools.ant.Target.performTasks(Target.java:456)
在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
在org.apache .tools.ant.Project.executeTarget(Project.java:1364)
在org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:313)
... 22更多
导致:C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml

:915:执行此行时出现以下错误:
C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT .xml:1012:exec返回:1
在org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:568)
在org.apache.tools.ant.taskdefs.Ant.e xecute(Ant.java:443)
在org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
在org.apache.tools.ant.UnknownElement.execute( UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang。 reflect.Method.invoke(Method.java:498)
在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
在org.apache.tools.ant。 Task.perform(Task.java:348)
在org.apache.tools.ant.Target.execute(Target.java:435)
在org.apache.tools.ant.Target.performTasks( Target.java:456)
在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
在org.apache.tools.ant.helper.Sin gleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
在org.apache.tools.ant.Project.executeTargets(Project.java:1248)
在org.apache.tools.ant.taskdefs.Ant。执行(Ant.java:441)
... 33更多

导致:C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\\ \\ bundles\org.eclipse.swt\buildSWT.xml:1012:exec返回:1
在org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAcc essorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:498)
在org.apache.tools.ant.dispatch.DispatchUtils.execute( DispatchUtils.java:106)
在org.apache.tools.ant.Task.perform(Task.java:348)
在org.apache.tools.ant.Target.execute(Target.java: 435)
在org.apache.tools.ant.Target.performTasks(Target.java:456)
在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
在org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
在org.apache.tools.ant.Project.executeTargets(Project.java:1248)
在org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
... 46更多
[错误]
[错误]
[错误]有关错误和可能的更多信息请阅读以下文章:
[错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[错误]
[错误]纠正这些问题后,您可以使用命令

恢复构建。[ERROR] mvn< goals> -rf:org.eclipse.swt.win32.win32.x86_64





$ b $我还没有答案,所以我开始一个赏金。请重新生成步骤1 ,直到机器上的步骤5 (添加 -Dnative = win32.win32.x86_64 参数到第四步)。您是否仅为一个操作系统目标(最好是Windows 64位)实现Eclipse IDE的成功构建?与所有操作系统的通用构建过程相比,构建是否更快?



PS:我有一些与Eclipse相关的其他问题从头开始构建话题。如果您有兴趣:





让我们一起自己构建Eclipse IDE - 调整我们的需求; - )






编辑:

$先生/ Mss先生/ bss Zapl写了一个有趣的评论。他/她认为 -Dnative 参数是不正确的,在他/她阅读以下链接之后:
http://comments.gmane.org/gmane.comp.ide.eclipse.cbi.devel/896



希望我们现在可以更接近答案: - )






FINAL EDIT:



突然,这个问题引起了社区的关注。我在短时间内得到了很多建议/答案。我现在无法验证其中的每一个,因为构建过程大约需要2个小时。



我剩下19个小时可以奖励50分的赏金。如果您在自己的机器上成功地将STEPS 1..5从这个问题转载出来,请让我知道,并且为一个特定的OS 从头开始构建Eclipse IDE。我会给你奖金: - )

解决方案

这个代码段来自一个可以导出到win32.win32的工作的pom.xml .x86_64。
也许某些部分不是您的项目所必需的,但可能是将其添加到您的pom文件中的良好起点。

  .. 
..
< build>
< plugins>
< plugin>
< groupId> org.eclipse.tycho< / groupId>
< artifactId> tycho-maven-plugin< / artifactId>
< version> 0.20.0< / version>
< extensions> true< / extensions>
< / plugin>
< plugin>
< groupId> org.eclipse.tycho< / groupId>
< artifactId> target-platform-configuration< / artifactId>
< version> 0.20.0< / version>
< configuration>
< resolver> p2< / resolver>
< environments>
< environment>
< os> win32< / os>
< ws> win32< / ws>
< arch> x86_64< / arch>
< / environment>
< / environments>
< / configuration>
< / plugin>
< plugin>
< groupId> org.eclipse.tycho< / groupId>
< artifactId> tycho-compiler-plugin< / artifactId>
< version> 0.20.0< / version>
< configuration>
< compilerArgument> -err:-forbidden< / compilerArgument>
< / configuration>
< / plugin>
< / plugins>
< / build>
..
..

编辑 / p>

如我在注释中所提到的,我按照你的步骤,并遇到一些问题。我现在解决了大多数如果其他人也遇到很多错误,这里有一些解决方案。




  • 在文件eclipse.pde.ui / pom中。 xml行19:版本是4.6.0-SNAPSHOT,但必须是4.7.0-SNAPSHOT


  • 提示:为加快构建速度,您可以添加例如-T 4到mvn命令以启用并行构建。我终于结束了> mvn clean verify -DSkipTests -T 4 -Dnative = win32.win32.x86_64




此后修复我能够运行,直到我得到与初始问题中提到的相同的错误。
我去了项目文件夹\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64并启动了Ant构建(Apache Ant版本1.9.7),它完成没有错误。但是当它被Maven构建执行时,我得到了相同的错误。
因此,我检查了文件\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml的第915和1012行。在设置failonerror =false(默认情况下设置为true)之后,我能够继续构建。我认为这是一个非常糟糕的解决方案,它不应该是禁用这种测试的最终解决方案。



最后,我结束了在项目org.eclipse.pde.build.tests中出现错误,并停止了以下问题。
整个项目似乎在许多部分配置错误,到目前为止我找不到更好的解决方案。人们应该记住黄金法则,不要犯任何破坏建设的东西,以避免这种问题。也许这些问题将在售后回购的几个更新后解决。


This post is about building the whole Eclipse IDE from the source code - and more in particular how to specify the target OS you want to build the executable for.

I found the following tutorial to guide me through the build procedure: http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html

Especially chapter 13 of that Tutorial is helpful. I will describe the steps that need to be taken one by one here - so you don't need to read the vogella tutorial.

NEEDED SOFTWARE :

Apparently you need to have the following software installed on your (Windows) machine:

  • Git
  • Maven Version 3.3.1 (make sure that the bin folder where you extract Maven is added to the PATH. For installation instructions see https://maven.apache.org/install.html)
  • Oracle 1.8 JDK or higher (don't forget to set the JAVA_HOME environment variable)

Now you're ready to start:

STEP 1 :

Create a new folder in the C:\ disk. Let's name it C:\myEclipse. This will be the folder in which we pull the Git repository of the latest Eclipse version.

STEP 2 :

Open the Windows cmd shell with administrator privileges (right click on cmd icon if you made one on your desktop, and select open with admin rights). Go to that folder through the command cd C:\myEclipse. Now type the following command: git config --system core.longpaths true. This notifies Git that long names can occur in the repository. Forget this command and it will result in errors later on.

STEP 3 :

Clone the Git repository:

git clone -b master --recursive git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git

Now you should have some patience for all the sourcecode to get copied to your local folder.

STEP 4 :

Finally it is time to start the build. The build procedure will already take hours, so it is wise to skip the unit tests. Therefore do not forget to add the -DskipTests parameter. This is the command to start the build:

mvn clean verify -DskipTests

After some hours, the build should be finished.

STEP 5 :

The results of the build should now be in the following folder:

C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.releng.tychoeclipsebuilder\sdk\target\products

Notice that the Eclipse IDE is built for all possible target machines. 32-bit Windows, 64-bit Windows, Macintosh, Linux, ... No wonder it takes hours! I would like to build for just one single target - for example my 64-bit Windows machine. This will hopefully reduce the build time significantly and allow me to verify code changes quicker.

Does anyone know how to achieve this?


EDIT :

I have added the argument -Dnative=win32.win32.x86_64 to the build command. Unfortunately, I get an error after 15 to 20 mins. This time, I've added the argument -X as well, to get debug information:

                      ...

[INFO] equinox-sdk ........................................ SKIPPED
[INFO] org.eclipse.rcp.id ................................. SKIPPED
[INFO] org.eclipse.rcp.sdk.id ............................. SKIPPED
[INFO] org.eclipse.platform.ide ........................... SKIPPED
[INFO] org.eclipse.platform.sdk ........................... SKIPPED
[INFO] org.eclipse.sdk.ide ................................ SKIPPED
[INFO] eclipse-junit-tests ................................ SKIPPED
[INFO] eclipse.platform.repository ........................ SKIPPED
[INFO] platform-aggregator ................................ SKIPPED
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] -----------------------------------------------------------------------
[INFO] Total time: 23:54 min
[INFO] Finished at: 2016-06-19T18:12:14+02:00
[INFO] Final Memory: 668M/3263M
[INFO] -----------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8: run (natives) on project org.eclipse.swt.win32.win32.x86_64: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915: The following error occurred while executing this line:
[ERROR] C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
[ERROR] around Ant part ...<ant antfile="build.xml" target="build_libraries"/>... @ 4:54 in C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:
    run (natives) on project org.eclipse.swt.win32.win32.x86_64:
        An Ant BuildException has occured:
            The following error occurred while executing this line:
            C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915: The following error occurred while executing this line:
            C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1 around Ant part ...<ant antfile="build.xml" target="build_libraries"/>... @ 4:54 in C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
                at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
                at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
                at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
                at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
                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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
                at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
                at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by:
        org.apache.maven.plugin.MojoExecutionException:
            An Ant BuildException has occured:

                The following error occurred while executing this line:
                C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915:

                The following error occurred while executing this line:
                C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1 around Ant part ...<ant antfile="build.xml" target="build_libraries"/>... @ 4:54 in C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml
                    at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:342)
                    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default BuildPluginManager.java:134)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
                    ... 20 more
                Caused by: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64\target\antrun\build-main.xml

                :4: The following error occurred while executing this line:
                C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml

                :915:The following error occurred while executing this line:
                C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
                    at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:568)
                    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:443)
                    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
                    at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:498)
                    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
                    at org.apache.tools.ant.Task.perform(Task.java:348)
                    at org.apache.tools.ant.Target.execute(Target.java:435)
                    at org.apache.tools.ant.Target.performTasks(Target.java:456)
                    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
                    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
                    at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:313)
                    ... 22 more
                Caused by: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml

                :915: The following error occurred while executing this line:
                C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
                    at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:568)
                    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:443)
                    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
                    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
                    at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:498)
                    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
                    at org.apache.tools.ant.Task.perform(Task.java:348)
                    at org.apache.tools.ant.Target.execute(Target.java:435)
                    at org.apache.tools.ant.Target.performTasks(Target.java:456)
                    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
                    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
                    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
                    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
                    ... 33 more

                Caused by: C:\myEclipse\eclipse.platform.releng.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012: exec returned: 1
                    at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:643)
                    at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
                    at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
                    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
                    at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                    at java.lang.reflect.Method.invoke(Method.java:498)
                    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
                    at org.apache.tools.ant.Task.perform(Task.java:348)
                    at org.apache.tools.ant.Target.execute(Target.java:435)
                    at org.apache.tools.ant.Target.performTasks(Target.java:456)
                    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
                    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
                    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
                    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
                    ... 46 more
[ERROR]
[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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :org.eclipse.swt.win32.win32.x86_64


I still have no answer, so I started a bounty. Please reproduce step 1 until step 5 on your machine (with the -Dnative=win32.win32.x86_64 argument added to the fourth step). Do you achieve a successful build of the Eclipse IDE for just one OS target (preferably Windows 64-bit)? Does the build go faster - compared to the general build process that targets all OS's?

PS: I've got some other questions related to the Eclipse "Build from scratch" topic. If you're interested:

Let us all unite to build the Eclipse IDE ourselves - and tweak it to our needs ;-)


EDIT :

Mr/Mss. Zapl wrote an interesting comment. He/She thinks that the -Dnative argument is not correct, after he/she read the following link: http://comments.gmane.org/gmane.comp.ide.eclipse.cbi.devel/896

Hopefully we'll get closer to the answer now :-)


FINAL EDIT :

Suddenly this question catched the attention of the community. I got a lot of suggestions/answers in a short time. I cannot verify every single one of them right now because the build procedure takes about 2 hours.

I have 19 hours left to award the 50 points bounty. Please let me know if you successfully reproduced the STEPS 1..5 from this question on your own machine, and succeeded to build the Eclipse IDE from scratch for one specific OS. I will award you the bonus :-)

解决方案

This snippet is taken from a working pom.xml that exports to win32.win32.x86_64. Maybe some parts are not required for your project but it may be a good starting point to add this to your pom file.

..
..
<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>0.20.0</version>
            <extensions>true</extensions>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>0.20.0</version>
            <configuration>
                <resolver>p2</resolver>
                <environments>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86_64</arch>
                    </environment>
                </environments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-compiler-plugin</artifactId>
            <version>0.20.0</version>
            <configuration>
                <compilerArgument>-err:-forbidden</compilerArgument>
            </configuration>
        </plugin>
    </plugins>
</build>
..
..

EDIT

As mentioned in the comments I followed your steps and had some problems. I solved most of them now. If someone else also gets a lot of errors here are some solutions.

  • In the file eclipse.pde.ui/pom.xml line 19: the version was 4.6.0-SNAPSHOT, but has to be 4.7.0-SNAPSHOT

  • Hint: To speed up the build you can add e.g. "-T 4" to the mvn command to enable parallel builds. I finally ended with >mvn clean verify -DSkipTests -T 4 -Dnative=win32.win32.x86_64

After this fix I was able to run until I got the same errors mentioned in the initial question. I went to the project folder \eclipse.platform.swt.binaries\bundles\org.eclipse.swt.win32.win32.x86_64 and started an Ant build (Apache Ant version 1.9.7) and it finished without errors. But I got the same errors when it was executed by the Maven build. Thus, I checked lines 915 and 1012 of the file \eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml. After setting failonerror="false" (is set to "true" by default) in both lines I was able to continue with the build. I assess this as a very poor solution and it should not be the final solution for a problem to disable such tests.

Finally, I ended with errors in project org.eclipse.pde.build.tests and stopped following the problems. The whole project seems to be misconfigured in many parts and I could not find a better solution so far. People should remember the golden rule not to commit anything that breaks the build to avoid such problems. Maybe the problems will be solved after a few updates to the repo.

这篇关于从头开始构建Eclipse IDE - 如何指定目标操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆