问题
I currntly use M2Eclipse for the majority of my Java development and Pydev for Python/Jython development within Eclipse. I would like to use Jython to prototype and test classes within my Java projects. The M2Eclipse plugin manages all the dependencies defined in the Maven pom.xml file automatically.
Is there anyway for Pydev to utilise these dependencies without having to import each jar separately?
回答1:
Actually, I didn't get how you are working with Jython under Eclipse and where you need to import jars separately. Is this related to Pydev? Something else? Anyway, even if I'm not sure it will solve all your issues, maybe the maven-jython-plugin can help. It offers the following features:
- Easily fire up an interactive Jython shell
- Compile main Jython source files to Java classes
- Compile test Jython source files to Java classes
- Inferred package structure to make life simpler
回答2:
Have a look at the maven-jython-compile-plugin and maven-python-test-plugin. The former allows you to deploy a standalone project that includes jython with libraries. The latter allows you to run your python tests with the maven java tests.
The sourceforge umbrella project is http://mavenjython.sourceforge.net/
Unlike maven-jython-plugin, they don't use the outdated jythonc compiler.
来源:https://stackoverflow.com/questions/1602427/using-jython-with-m2eclipse