`
zhaozhongwei
  • 浏览: 54315 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

eclipse headless

阅读更多
java -jar <eclipse-installation-path>\plugins\org.eclipse.equinox.launcher_<version><qualifier>.jar -application org.eclipse.ant.core.antRunner -buildfile <eclipse-workspace-path>\<project-name>\<build-xml-path>

example
java -jar C:\eclipse\plugins\org.eclipse.equinox.launcher_1.1.0.v20100507.jar -application org.eclipse.ant.core.antRunner -buildfile C:\workspace\com.example.helloworld\build.xml
Building through features

Plug-ins are rarely required to be build in isolation. The nicer way of building them is through features. Of course, features are more useful from distribution and deployment point of view. A feature is build the same way as a plug-in. Include the required plug-ins in the feature.xml and generate the build.xml from build.properties file (right-click and choose PDE Tools). Now launch the feature build.

java -jar <eclipse-installation-path>\plugins\org.eclipse.equinox.launcher_<version><qualifier>.jar -application org.eclipse.ant.core.antRunner -buildfile <eclipse-workspace-path>\<feature-project-path >\<build-xml-path>

example
java -jar C:\eclipse\plugins\org.eclipse.equinox.launcher_1.1.0.v20100507.jar -application org.eclipse.ant.core.antRunner -buildfile C:\workspace\com.example.helloworld.feature\build.xml

Note that build will fail if the included plug-ins do not have the build.xml generated for them. This is not a likely scenario and definitely not the way it is done. But let it be for time being. Generate the build.xml for all the plug-ins for build to succeed. Later on we will see how it can be done without it.

Passing parameters to AntRunner from command line

The build generated by the above command will leave the feature jar inside the feature project and the plug-in jar inside the plug-in project folder. Of course they shouldn't scattered all around. They need to be collected to one place.

Open the build.xml for the plug-in project and inside the 'init' target there is one property called 'plugin.destination'. It is this location where the jar is finally created by the 'build.update.jar' target.

<property name="plugin.destination" value="${basedir}"/>

Change the value of this property to "${buildDirectory}". Make the similar change for the 'feature.destination' property in the build.xml for the feature project.

If the build is triggered now, it will fail because it can not find the value for the 'buildDirectory'. The value can be provided through command line using -D option.

java -jar <eclipse-installation-path>\plugins\org.eclipse.equinox.launcher_<version><qualifier>.jar -application org.eclipse.ant.core.antRunner -buildfile <eclipse-workspace-path>\<feature-project-path >\<build-xml-path> -DbuildDirectory=<build-storage-location>

example
java -jar C:\eclipse\plugins\org.eclipse.equinox.launcher_1.1.0.v20100507.jar -application org.eclipse.ant.core.antRunner -buildfile C:\workspace\com.example.helloworld.feature\build.xml -DbuildDirectory=c:\build\buildOutput

When the build is run, ${buildDirectory} will be replaced by the value(location) provided and jars will get created there.

More parameters can be supplied using -D<variable-name>=<value> from the command line.

Ant properties file

Passing parameters from the command line is not very scalable or maintainable. A better way is to pass the parameters using a properties file.

Create a properties file, say, 'custom_build.properties' inside a folder, say, 'buildConfiguration'. The name 'custom_build.properties' have been chosen to distinguish it from 'build.properties'. Carefully note that though both are name=value kind properties file, it is common(rather better) practice to not mix them. Since 'build.properties' has a special meaning in context of PDE, it is recommended that a different name is used to avoid any confusion.

Store the property and its value in the properties file.
buildDirectory=c:/build/buildConfiguration
Note the forward slashes instead of backslash. The backslashes will work too but needs to be escaped.

Now open the build.xml for the feature project and add the 'loadproperties' entry under the 'project' tag.
<project name="com.example.helloworld.feature" default="build.update.jar" basedir=".">
 <loadproperties srcfile="../../buildConfiguration/build.properties" />
        ...
This entry needs to be made only in feature project's build.xml and is not required for the plug-in projects' build.xml. They still can use the same variable name and will get the value from the properties file.

Note that the value for the 'srcfile' is a relative path and the ../../ (grand-parent directory) indicates that the properties file has been kept in one folder outside the folder (or workspace) containing the projects.
分享到:
评论
2 楼 sunway 2010-07-17  
qq:362143138。
1 楼 sunway 2010-07-17  
最近如何啊,加我qq啊,我怎么找不到你了。。

相关推荐

    eclipse虚拟缓存处理

    这里,`-Xms256m -Xmx512m`调整了初始和最大堆内存的大小,而`–Djava.awt.headless=true`则表示Eclipse将在无图形界面模式下运行,有助于减少内存消耗。 ### 四、创建Eclipse.bat文件 为了进一步确保Eclipse能够...

    eclipse-neon

    eclipse.exe是默认的图形界面启动器,而eclipsec.exe则用于运行非图形化的任务,如自动化脚本或Headless模式的构建。 3. **eclipse.ini**:这是Eclipse的启动配置文件,其中定义了启动参数、JVM设置、内存分配以及...

    Eclipse启动优化

    Eclipse是一款广泛使用的Java开发集成环境,其丰富的功能和强大的扩展性深受开发者喜爱。然而,随着项目的增多和插件的安装,Eclipse的启动速度可能会变得较慢,影响开发效率。针对这一问题,我们可以采取一系列优化...

    eclipse tomcat启动,内存溢出问题

    set JAVA_OPTS=-Xms256m -Xmx512m -Djava.awt.headless=true [-XX:MaxPermSize=128m] ``` 其中`-Xms`表示初始堆内存大小,`-Xmx`表示最大堆内存大小,而`-XX:MaxPermSize`则用于设置永久代(PermGen space)的...

    hu.peterharaszin.plugin.headlesstest:使用 Eclipse 测试无头构建

    【hu.peterharaszin.plugin.headlesstest:使用Eclipse测试无头构建】这个项目主要涉及的是在Java开发环境中,使用Eclipse IDE进行无头(Headless)测试的实践。无头测试是指在没有图形用户界面的情况下执行自动化...

    在centos7下正确安装伪分布hadoop2.7.2和配置eclipse.doc

    本文将为您详细介绍如何在 CentOS 7 上正确安装伪分布 Hadoop 2.7.2 和配置 Eclipse。 一、创建 Hadoop 用户 在安装 Hadoop 之前,需要创建一个名为 Hadoop 的用户。首先,点击左上角的“应用程序”-&gt;“系统工具”...

    tomcat jdk堆大小配置及eclipse中设置

    set JAVA_OPTS=-Djava.awt.headless=true -Xms128m -Xmx512m -XX:MaxPermSize=256m ``` 这里的`JAVA_OPTS`变量定义了传递给JVM的选项。上述示例设置了初始堆大小为128MB,最大堆大小为512MB,以及最大持久代大小为...

    pluginbuilder

    从标题和描述中,我们可以看到几个关键概念:CruiseControl、Ant、RCP(Rich Client Platform)以及Headless Build,这些都是与插件开发密切相关的技术。 1. **CruiseControl**:CruiseControl是一个持续集成服务器...

    1.pyppeteer+scrapy开发环境搭建

    browser = await launch({'headless': False}) page = await browser.newPage() # await page.setViewport({'width': 1536, 'height': 864}) await page.goto('https://www.baidu.com/') await page.screenshot...

    tomcat内存溢出解决办法

    在 1G 内存环境下,我们可以设置 Java 的参数为 `JAVA_OPTS="-server -Xms800m -Xmx800m -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=128m -Djava.awt.headless=true"`。 解决 Tomcat 内存溢出问题的...

    java实现网站截图--验证可用

    - `project`和`settings`:这些通常是IDE(如Eclipse或IntelliJ IDEA)的配置文件,包含了项目的构建设置和用户首选项。 - `lib`:这是一个库文件夹,可能包含了项目依赖的外部库,比如Jsoup、PhantomJS的Java绑定或...

    解决Java_heap_space问题

    可以通过在 catalina.bat 文件中添加以下命令来解决该问题:set JAVA_OPTS=-Xms256m -Xmx512m -Djava.awt.headless=true。 Java_heap_space 问题是 Java 应用程序中一个常见的问题,解决该问题需要调整 JVM 堆空间...

    slack-clojure-repl:Slack 的 clojure repl

    lein ring server-headless 这将在端口 3000 上启动服务器。 部署 部署到 heroku 得到照顾。 如果您之前没有使用 Heroku 部署 clojure 应用程序,请参阅页面。 heroku config:set SLACK_WEBHOOK='https://...' 去...

    metasfresh-webui-api-legacy:metasfresh webui API服务器

    给开发人员的一些注意事项: 可以从eclipse运行main方法位于/metasfresh-webui-api/src/main/java/de/metas/ui/web/WebRestApiApplication.java 首次运行API时,您可能需要使用-Dwebui-api-run-headless=false来运行...

    huutopussi

    跑步开发模式(自动重新加载和REPL)要为该应用程序启动Web服务器(在端口3000中运行),请运行: lein ring server-headless启动客户端。转到客户端目录并运行: lein fig:build打开播放生产建立创建生产uberjar: ...

    selenium2.0使用

    2.3 安装Eclipse:Eclipse是一个流行的Java集成开发环境,用于编写和运行WebDriver测试代码。 2.4 安装Selenium WebDriver:下载并添加WebDriver的Java绑定到你的项目类路径中,这通常包括selenium-java.jar和其他...

    使用openoffice把word转化成html

    C:\Program Files\OpenOffice.org 3\program&gt;soffice -headless -accept="socket,port=8100;urp;" ``` **注意**: 如果不启动此服务,则后续的转换操作可能会遇到连接失败的错误。 **2. 下载 JODConverter** - ...

    exe4j打jar成exe(自带jre环境)

    exe4j是由eclipse插件开发公司Inno Setup的作者Jens Koller开发的一款工具,它能够帮助开发者轻松地创建独立的Windows可执行文件,这些文件不仅包含了Java应用程序,还包括了运行所需的所有Java运行时组件。...

    matlab代码输入如何换行符-PeroxiTracker:PeroxiTracker

    以PeroDriver作为主类启动Eclipse 作为Hadoop任务运行 将Peroxitracker.jar和Peroxitracker_lib上传到 $ ssh 使用参数-libjars dir / A.jar,dir / B.jar,dir / C.jar将外部库加载MapReducer作业 语法:hadoop jar...

    mp3播放器java版

    该播放器的用户界面采用了SWT(Standard Widget Toolkit)库,这是一款由Eclipse基金会维护的开源GUI库,提供了与操作系统原生界面更紧密的集成,使得程序在不同平台上具有更好的用户体验。 在开发过程中,开发者...

Global site tag (gtag.js) - Google Analytics