Bundling python(“.py”)files along with java class files for a web application

筅森魡賤 提交于 2019-12-08 05:10:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!