How to include python files of Java project into .war with maven?
Question: I have Java project made with maven. So I have typical maven project layout.
And I use Jython. So I got few python files. Wich I use through
PythonInterpreter in Java classes.  
I place my python files in src/main/py folder. And I use this path to import
the modules by interpreter. It works fine on my laptop.

The problem is:  
When I do mvn install, this folder does not goes to the war.  
I read about maven resources plugin and added this folder as a resource. Like
this:

    
    
    <resources>
        <resource>
            <directory>src/main/py</directory>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
    

I that case it adds everything that folder contents, to web-inf/ directly, but
not in the src/main/py. So that path is invalid for application in war
archive.

Question is:  
How should I place this python resource and what I should write in pom.xml, to
be able to use the same path on the laptop, and the server?


Answer: Can you try including targetPath in the resource element as below:

    
    
    <resource>
                <targetPath>../</targetPath>
                <directory>src/main/py</directory>
                <includes>
                    <include>**/*.py</include>
                </includes>
    
    </resource>
    

