How to generate second EAR with sources

370 Views Asked by At

I have a project that consist of multiple modules (ejb's, jar's, war's) and I'm using a pom.xml of type "ear" to package them. It works perfectly fine and it generates an EAR-file with the correct jar's / etc. What I additionally need is a second EAR-file with source code of included modules... I tried to use the source plugin as follow but the generated EAR didn't include any sources:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Funnily enough when I run "install" on my parent pom.xml, where all modules are included, the %MODULE_NAME%-sources.jar files are generated in my local maven repository. Is it possible to somehow reuse them and package into a second EAR?

0

There are 0 best solutions below