Maven 플러그인의 가장 일반적인 사용 사례는 빌드 중에 아티팩트를 추가하는 것입니다. 이 작업은 register 실행 목표를 사용하여 수행할 수 있습니다.
<plugin>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-registry-maven-plugin</artifactId>
<version>${apicurio.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>register</goal>
</goals>
<configuration>
<registryUrl>MY-REGISTRY-URL/apis/registry/v2</registryUrl>
<authServerUrl>MY-AUTH-SERVER</authServerUrl>
<clientId>MY-CLIENT-ID</clientId>
<clientSecret>MY-CLIENT-SECRET</clientSecret>
<artifacts>
<artifact>
<groupId>TestGroup</groupId>
<artifactId>FullNameRecord</artifactId>
<file>${project.basedir}/src/main/resources/schemas/record.avsc</file>
<ifExists>FAIL</ifExists>
</artifact>
<artifact>
<groupId>TestGroup</groupId>
<artifactId>ExampleAPI</artifactId>
<type>GRAPHQL</type>
<file>${project.basedir}/src/main/resources/apis/example.graphql</file>
<ifExists>RETURN_OR_UPDATE</ifExists>
<canonicalize>true</canonicalize>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.apicurio</groupId>
<artifactId>apicurio-registry-maven-plugin</artifactId>
<version>${apicurio.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>register</goal>
1
</goals>
<configuration>
<registryUrl>MY-REGISTRY-URL/apis/registry/v2</registryUrl>
2
<authServerUrl>MY-AUTH-SERVER</authServerUrl>
<clientId>MY-CLIENT-ID</clientId>
<clientSecret>MY-CLIENT-SECRET</clientSecret>
3
<artifacts>
<artifact>
<groupId>TestGroup</groupId>
4
<artifactId>FullNameRecord</artifactId>
<file>${project.basedir}/src/main/resources/schemas/record.avsc</file>
<ifExists>FAIL</ifExists>
</artifact>
<artifact>
<groupId>TestGroup</groupId>
<artifactId>ExampleAPI</artifactId>
5
<type>GRAPHQL</type>
<file>${project.basedir}/src/main/resources/apis/example.graphql</file>
<ifExists>RETURN_OR_UPDATE</ifExists>
<canonicalize>true</canonicalize>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow