Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tycho-pomless/src')
-rw-r--r--tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoMapping.java30
-rw-r--r--tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java194
-rw-r--r--tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoMappingTest.java41
-rw-r--r--tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java165
-rw-r--r--tycho-pomless/src/test/resources/mapping/precedence/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/mapping/precedence/pom.xml0
-rw-r--r--tycho-pomless/src/test/resources/mapping/simple/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/illFormed/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/illFormed/feature.xml6
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/missingId/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/missingId/feature.xml6
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/missingVersion/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/missingVersion/feature.xml6
-rw-r--r--tycho-pomless/src/test/resources/modelreader/features/pom.xml11
-rw-r--r--tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/META-INF/MANIFEST.MF5
-rw-r--r--tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/grandparentInheritance/pom.xml15
-rw-r--r--tycho-pomless/src/test/resources/modelreader/missingManifestOrFeature/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/noParent/bundle/META-INF/MANIFEST.MF5
-rw-r--r--tycho-pomless/src/test/resources/modelreader/noParent/bundle/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/META-INF/MANIFEST.MF5
-rw-r--r--tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/META-INF/MANIFEST.MF5
-rw-r--r--tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/build.properties0
-rw-r--r--tycho-pomless/src/test/resources/modelreader/plugins/pom.xml11
-rw-r--r--tycho-pomless/src/test/resources/testpomless/bundle1.tests/META-INF/MANIFEST.MF5
-rw-r--r--tycho-pomless/src/test/resources/testpomless/bundle1.tests/build.properties2
-rw-r--r--tycho-pomless/src/test/resources/testpomless/bundle1.tests/src/DummyTest.java21
-rw-r--r--tycho-pomless/src/test/resources/testpomless/bundle1/META-INF/MANIFEST.MF5
-rw-r--r--tycho-pomless/src/test/resources/testpomless/bundle1/build.properties2
-rw-r--r--tycho-pomless/src/test/resources/testpomless/feature/build.properties1
-rw-r--r--tycho-pomless/src/test/resources/testpomless/feature/feature.xml20
-rw-r--r--tycho-pomless/src/test/resources/testpomless/pom.xml22
33 files changed, 583 insertions, 0 deletions
diff --git a/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoMapping.java b/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoMapping.java
new file mode 100644
index 0000000..1e742e1
--- /dev/null
+++ b/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoMapping.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2015 SAP SE 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 SE - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.pomless;
+
+import org.codehaus.plexus.component.annotations.Component;
+import org.sonatype.maven.polyglot.mapping.Mapping;
+import org.sonatype.maven.polyglot.mapping.MappingSupport;
+
+@Component(role = Mapping.class, hint = "tycho")
+public class TychoMapping extends MappingSupport {
+
+ public TychoMapping() {
+ super("tycho");
+ // can't check for META-INF/MANIFEST.MF as this is in a subfolder and maven (and tycho) assumes
+ // in many places that the pom file is located in the project base dir, so we just use build.properties as a marker file
+ setPomNames("build.properties");
+ setAcceptLocationExtensions("build.properties");
+ // make sure priority is lower than pom.xml (XmlMapping) so we can still override and use pom.xml if needed
+ setPriority(-2);
+ }
+
+}
diff --git a/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java b/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java
new file mode 100644
index 0000000..48b263f
--- /dev/null
+++ b/tycho-pomless/src/main/java/org/eclipse/tycho/pomless/TychoModelReader.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2015 SAP SE 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 SE - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.pomless;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.building.ModelProcessor;
+import org.apache.maven.model.io.ModelParseException;
+import org.apache.maven.model.io.ModelReader;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.sonatype.maven.polyglot.PolyglotModelManager;
+import org.sonatype.maven.polyglot.PolyglotModelUtil;
+import org.sonatype.maven.polyglot.io.ModelReaderSupport;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/**
+ * Tycho POM model reader. Deduces maven model artifactId and version from OSGi manifest
+ * Bundle-SymbolicName and Bundle-Version headers or feature.xml id and version attributes. Assumes
+ * parent pom is located in parent directory (from which groupId is inherited). Bundles with
+ * Bundle-SymbolicName ending with ".tests" will be assigned packaging type "eclipse-test-plugin".
+ */
+@Component(role = ModelReader.class, hint = "tycho")
+public class TychoModelReader extends ModelReaderSupport {
+
+ private static final String BUNDLE_SYMBOLIC_NAME = "Bundle-SymbolicName";
+ private static final String QUALIFIER_SUFFIX = ".qualifier";
+
+ @Requirement
+ private PolyglotModelManager polyglotModelManager;
+
+ public TychoModelReader() {
+ }
+
+ public Model read(Reader input, Map<String, ?> options) throws IOException, ModelParseException {
+ File projectRoot = new File(PolyglotModelUtil.getLocation(options)).getParentFile();
+ File manifestFile = new File(projectRoot, "META-INF/MANIFEST.MF");
+ File featureXml = new File(projectRoot, "feature.xml");
+ if (manifestFile.isFile()) {
+ return createPomFromManifest(manifestFile);
+ } else if (featureXml.isFile()) {
+ return createPomFromFeatureXml(featureXml);
+ } else {
+ throw new IOException("Neither META-INF/MANIFEST.MF nor feature.xml found in " + projectRoot);
+ }
+ }
+
+ private Model createPomFromManifest(File manifestFile) throws IOException, ModelParseException {
+ Attributes headers = readManifestHeaders(manifestFile);
+ String bundleSymbolicName = getBundleSymbolicName(headers, manifestFile);
+ Model model = createModel();
+ model.setParent(findParent(manifestFile.getParentFile().getParentFile()));
+ // groupId is inherited from parent pom
+ model.setArtifactId(bundleSymbolicName);
+ String bundleVersion = getRequiredHeaderValue("Bundle-Version", headers, manifestFile);
+ model.setVersion(getPomVersion(bundleVersion));
+ model.setPackaging(getPackagingType(bundleSymbolicName));
+ return model;
+ }
+
+ private Model createPomFromFeatureXml(File featureXml) throws IOException, ModelParseException {
+ Document doc;
+ try {
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ doc = parser.parse(featureXml);
+ } catch (ParserConfigurationException e) {
+ throw new RuntimeException(e);
+ } catch (SAXException e) {
+ throw new ModelParseException(e.getMessage(), -1, -1);
+ }
+ Element root = doc.getDocumentElement();
+ Model model = createModel();
+ model.setParent(findParent(featureXml.getParentFile()));
+ Attr featureIdNode = root.getAttributeNode("id");
+ if (featureIdNode == null) {
+ throw new ModelParseException("missing feature id in " + featureXml.getAbsolutePath(), -1, -1);
+ }
+ model.setArtifactId(featureIdNode.getValue());
+ Attr featureVersionNode = root.getAttributeNode("version");
+ if (featureVersionNode == null) {
+ throw new ModelParseException("missing feature version in " + featureXml.getAbsolutePath(), -1, -1);
+ }
+ model.setVersion(getPomVersion(featureVersionNode.getValue()));
+ model.setPackaging("eclipse-feature");
+ // groupId is inherited from parent pom
+ return model;
+ }
+
+ private Model createModel() {
+ Model model = new Model();
+ model.setModelVersion("4.0.0");
+ return model;
+ }
+
+ private String getBundleSymbolicName(Attributes headers, File manifestFile) throws ModelParseException {
+ String symbolicName = getRequiredHeaderValue(BUNDLE_SYMBOLIC_NAME, headers, manifestFile);
+ // strip off any directives/attributes
+ int semicolonIndex = symbolicName.indexOf(';');
+ if (semicolonIndex > 0) {
+ symbolicName = symbolicName.substring(0, semicolonIndex);
+ }
+ return symbolicName;
+ }
+
+ private String getRequiredHeaderValue(String headerKey, Attributes headers, File manifestFile)
+ throws ModelParseException {
+ String value = headers.getValue(headerKey);
+ if (value == null) {
+ throw new ModelParseException("Required header " + headerKey + " missing in " + manifestFile, -1, -1);
+ }
+ return value;
+ }
+
+ private Attributes readManifestHeaders(File manifestFile) throws IOException {
+ Manifest manifest = new Manifest();
+ FileInputStream stream = new FileInputStream(manifestFile);
+ try {
+ manifest.read(stream);
+ } finally {
+ stream.close();
+ }
+ return manifest.getMainAttributes();
+ }
+
+ private static String getPomVersion(String pdeVersion) {
+ String pomVersion = pdeVersion;
+ if (pdeVersion.endsWith(QUALIFIER_SUFFIX)) {
+ pomVersion = pdeVersion.substring(0, pdeVersion.length() - QUALIFIER_SUFFIX.length()) + "-SNAPSHOT";
+ }
+ return pomVersion;
+ }
+
+ private String getPackagingType(String symbolicName) {
+ // assume test bundles end with ".tests"
+ if (symbolicName.endsWith(".tests")) {
+ return "eclipse-test-plugin";
+ } else {
+ return "eclipse-plugin";
+ }
+ }
+
+ Parent findParent(File projectRoot) throws ModelParseException, IOException {
+ // assumption/limitation: parent pom must be physically located in
+ // parent directory
+ File parentPom = polyglotModelManager.locatePom(projectRoot.getParentFile());
+ if (parentPom == null) {
+ throw new FileNotFoundException("No parent pom file found in " + projectRoot.getParentFile());
+ }
+ Map<String, File> options = new HashMap<String, File>(4);
+ options.put(ModelProcessor.SOURCE, parentPom);
+ ModelReader reader = polyglotModelManager.getReaderFor(options);
+ Model parentModel = reader.read(parentPom, options);
+ Parent parentReference = new Parent();
+ String groupId = parentModel.getGroupId();
+ if (groupId == null) {
+ // must be inherited from grandparent
+ groupId = parentModel.getParent().getGroupId();
+ }
+ parentReference.setGroupId(groupId);
+ parentReference.setArtifactId(parentModel.getArtifactId());
+ String version = parentModel.getVersion();
+ if (version == null) {
+ // must be inherited from grandparent
+ version = parentModel.getParent().getVersion();
+ }
+ parentReference.setVersion(version);
+ return parentReference;
+ }
+}
diff --git a/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoMappingTest.java b/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoMappingTest.java
new file mode 100644
index 0000000..9cc5007
--- /dev/null
+++ b/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoMappingTest.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2015 SAP SE 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 SE - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.pomless;
+
+import java.io.File;
+
+import org.codehaus.plexus.PlexusTestCase;
+import org.sonatype.maven.polyglot.PolyglotModelManager;
+
+public class TychoMappingTest extends PlexusTestCase {
+
+ private PolyglotModelManager polyglotModelManager;
+
+ @Override
+ protected void setUp() throws Exception {
+ polyglotModelManager = lookup(PolyglotModelManager.class);
+ }
+
+ public void testLocateBuildProperties() throws Exception {
+ File pom = polyglotModelManager.locatePom(new File(getMappingTestDir(), "simple"));
+ assertEquals("build.properties", pom.getName());
+ }
+
+ public void testPriority() throws Exception {
+ File pom = polyglotModelManager.locatePom(new File(getMappingTestDir(), "precedence"));
+ assertEquals("pom.xml must win over build.properties", "pom.xml", pom.getName());
+ }
+
+ private File getMappingTestDir() {
+ return new File(getBasedir(), "src/test/resources/mapping/");
+ }
+
+}
diff --git a/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java b/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java
new file mode 100644
index 0000000..da61919
--- /dev/null
+++ b/tycho-pomless/src/test/java/org/eclipse/tycho/pomless/TychoModelReaderTest.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2015 SAP SE 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 SE - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tycho.pomless;
+
+import static org.junit.Assert.assertThat;
+import static org.junit.matchers.JUnitMatchers.containsString;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.building.ModelProcessor;
+import org.apache.maven.model.io.ModelParseException;
+import org.apache.maven.model.io.ModelReader;
+import org.codehaus.plexus.PlexusTestCase;
+
+public class TychoModelReaderTest extends PlexusTestCase {
+
+ private TychoModelReader tychoModelReader;
+
+ @Override
+ protected void setUp() throws Exception {
+ tychoModelReader = (TychoModelReader) lookup(ModelReader.class, "tycho");
+ }
+
+ public void testReadBundle() throws Exception {
+ File buildProperties = new File(getPolyglotTestDir(), "bundle1/build.properties");
+ Model model = tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ assertEquals("4.0.0", model.getModelVersion());
+ assertEquals("pomless.bundle", model.getArtifactId());
+ assertEquals("0.1.0-SNAPSHOT", model.getVersion());
+ assertEquals("eclipse-plugin", model.getPackaging());
+ assertParent(model.getParent());
+ }
+
+ public void testReadTestBundle() throws Exception {
+ File buildProperties = new File(getPolyglotTestDir(), "bundle1.tests/build.properties");
+ Model model = tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ assertEquals("pomless.bundle.tests", model.getArtifactId());
+ assertEquals("1.0.1", model.getVersion());
+ assertEquals("eclipse-test-plugin", model.getPackaging());
+ assertParent(model.getParent());
+ }
+
+ public void testReadFeature() throws Exception {
+ File buildProperties = new File(getPolyglotTestDir(), "feature/build.properties");
+ Model model = tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ assertEquals("pomless.feature", model.getArtifactId());
+ assertEquals("1.0.0-SNAPSHOT", model.getVersion());
+ assertEquals("eclipse-feature", model.getPackaging());
+ assertParent(model.getParent());
+ }
+
+ public void testMissingManifestOrFeature() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/missingManifestOrFeature/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (IOException e) {
+ // expected
+ }
+ }
+
+ public void testIllFormedFeature() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/features/illFormed/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (ModelParseException e) {
+ // expected
+ }
+ }
+
+ public void testFeatureWithoutId() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/features/missingId/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (ModelParseException e) {
+ assertThat(e.getMessage(), containsString("missing feature id in"));
+ }
+ }
+
+ public void testFeatureWithoutVersion() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/features/missingVersion/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (ModelParseException e) {
+ assertThat(e.getMessage(), containsString("missing feature version in"));
+ }
+ }
+
+ public void testBundleWithoutSymbolicName() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/plugins/missingBsn/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (ModelParseException e) {
+ assertThat(e.getMessage(), containsString("Bundle-SymbolicName missing in"));
+ }
+ }
+
+ public void testBundleWithoutVersion() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/plugins/missingVersion/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (ModelParseException e) {
+ assertThat(e.getMessage(), containsString("Bundle-Version missing in"));
+ }
+ }
+
+ public void testNoParent() throws Exception {
+ File buildProperties = new File(getTestResourcesDir(), "modelreader/noParent/bundle/build.properties");
+ try {
+ tychoModelReader.read((Reader) null, createReaderOptions(buildProperties));
+ fail();
+ } catch (IOException e) {
+ assertThat(e.getMessage(), containsString("No parent pom file found in"));
+ }
+ }
+
+ public void testFindParent() throws Exception {
+ Parent parentReference = tychoModelReader.findParent(new File(getTestResourcesDir(),
+ "modelreader/grandparentInheritance/bundle/"));
+ assertEquals("bundle-parent", parentReference.getArtifactId());
+ assertEquals("grandparent.groupid", parentReference.getGroupId());
+ assertEquals("1.2.3", parentReference.getVersion());
+ }
+
+ private void assertParent(Parent parent) {
+ assertNotNull(parent);
+ assertEquals("testParent.groupId", parent.getGroupId());
+ assertEquals("testparent", parent.getArtifactId());
+ assertEquals("0.0.1-SNAPSHOT", parent.getVersion());
+ }
+
+ private Map<String, String> createReaderOptions(File buildProperties) {
+ Map<String, String> options = new HashMap<String, String>();
+ options.put(ModelProcessor.SOURCE, buildProperties.getAbsolutePath());
+ return options;
+ }
+
+ private File getPolyglotTestDir() {
+ return new File(getTestResourcesDir(), "testpomless/");
+ }
+
+ private File getTestResourcesDir() {
+ return new File(getBasedir(), "src/test/resources/");
+ }
+
+}
diff --git a/tycho-pomless/src/test/resources/mapping/precedence/build.properties b/tycho-pomless/src/test/resources/mapping/precedence/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/mapping/precedence/build.properties
diff --git a/tycho-pomless/src/test/resources/mapping/precedence/pom.xml b/tycho-pomless/src/test/resources/mapping/precedence/pom.xml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/mapping/precedence/pom.xml
diff --git a/tycho-pomless/src/test/resources/mapping/simple/build.properties b/tycho-pomless/src/test/resources/mapping/simple/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/mapping/simple/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/features/illFormed/build.properties b/tycho-pomless/src/test/resources/modelreader/features/illFormed/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/illFormed/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/features/illFormed/feature.xml b/tycho-pomless/src/test/resources/modelreader/features/illFormed/feature.xml
new file mode 100644
index 0000000..898757a
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/illFormed/feature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="pomless.feature"
+ version="1.0.0.qualifier">
+
+</feature_NOT_WELL_FORMED>
diff --git a/tycho-pomless/src/test/resources/modelreader/features/missingId/build.properties b/tycho-pomless/src/test/resources/modelreader/features/missingId/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/missingId/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/features/missingId/feature.xml b/tycho-pomless/src/test/resources/modelreader/features/missingId/feature.xml
new file mode 100644
index 0000000..1374081
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/missingId/feature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ MISSING_ID="pomless.feature"
+ version="1.0.0.qualifier">
+
+</feature>
diff --git a/tycho-pomless/src/test/resources/modelreader/features/missingVersion/build.properties b/tycho-pomless/src/test/resources/modelreader/features/missingVersion/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/missingVersion/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/features/missingVersion/feature.xml b/tycho-pomless/src/test/resources/modelreader/features/missingVersion/feature.xml
new file mode 100644
index 0000000..803d921
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/missingVersion/feature.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="pomless.feature"
+ MISSING_VERSION="1.0.0.qualifier">
+
+</feature>
diff --git a/tycho-pomless/src/test/resources/modelreader/features/pom.xml b/tycho-pomless/src/test/resources/modelreader/features/pom.xml
new file mode 100644
index 0000000..5a8d2eb
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/features/pom.xml
@@ -0,0 +1,11 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>testParent.groupId</groupId>
+ <artifactId>feature-testparent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+</project>
diff --git a/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/META-INF/MANIFEST.MF b/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ce659e2
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: pomless.bundle
+Bundle-Version: 0.1.0.qualifier
+
diff --git a/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/build.properties b/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/bundle/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/pom.xml b/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/pom.xml
new file mode 100644
index 0000000..8c5dca9
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/grandparentInheritance/pom.xml
@@ -0,0 +1,15 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>grandparent.groupid</groupId>
+ <artifactId>grandparent.artifactId</artifactId>
+ <version>1.2.3</version>
+ </parent>
+ <!-- groupId and version inherited from grandparent -->
+ <artifactId>bundle-parent</artifactId>
+ <packaging>pom</packaging>
+
+</project>
diff --git a/tycho-pomless/src/test/resources/modelreader/missingManifestOrFeature/build.properties b/tycho-pomless/src/test/resources/modelreader/missingManifestOrFeature/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/missingManifestOrFeature/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/noParent/bundle/META-INF/MANIFEST.MF b/tycho-pomless/src/test/resources/modelreader/noParent/bundle/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..390c98c
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/noParent/bundle/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: pomless.bundle;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+
diff --git a/tycho-pomless/src/test/resources/modelreader/noParent/bundle/build.properties b/tycho-pomless/src/test/resources/modelreader/noParent/bundle/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/noParent/bundle/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/META-INF/MANIFEST.MF b/tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..7db3cad
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Missing-Bundle-SymbolicName: pomless.bundle;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+
diff --git a/tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/build.properties b/tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/plugins/missingBsn/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/META-INF/MANIFEST.MF b/tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..7681299
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: pomless.bundle;singleton:=true
+Missing-Bundle-Version: 0.1.0.qualifier
+
diff --git a/tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/build.properties b/tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/build.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/plugins/missingVersion/build.properties
diff --git a/tycho-pomless/src/test/resources/modelreader/plugins/pom.xml b/tycho-pomless/src/test/resources/modelreader/plugins/pom.xml
new file mode 100644
index 0000000..210c387
--- /dev/null
+++ b/tycho-pomless/src/test/resources/modelreader/plugins/pom.xml
@@ -0,0 +1,11 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>testParent.groupId</groupId>
+ <artifactId>plugins-testparent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+</project>
diff --git a/tycho-pomless/src/test/resources/testpomless/bundle1.tests/META-INF/MANIFEST.MF b/tycho-pomless/src/test/resources/testpomless/bundle1.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1252600
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/bundle1.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: pomless.bundle.tests
+Bundle-Version: 1.0.1
+Require-Bundle: org.junit;bundle-version="4.0.0"
diff --git a/tycho-pomless/src/test/resources/testpomless/bundle1.tests/build.properties b/tycho-pomless/src/test/resources/testpomless/bundle1.tests/build.properties
new file mode 100644
index 0000000..c45bfb5
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/bundle1.tests/build.properties
@@ -0,0 +1,2 @@
+bin.includes = META-INF/,.
+source.. = src/
diff --git a/tycho-pomless/src/test/resources/testpomless/bundle1.tests/src/DummyTest.java b/tycho-pomless/src/test/resources/testpomless/bundle1.tests/src/DummyTest.java
new file mode 100644
index 0000000..56495fe
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/bundle1.tests/src/DummyTest.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2015 SAP SE 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 SE - initial API and implementation
+ *******************************************************************************/
+import org.junit.Assert;
+import org.junit.Test;
+
+public class DummyTest {
+
+ @Test
+ public void test() {
+ Assert.assertTrue(true);
+ }
+
+}
diff --git a/tycho-pomless/src/test/resources/testpomless/bundle1/META-INF/MANIFEST.MF b/tycho-pomless/src/test/resources/testpomless/bundle1/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..390c98c
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/bundle1/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: pomless.bundle;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+
diff --git a/tycho-pomless/src/test/resources/testpomless/bundle1/build.properties b/tycho-pomless/src/test/resources/testpomless/bundle1/build.properties
new file mode 100644
index 0000000..c45bfb5
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/bundle1/build.properties
@@ -0,0 +1,2 @@
+bin.includes = META-INF/,.
+source.. = src/
diff --git a/tycho-pomless/src/test/resources/testpomless/feature/build.properties b/tycho-pomless/src/test/resources/testpomless/feature/build.properties
new file mode 100644
index 0000000..64f93a9
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/feature/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/tycho-pomless/src/test/resources/testpomless/feature/feature.xml b/tycho-pomless/src/test/resources/testpomless/feature/feature.xml
new file mode 100644
index 0000000..da903db
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/feature/feature.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="pomless.feature"
+ version="1.0.0.qualifier">
+
+ <plugin
+ id="pomless.bundle"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="pomless.bundle.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/tycho-pomless/src/test/resources/testpomless/pom.xml b/tycho-pomless/src/test/resources/testpomless/pom.xml
new file mode 100644
index 0000000..acd2d1f
--- /dev/null
+++ b/tycho-pomless/src/test/resources/testpomless/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Copyright (c) 2015 SAP SE 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 SE - initial API and implementation
+ -->
+
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>testParent.groupId</groupId>
+ <artifactId>testparent</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+</project>

Back to the top