简体   繁体   English

是否有任何Java编译器利用OSGi环境而不使用类路径?

[英]Are there any Java-compilers that leverage an OSGi-environment instead of using the classpath?

Are there any ways to make javac use an existing OSGi-environment for the resolution of build-time dependencies instead of setting the classpath explicitely? 有什么方法可以使javac使用现有的OSGi环境解决构建时依赖性,而不是显式设置类路径? I know I could write an OSGi-component that uses the Compiler-API of the JDK, but I think there should be a more straightforward solution. 我知道我可以编写一个使用JDK的Compiler-API的OSGi组件,但是我认为应该有一个更直接的解决方案。

Alternatively, if no such extension is available for javac , does ejc allow such a thing (usable from the command line; I'd be willing to accept an Equinox-only solution with ejc )? 或者,如果javac没有这样的扩展名, ejc允许这样的事情(可从命令行使用;我愿意接受ejc的仅Equinox解决方案)?

ant task to compile using osgi. ant任务使用osgi进行编译。

http://www.ohloh.net/p/osgijc http://www.ohloh.net/p/osgijc

or here now I guess? 还是我现在在这里?

http://code.google.com/p/eclipseosgitools/ http://code.google.com/p/eclipseosgitools/

Have you considered using Maven to manage dependencies? 您是否考虑过使用Maven管理依赖项? There are plugins available for IDEs like Eclipse. 有可用于Eclipse等IDE的插件。 You just need to map the resource servers, and the needed libraries in a pom.xml, and that is pretty much it. 您只需要在pom.xml中映射资源服务器和所需的库,就足够了。

-Jay -Jay

You're missing out on the one obvious Java compiler that follows OSGi rules - Eclipse. 您会错过遵循OSGi规则的一个显而易见的Java编译器-Eclipse。

You can use Eclipse's compiler to do a headless build, but be warned, it's not for the faint-hearted. 您可以使用Eclipse的编译器进行无头构建,但要注意,它不是为胆小者准备的。

Here's a simple tutorial on building with Eclipse and ant. 这是有关使用Eclipse和ant进行构建的简单教程

If you go down this path, I'd suggest looking at Tycho (the Maven sub-project for building OSGi stuff) and Buckminster , an Eclipse project. 如果您走这条路,我建议您看一下Tycho (用于构建OSGi内容的Maven子项目)和Eclipse项目Buckminster

I'm developing in the Lotus Expeditor Toolkit and Eclipse Plugin - It's a no-charge download. 我正在使用Lotus Expeditor Toolkit和Eclipse插件进行开发-这是免费下载。 My build time and runtime classpaths are managed very easily by entries in the Manifests. 通过清单中的条目可以非常轻松地管理我的构建时间和运行时类路径。

[disclaimer: I am an IBM employee.] [免责声明:我是IBM员工。]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM