简体   繁体   English

将Jython与M2Eclipse一起使用

[英]Using Jython with M2Eclipse

I currntly use M2Eclipse for the majority of my Java development and Pydev for Python/Jython development within Eclipse. 我在大多数Java开发中使用M2Eclipse ,在Eclipse中使用Pydev for Python / Jython开发。 I would like to use Jython to prototype and test classes within my Java projects. 我想使用Jython来原型化并测试Java项目中的类。 The M2Eclipse plugin manages all the dependencies defined in the Maven pom.xml file automatically. M2Eclipse插件自动管理Maven pom.xml文件中定义的所有依赖项。

Is there anyway for Pydev to utilise these dependencies without having to import each jar separately? 反过来,Pydev是否可以利用这些依赖关系而无需单独导入每个jar?

Actually, I didn't get how you are working with Jython under Eclipse and where you need to import jars separately. 实际上,我没有了解你如何在Eclipse下使用Jython以及你需要单独导入jar的地方。 Is this related to Pydev? 这与Pydev有关吗? Something else? 别的什么? Anyway, even if I'm not sure it will solve all your issues, maybe the maven-jython-plugin can help. 无论如何,即使我不确定它会解决你所有的问题,也许maven-jython-plugin可以提供帮助。 It offers the following features: 它提供以下功能:

  • Easily fire up an interactive Jython shell 轻松启动交互式Jython shell
  • Compile main Jython source files to Java classes 将主Jython源文件编译为Java类
  • Compile test Jython source files to Java classes 将测试Jython源文件编译为Java类
  • Inferred package structure to make life simpler 推断包结构 ,使生活更简单

Have a look at the maven-jython-compile-plugin and maven-python-test-plugin. 看看maven-jython-compile-plugin和maven-python-test-plugin。 The former allows you to deploy a standalone project that includes jython with libraries. 前者允许您部署包含带库的jython的独立项目。 The latter allows you to run your python tests with the maven java tests. 后者允许您使用maven java测试运行python测试。

The sourceforge umbrella project is http://mavenjython.sourceforge.net/ sourceforge伞项目是http://mavenjython.sourceforge.net/

Unlike maven-jython-plugin, they don't use the outdated jythonc compiler. 与maven-jython-plugin不同,它们不使用过时的jythonc编译器。

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

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