Thanks Tom, this is a good start, but I had a problem...
If I have a project with many subprojects, some one level below the
top project and some two levels below the top project, what can I
put in my project's top level pom.xml that will allow lower level
subprojects to reference the files at the top level? Obviously "."
doesn't work, and ".." doesn't work if there are different
subprojects at different levels.
Stackoverflow
had a couple of approaches; I chose this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
...
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${main.basedir}</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>LICENSE.md</include>
<include>NOTICE.md</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!--
Directory plugin to find parent root directory absolute path.
-->
<plugin>
<groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId>
<version>0.3</version>
<executions>
<execution>
<id>directories</id>
<goals>
<goal>highest-basedir</goal>
</goals>
<phase>initialize</phase>
<configuration>
<property>main.basedir</property>
</configuration>
</execution>
</executions>
</plugin>
I was already using build-helper-maven-plugin for other reasons so I
extended the configuration as above and included the
directory-maven-plugin. The directory-maven-plugin sets
${main.basedir}, which is used in the build-helper-maven-plugin to
reference the LICENSE.md and NOTICE.md files.
Does anyone see any issues with this?
If all projects should be doing this, should it be in the
parent pom?
Tom Jenkinson wrote on 10/04/2018 01:38
AM:
_______________________________________________
ee4j-build mailing list
ee4j-build@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ee4j-build
|