Reputation: 8100
In my project there are multiple eclipse product files (100+ for different customers), I would like to build only one specific product at the time.
If I build the whole project from the root folder, the project is build correctly with all products.
cd scodi
mvn clean verify
I get an error if I try to build only one product:
cd scodi/rcp/releng/ch.scodi.client.product
mvn clean verify
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact ch.scodi:ch.scodi.client.target:target:1.0.0-SNAPSHOT -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve target platform specification artifact ch.scodi:ch.scodi.client.target:target:1.0.0-SNAPSHOT
I'm using tycho 1.3.0, with the tycho-pomless extension.
Root POM target declaration:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>ch.scodi</groupId>
<artifactId>ch.scodi.client.target</artifactId>
<version>1.0.0-SNAPSHOT</version>
</artifact>
</target>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
The product pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>ch.scodi.client.product</artifactId>
<packaging>eclipse-repository</packaging>
<parent>
<groupId>ch.scodi</groupId>
<artifactId>ch.scodi.rcp.releng</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>materialize-products</id>
<goals>
<goal>materialize-products</goal>
</goals>
</execution>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Is it not possible to build only certain products?
Upvotes: 2
Views: 1883
Reputation: 8100
I'm sure this is not the maven way of building, the following workaround builds only one product.
To build I pass the scodi.customer
variable:
mvn clean verify -Dscodi.customer=demo
<modules>
<module>${scodi.customer}/common/plugins</module>
<module>${scodi.customer}/ui/plugins</module>
<module>${scodi.customer}/rcp/features</module>
<module>${scodi.customer}/rcp/releng</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<target>
<artifact>
<groupId>ch.scodi</groupId>
<artifactId>ch.scodi.client.target</artifactId>
<version>1.0.0-SNAPSHOT</version>
</artifact>
</target>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
Upvotes: 1