Skip to content

Commit 772d0cc

Browse files
committed
Build: Make rest-spec-api a project so eclipse build works
The change makes rest-spec-api a project in the same way as we build dev-tools. it packages the tests and api in a bundle using the maven-remote-resources-plugin and uses the same plugin in the plugins and core pom to unpack the rest-api-spec into the target directory and references the rest tests there in the test resources. The main stimulus for this change is that for those using Eclipse the current build does not work. After running `mvn eclipse:eclipse` the Eclipse IDE errors because the rest-api-spec is outside of the project scope, meaning that every time the command is run (required whenever any dependencies change), the class path of all the projects has to be manually fixed.
1 parent ec6946e commit 772d0cc

File tree

342 files changed

+41
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+41
-2
lines changed

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
</includes>
282282
</testResource>
283283
<testResource>
284-
<directory>${project.basedir}/../rest-api-spec</directory>
284+
<directory>${elasticsearch.tools.directory}/rest-api-spec</directory>
285285
<targetPath>rest-api-spec</targetPath>
286286
<includes>
287287
<include>api/*.json</include>

plugins/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<!-- REST API specifications copied from main Elasticsearch specs
111111
because they are required to execute the REST tests in plugins -->
112112
<testResource>
113-
<directory>${project.basedir}/../../rest-api-spec</directory>
113+
<directory>${elasticsearch.tools.directory}/rest-api-spec</directory>
114114
<targetPath>rest-api-spec</targetPath>
115115
<includes>
116116
<!-- required by the test framework -->

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@
708708
<configuration>
709709
<resourceBundles>
710710
<resourceBundle>org.elasticsearch:dev-tools:${elasticsearch.version}</resourceBundle>
711+
<resourceBundle>org.elasticsearch:rest-api-spec:${elasticsearch.version}</resourceBundle>
711712
</resourceBundles>
712713
<outputDirectory>${elasticsearch.tools.directory}</outputDirectory>
713714
<!-- don't include dev-tools in artifacts -->
@@ -1457,6 +1458,7 @@ org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UT
14571458
</profiles>
14581459
<modules>
14591460
<module>dev-tools</module>
1461+
<module>rest-api-spec</module>
14601462
<module>plugins</module>
14611463
<module>core</module>
14621464
</modules>

rest-api-spec/pom.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<project>
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>org.elasticsearch</groupId>
4+
<artifactId>rest-api-spec</artifactId>
5+
<version>2.0.0-SNAPSHOT</version>
6+
<name>Elasticsearch Rest API Spec</name>
7+
<parent>
8+
<groupId>org.sonatype.oss</groupId>
9+
<artifactId>oss-parent</artifactId>
10+
<version>7</version>
11+
<relativePath></relativePath>
12+
</parent>
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>org.apache.maven.plugins</groupId>
20+
<artifactId>maven-remote-resources-plugin</artifactId>
21+
<version>1.5</version>
22+
<executions>
23+
<execution>
24+
<goals>
25+
<goal>bundle</goal>
26+
</goals>
27+
</execution>
28+
</executions>
29+
<configuration>
30+
<includes>
31+
<include>**/*</include>
32+
</includes>
33+
</configuration>
34+
</plugin>
35+
</plugins>
36+
</build>
37+
</project>

0 commit comments

Comments
 (0)