diff options
-rw-r--r-- | contrib/thrift-maven-plugin/pom.xml | 21 | ||||
-rw-r--r-- | contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java | 4 |
2 files changed, 23 insertions, 2 deletions
diff --git a/contrib/thrift-maven-plugin/pom.xml b/contrib/thrift-maven-plugin/pom.xml index b65f6aa86..4179b1d91 100644 --- a/contrib/thrift-maven-plugin/pom.xml +++ b/contrib/thrift-maven-plugin/pom.xml @@ -33,6 +33,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> @@ -48,6 +49,25 @@ </systemPropertyVariables> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.8</version> + <executions> + <execution> + <id>generate-jar-for-test</id> + <phase>generate-test-resources</phase> + <configuration> + <target> + <jar destfile="${project.build.directory}/SharedIdl.jar" basedir="${basedir}/src/test/resources" includes="**/*.thrift" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> <dependencies> @@ -88,5 +108,6 @@ <thrift.root>${basedir}/../..</thrift.root> <thrift.compiler>${thrift.root}/compiler/cpp/thrift</thrift.compiler> <thrift.test.home>${thrift.root}/test</thrift.test.home> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> </project> diff --git a/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java b/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java index c1176712d..7c90a990e 100644 --- a/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java +++ b/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestAbstractThriftMojo.java @@ -59,7 +59,7 @@ public class TestAbstractThriftMojo { // used by other tests. It's used here to represent a dependency of the project maven is building, // one that is contributing .thrift IDL files as well as any other artifacts. final Iterable<File> classpathElementFiles = Lists.newArrayList( - new File("src/test/resources/dependency-jar-test/SharedIdl.jar") + new File("target/SharedIdl.jar") ); final Set<File> thriftDirectories = mojo.makeThriftPathFromJars(temporaryThriftFileDirectory, classpathElementFiles); @@ -70,7 +70,7 @@ public class TestAbstractThriftMojo { // means it points to the directory containing the "idl" hierarchy rather than to the idl directory // itself. final Set<File> expected = Sets.newHashSet( - new File(testRootDir, "src/test/resources/dependency-jar-test/SharedIdl.jar") + new File(testRootDir, "target/SharedIdl.jar") ); assertEquals("makeThriftPathFromJars should return thrift IDL base path from within JAR", expected, thriftDirectories); |