summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJochen Ehret2011-11-16 08:50:03 (EST)
committer Jan Sievers2011-11-18 07:12:41 (EST)
commit12f5f212fb491aa54c2381fc6c850ec0f2a70a36 (patch)
treecb0c89f3d1d33c9df120ce8100f6c5d9d3e3e47f
parent4f3c5fa1d9258c349250efacbacdde10a9b7cc86 (diff)
downloadorg.eclipse.tycho-12f5f212fb491aa54c2381fc6c850ec0f2a70a36.zip
org.eclipse.tycho-12f5f212fb491aa54c2381fc6c850ec0f2a70a36.tar.gz
org.eclipse.tycho-12f5f212fb491aa54c2381fc6c850ec0f2a70a36.tar.bz2
363791 fix exported artifacts of build extension
* add missing groupId for exported artifacts of tycho build extension (as per docs https://cwiki.apache.org/MAVEN/maven-3x-class-loading.html ) * add test for tycho-versions-plugin which ensures future backwards compatibility to Tycho 0.12.0
-rw-r--r--tycho-its/projects/TychoVersionsPluginTest/META-INF/MANIFEST.MF5
-rw-r--r--tycho-its/projects/TychoVersionsPluginTest/pom.xml66
-rw-r--r--tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginCompatibilityTest.java59
-rw-r--r--tycho-maven-plugin/src/main/resources/META-INF/maven/extension.xml18
4 files changed, 139 insertions, 9 deletions
diff --git a/tycho-its/projects/TychoVersionsPluginTest/META-INF/MANIFEST.MF b/tycho-its/projects/TychoVersionsPluginTest/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..10e5542
--- /dev/null
+++ b/tycho-its/projects/TychoVersionsPluginTest/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Bundle
+Bundle-SymbolicName: test.artifact
+Bundle-Version: 1.0.0
diff --git a/tycho-its/projects/TychoVersionsPluginTest/pom.xml b/tycho-its/projects/TychoVersionsPluginTest/pom.xml
new file mode 100644
index 0000000..6756bbb
--- /dev/null
+++ b/tycho-its/projects/TychoVersionsPluginTest/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+ <groupId>tychobug363791</groupId>
+ <artifactId>test.artifact</artifactId>
+ <version>1.0.0</version>
+ <packaging>eclipse-plugin</packaging>
+
+ <properties>
+ <!-- we want to use an old tycho version with the newest tycho-versions-plugin -->
+ <tycho-version>0.12.0</tycho-version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-packaging-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-director-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginCompatibilityTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginCompatibilityTest.java
new file mode 100644
index 0000000..6164df3
--- /dev/null
+++ b/tycho-its/src/test/java/org/eclipse/tycho/test/versionsplugin/TychoVersionsPluginCompatibilityTest.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2011 SAP AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SAP AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.test.versionsplugin;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.FileReader;
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.eclipse.tycho.core.utils.TychoVersion;
+import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
+import org.junit.Test;
+
+public class TychoVersionsPluginCompatibilityTest extends AbstractTychoIntegrationTest {
+
+ /**
+ * <p>
+ * This test verifies that current and future versions of the tycho-versions-plugin can be
+ * executed on a project that is built with Tycho 0.12.0. With this assertion it's possible to
+ * call the plugin without version on the commandline:
+ * </p>
+ * <p>
+ * <code>mvn org.eclipse.tycho:tycho-versions-plugin:set-version</code>
+ * </p>
+ * <p>
+ * Background: The tycho-versions-plugin 0.12.0 can't handle projects that are built with Tycho
+ * 0.11.0 or older, see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=363791">Bug
+ * 363791</a>.
+ * </p>
+ */
+ @Test
+ public void invokeVersionsPluginOnTycho0120Project() throws Exception {
+ String expectedNewVersion = "1.2.3";
+
+ Verifier verifier = getVerifier("TychoVersionsPluginTest", true);
+
+ verifier.getCliOptions().add("-DnewVersion=" + expectedNewVersion);
+ verifier.executeGoal("org.eclipse.tycho:tycho-versions-plugin:" + TychoVersion.getTychoVersion()
+ + ":set-version");
+
+ verifier.verifyErrorFreeLog();
+
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ Model pomModel = pomReader.read(new FileReader(new File(verifier.getBasedir(), "pom.xml")));
+ assertEquals("<version> in pom.xml has not been changed!", expectedNewVersion, pomModel.getVersion());
+ }
+
+}
diff --git a/tycho-maven-plugin/src/main/resources/META-INF/maven/extension.xml b/tycho-maven-plugin/src/main/resources/META-INF/maven/extension.xml
index 44a1f21..bd167d2 100644
--- a/tycho-maven-plugin/src/main/resources/META-INF/maven/extension.xml
+++ b/tycho-maven-plugin/src/main/resources/META-INF/maven/extension.xml
@@ -9,14 +9,14 @@
</exportedPackages>
<exportedArtifacts>
- <exportedArtifact>tycho-embedder-api</exportedArtifact>
- <exportedArtifact>tycho-core</exportedArtifact>
- <exportedArtifact>tycho-metadata-model</exportedArtifact>
- <exportedArtifact>org.eclipse.tycho.p2.resolver.facade</exportedArtifact>
- <exportedArtifact>org.eclipse.tycho.p2.tools.facade</exportedArtifact>
- <exportedArtifact>tycho-p2-facade</exportedArtifact>
- <exportedArtifact>tycho-equinox-api</exportedArtifact>
- <exportedArtifact>tycho-equinox</exportedArtifact>
- <exportedArtifact>org.eclipse.osgi</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:tycho-embedder-api</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:tycho-core</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:tycho-metadata-model</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:org.eclipse.tycho.p2.resolver.facade</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:org.eclipse.tycho.p2.tools.facade</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:tycho-p2-facade</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:tycho-equinox-api</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:tycho-equinox</exportedArtifact>
+ <exportedArtifact>org.eclipse.tycho:org.eclipse.osgi</exportedArtifact>
</exportedArtifacts>
</extension>