=How to build a Jython project with Maven:=
- Using Eclipse, create a Maven project
- Create a source folder for the Python code (
src/main/python) - Set the project as a PyDev project
- Set the python interpreter to Jython
- Add the followings to the PYTHONPATH:
src/main/python,target/classes - As usual, add your java dependencies using Maven (via
pom.xml) - To compile your project do:
mvn build - To run python files do:
java -jar test_jython-<version>.jar classes/main.py
=Workaround for PyDev's issue of not detecting the dependencies imported via Maven=
git clone git@github.com:kbrowder/PyJDT.git- Copy the two net.* directories to the Eclipse dropins folder (Eclipse.app/Contents/Eclipse/dropins)
- Restart Eclipse
- Try to import the class that was not importing before
Enjoy! :)