Skip to content

Commit

Permalink
Add test project to demonstrate jgit buildtimestamp provider bug
Browse files Browse the repository at this point in the history
Change-Id: Ied249d882fc5cb3233dc55c5b485f6a7762436ec
  • Loading branch information
briandealwis authored and Christoph Läubrich committed Sep 22, 2022
1 parent b11b0c4 commit 90a3a61
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="feature"
label="Feature"
version="0.0.1.qualifier">

<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>

<license url="http://www.example.com/license">
[Enter License Description here.]
</license>

<plugin
id="com.google.guava"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>pomDependencyConsider.buildtimestamp.jgit</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>feature</artifactId>
<packaging>eclipse-feature</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>pomDependencyConsider.buildtimestamp.jgit</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<buildtimestamp.jgit.group>org.eclipse.tycho</buildtimestamp.jgit.group>
<tycho-version>3.1.0-SNAPSHOT</tycho-version>
</properties>

<modules>
<module>feature</module>
</modules>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.0-jre</version>
</dependency>
</dependencies>

<build>
<plugins>
<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>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho-version}</version>
<dependencies>
<dependency>
<groupId>${buildtimestamp.jgit.group}</groupId>
<artifactId>tycho-buildtimestamp-jgit</artifactId>
<version>${tycho-version}</version>
</dependency>
</dependencies>
<configuration>
<timestampProvider>jgit</timestampProvider>
<jgit.dirtyWorkingTree>warning</jgit.dirtyWorkingTree>
<jgit.ignore>
pom.xml
</jgit.ignore>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.eclipse.tycho.test.pomDependencyConsider;

import static java.util.Arrays.asList;

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;

public class PackagingPomDependencyWithTimestampProviderTest extends AbstractTychoIntegrationTest {

@Test
public void testPackage() throws Exception {
// project with pomDependency=consider, and jgit build timestamp provider and a
// feature referencing a non-Tycho artifact
Verifier verifier = getVerifier("pomDependencyConsider.buildtimestamp.jgit", true);
verifier.executeGoals(asList("clean", "package"));
// Test should not fail, but will fail with:
// "Could not resolve plugin com.google.guava_0.0.0"
}
}

0 comments on commit 90a3a61

Please sign in to comment.