How to generate compiled classes and keep .java in maven?

3

Everyone when I do maven install it compiles classes and generates xxx.class, so far so good. I would like to know if it is possible to generate the .class and also keep all the .java, in the application I am doing I will need to show the page and the sample code made to create the same logo I wanted to read and get the. screen.

My problem is that I only have .class after maven install, could anyone help me?

    
asked by anonymous 23.09.2016 / 14:42

1 answer

2

Include the following resource in pom.xml :

    <resource>
        <directory>${basedir}/src/main/java</directory>
    </resource>

Look more or less what it would look like in the general structure of the file:

<project>
    ...
        <build>
            ...
                 <resources>
                    <resource>
                        <directory>${basedir}/src/main/java</directory>
                    </resource>
                </resources>
        </build>
</project>

If you want to know more about the resources plugin: link

And when you need to check the general structure of the file to know where a section or plugin can be configured: link

    
23.09.2016 / 14:53