问题
We are having an java we application where flex is front end and we use Axis2 for web services.So what ever the java code for services we bundle java classes as an aar file ans supply to axis2 with which flex interacts.
Recently we had a req where we need to use some python code from java, So Eclipse, i setup by adding jython.jar,plyJy.jar to the lib folder and added what ever the py files needed to the src folder and i was able to use python methods in the java code.
PySystemObjectFactory factory = new PySystemObjectFactory(ApplicationContext.class, "cs", "ApplicationContextInst");
ApplicationContext appcon = (ApplicationContext)factory.createObject();
But i am not sure how to bundle this py files along with java files.i tried adding this .py files directly to the aar file.But it fails when it tried to create the PySystemObjectFactory Object Instance.
Any help would be highly appreciated.
回答1:
Have a look at the maven-jython-compile-plugin and its demo project at http://mavenjython.sourceforge.net/ . It allows bundling jython with dependencies into a standalone jar.
来源:https://stackoverflow.com/questions/6921809/bundling-python-pyfiles-along-with-java-class-files-for-a-web-application