-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
/
Copy pathpom.xml
123 lines (117 loc) · 5.53 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<version>3.0.1-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openapi-generator-gradle-plugin-mvn-wrapper</artifactId>
<packaging>pom</packaging>
<name>openapi-generator-gradle-plugin (maven wrapper)</name>
<description>This is a maven wrapper to call gradle during installation phase</description>
<dependencies>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- NOTE: Consider this temporary, as a way to cleanly hook into our pipeline.
We've discussed moving the entire project to gradle https://github.com/OpenAPITools/openapi-generator/issues/200, which would avoid this fitting. -->
<!-- 1) disable maven install. This wrapper is not needed. (gradle will install a jar and a pom into the local maven repo) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<!-- 2) run gradle -->
<plugin>
<groupId>org.fortasoft</groupId>
<artifactId>gradle-maven-plugin</artifactId>
<version>1.0.8</version>
<configuration>
<gradleVersion>4.7</gradleVersion>
<args>
<arg>-P openApiGeneratorVersion=${project.version}</arg>
</args>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<!-- goal must be "invoke" -->
<goal>invoke</goal>
</goals>
<configuration>
<tasks>
<!-- calls "clean build publishToMavenLocal" -->
<task>clean</task>
<task>build</task>
<task>publishToMavenLocal</task>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<!-- 3) copy the gradle artifacts to '/target/gradle-artifacts'. -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-gradle-artifacts</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/gradle-artifacts</outputDirectory>
<resources>
<resource>
<directory>${settings.localRepository}/org/openapitools/openapi-generator-gradle-plugin/${project.version}/</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- 4) change maven-deploy-plugin. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<!-- deploying this wrapper is not needed -->
<execution>
<id>default-deploy</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<!-- deploy the jar and the pom from the local maven repo (the one created by gradle) -->
<execution>
<id>custom-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<file>${project.basedir}/target/gradle-artifacts/openapi-generator-gradle-plugin-${project.version}.jar</file>
<pomFile>${project.basedir}/target/gradle-artifacts/openapi-generator-gradle-plugin-${project.version}.pom</pomFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>