Java 从头开始构建EclipseIDE-如何指定目标操作系统?
这篇文章是关于从源代码构建整个EclipseIDE的,尤其是如何指定要为其构建可执行文件的目标操作系统 我找到了以下教程来指导我完成构建过程: 特别是该教程的第13章很有帮助。我将在这里逐一描述需要采取的步骤,因此您无需阅读vogella教程 所需软件: 显然,您需要在(Windows)计算机上安装以下软件:Java 从头开始构建EclipseIDE-如何指定目标操作系统?,java,eclipse,git,maven,build,Java,Eclipse,Git,Maven,Build,这篇文章是关于从源代码构建整个EclipseIDE的,尤其是如何指定要为其构建可执行文件的目标操作系统 我找到了以下教程来指导我完成构建过程: 特别是该教程的第13章很有帮助。我将在这里逐一描述需要采取的步骤,因此您无需阅读vogella教程 所需软件: 显然,您需要在(Windows)计算机上安装以下软件: 吉特 Maven版本3.3.1(确保将提取Maven的bin文件夹添加到路径中。有关安装说明,请参阅) Oracle 1.8 JDK或更高版本(不要忘记设置JAVA_HOME环境变量)
- 吉特
- Maven版本3.3.1(确保将提取Maven的bin文件夹添加到路径中。有关安装说明,请参阅)
- Oracle 1.8 JDK或更高版本(不要忘记设置JAVA_HOME环境变量)
C:\
磁盘中创建一个新文件夹。让我们把它命名为C:\myEclipse
。这将是我们提取最新Eclipse版本的Git存储库的文件夹
第二步:
以管理员权限打开Windowscmd
shell(如果您在桌面上创建了一个cmd
图标,请右键单击该图标,然后选择openwithadmin rights
)。通过命令cdc:\myEclipse
转到该文件夹。现在键入以下命令:git config--system core.longpaths true
。这会通知Git存储库中可能出现长名称。忘记此命令,它将在以后导致错误
第三步:
克隆Git存储库:
git clone -b master --recursive git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git
现在,您应该有耐心将所有源代码复制到本地文件夹中
第4步:
最后,是开始构建的时候了。构建过程将花费数小时,因此跳过单元测试是明智的。因此,不要忘记添加-DskipTests
参数。这是启动生成的命令:
mvn clean verify -DskipTests
几个小时后,构建应该完成
第五步:
生成的结果现在应位于以下文件夹中:
C:\myEclipse\eclipse.platform.reling.aggregator\eclipse.platform.reling.tychoeclipsebuilder\sdk\target\products
注意,EclipseIDE是为所有可能的目标机器构建的。32位Windows、64位Windows、Macintosh、Linux。。。难怪要花几个小时!我只想为一个目标构建—例如我的64位Windows机器。这将有望显著减少构建时间,并允许我更快地验证代码更改
有人知道如何做到这一点吗
编辑: 我已经在build命令中添加了参数
-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-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
。。。
[信息]equinox sdk。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]org.eclipse.rcp.id。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]org.eclipse.rcp.sdk.id。。。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]org.eclipse.platform.ide。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]org.eclipse.platform.sdk。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]org.eclipse.sdk.ide。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]eclipse junit测试。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]eclipse.platform.repository。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]平台聚合器。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。跳过
[信息]-----------------------------------------------------------------------
[信息]生成失败
[信息]-----------------------------------------------------------------------
[信息]总时间:23:54分钟
[信息]完成时间:2016-06-19T18:12:14+02:00
[信息]最终内存:668M/3263M
[信息]-----------------------------------------------------------------------
[错误]无法在project org.eclipse.swt.win32.win32.x86_64上执行目标org.apache.maven.plugins:maven antrun plugin:1.8:run(本机):发生Ant BuildException:执行此行时发生以下错误:
[错误]C:\myEclipse\eclipse.platform.reling.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:915:执行此行时发生以下错误:
[错误]C:\myEclipse\eclipse.platform.reling.aggregator\eclipse.platform.swt\bundles\org.eclipse.swt\buildSWT.xml:1012:exec返回:1
[错误]围绕Ant部分
让我们大家团结起来,自己构建Eclipse IDE,并根据需要调整它;-)
编辑:
先生/小姐。扎普写了一篇有趣的评论。阅读以下链接后,他/她认为-Dnative
参数不正确:
希望我们现在能更接近答案:-)
最终编辑:
突然,这个问题引起了社会的注意。我在短时间内得到了很多建议/答案。我现在无法验证它们中的每一个,因为构建过程大约需要2个小时
我还有19个小时来奖励50分悬赏。如果您在自己的机器上成功地复制了这个问题中的步骤1..5,并且成功地为一个特定的操作系统从头构建了EclipseIDE,请告诉我。我将奖励您奖金:-)来自
或者,您可以通过以下选项之一传递-Dnative=参数来编译指定本机的本机
- cocoa.macosx.x86
- cocoa.macosx.x86_64
- gtk.linux.x86
- gtk.linux.x86_64
- win32.win32.x86
- win32.win32.x86_64
- win32.wce_ppc.arm
参数应该是-Dnative=win32.win32.x86_64
有多个项目不可用
..
..
<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>
..
..
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environments>
</configuration>
</plugin>