This is possible and this is the preferred method.
You must create a child module specifically for your .target file (for example, called the target definition). This should be a project with a pom packaging type. You should also include the following snippet: this is the part that allows other modules to access the .target file:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.3</version> <executions> <execution> <id>attach-artifacts</id> <phase>package</phase> <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts> <artifact> <file>targetFilename.target</file> <type>target</type> <classifier>targetFilename</classifier> </artifact> </artifacts> </configuration> </execution> </executions> </plugin>
Now in your parent pom you can reference this module in target-platform-configuration , and your child modules will also use it:
<plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho-version}</version> <configuration> <target> <artifact> <groupId>org.example</groupId> <artifactId>target-definition</artifactId> <version>1.0.0-SNAPSHOT</version> <classifier>targetFilename</classifier> </artifact> </target> </configuration> </plugin>
There is also a request for creating a packaging type for .target files to help in the future.
source share