bind generating local p2 repo to mvn compile goal

This commit is contained in:
Fredrik Teschke
2014-11-22 18:57:58 +01:00
parent 76ee054a29
commit d25757fd3f
3 changed files with 24 additions and 9 deletions
+2 -2
View File
@@ -556,9 +556,9 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
if [ $p2local -eq 1 ]; then
echo "INFO: Building and using local p2 repo"
#build local p2 repo
echo "Using following command (pwd: java/com.sap.sailing.targetplatform.base): mvn -fae -s $MAVEN_SETTINGS $clean tycho-p2-extras:publish-features-and-bundles"
echo "Using following command (pwd: java/com.sap.sailing.targetplatform.base): mvn -fae -s $MAVEN_SETTINGS $clean compile"
echo "Maven version used: `mvn --version`"
(cd com.sap.$PROJECT_TYPE.targetplatform.base; mvn -fae -s $MAVEN_SETTINGS $clean tycho-p2-extras:publish-features-and-bundles 2>&1 | tee $START_DIR/build.log)
(cd com.sap.$PROJECT_TYPE.targetplatform.base; mvn -fae -s $MAVEN_SETTINGS $clean compile 2>&1 | tee $START_DIR/build.log)
# now get the exit status from mvn, and not that of tee which is what $? contains now
MVN_EXIT_CODE=${PIPESTATUS[0]}
echo "Maven exit code is $MVN_EXIT_CODE"
@@ -3,12 +3,18 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>root</artifactId>
<groupId>com.sap.sailing</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<packaging>eclipse-repository</packaging>
<!-- Do not set parent: this would also inherit the tycho target platform configuration. By building this artifact, we
create the local p2 repo that can then be referenced by the race-analysis-p2-local.target definition. So we can't
recursively use the local repo as target platform for building the local repo - and apart from that don't need it.
Skipping the tycho-maven-plugin and target-platform-configuration plugins via <skip> parameter in the build config
does not skip resolving the target definition defined in the parent pom. Therefore, the parent was not set here -
which means we have to define $tycho-version again.-->
<groupId>com.sap.sailing</groupId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<tycho-version>0.21.0</tycho-version>
</properties>
<artifactId>com.sap.sailing.targetplatform.base</artifactId>
@@ -21,6 +27,15 @@
<configuration>
<sourceLocation>${basedir}</sourceLocation>
</configuration>
<executions>
<execution>
<id>generate-full-metadata</id>
<phase>compile</phase>
<goals>
<goal>publish-features-and-bundles</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
@@ -1,3 +1,3 @@
#!/bin/bash
cd ../../com.sap.sailing.targetplatform.base
mvn tycho-p2-extras:publish-features-and-bundles
mvn clean compile