I am working on a maven project that has its source file in JAVA. I had to add some functionality in the project through some already written code. But these new files were written in PYTHON. Hence I decided to make a shell script that can run both the java and python files with desired args. But since my java source files are in the maven project, I am not able to write a shell script without exploiting the structure of the maven project.
So, how can I run the above files without ruining the structure of my maven project?
As Andersen mentioned that Maven can compile and execute .java files, it means it is only specific to java. For python files, you need setup.py to build python based project. You can not directly call a function written in Python from Java class. Now coming back to your requirements, I can think that you have to build separately java project using Maven with the command mvn clean install and you have to run setup.py if available in python project. Since you cannot call a python function from java class, you have to create an exe file in python using pyinstaller or using py2exe and you invoke the exe file from java. The above I mentioned in one of the approaches. Another approach is to rewrite the python code in java and build using maven. This will be the good approach based upon the requirement. Besides, if you are interested to build java project using Maven and you want to build python project, you can write a .bat file.
Running a maven project and a python file through shell script