mirror of
https://github.com/valitydev/swag-claim-management.git
synced 2024-11-06 01:35:18 +00:00
BJ-532: Claim Management. Create client/server build (#3)
This commit is contained in:
parent
5c6a8d9bba
commit
9b5413de72
5
.gitignore
vendored
5
.gitignore
vendored
@ -58,4 +58,7 @@ package-lock.json
|
|||||||
|
|
||||||
# Gradle:
|
# Gradle:
|
||||||
.idea/gradle.xml
|
.idea/gradle.xml
|
||||||
.idea/libraries
|
.idea/libraries
|
||||||
|
|
||||||
|
# Idea
|
||||||
|
*.iml
|
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@ -23,13 +23,15 @@ build('swag-claim-management', 'docker-host') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Java
|
// Java
|
||||||
runStage('Execute build container') {
|
runStage('Build client & server') {
|
||||||
withCredentials([[$class: 'FileBinding', credentialsId: 'java-maven-settings.xml', variable: 'SETTINGS_XML']]) {
|
withCredentials([[$class: 'FileBinding', credentialsId: 'java-maven-settings.xml', variable: 'SETTINGS_XML']]) {
|
||||||
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
|
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
|
||||||
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} wc_java.deploy'
|
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.deploy_client'
|
||||||
} else {
|
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.deploy_server'
|
||||||
sh 'make SETTINGS_XML=${SETTINGS_XML} wc_java.compile'
|
} else {
|
||||||
}
|
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.compile_client'
|
||||||
|
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.swag.compile_server'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
Makefile
34
Makefile
@ -63,6 +63,40 @@ endif
|
|||||||
|
|
||||||
MVN = mvn -s $(SETTINGS_XML) -Dcommit.number="$(NUMBER_COMMITS)"
|
MVN = mvn -s $(SETTINGS_XML) -Dcommit.number="$(NUMBER_COMMITS)"
|
||||||
|
|
||||||
|
java.swag.compile_client:
|
||||||
|
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||||
|
$(MVN) clean && \
|
||||||
|
$(MVN) compile -P="client"
|
||||||
|
|
||||||
|
java.swag.deploy_client:
|
||||||
|
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||||
|
$(MVN) clean && \
|
||||||
|
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
|
||||||
|
$(MVN) deploy -P="client"
|
||||||
|
|
||||||
|
java.swag.install_client:
|
||||||
|
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||||
|
$(MVN) clean && \
|
||||||
|
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
|
||||||
|
$(MVN) install -P="client"
|
||||||
|
|
||||||
|
java.swag.compile_server:
|
||||||
|
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||||
|
$(MVN) clean && \
|
||||||
|
$(MVN) compile -P="server"
|
||||||
|
|
||||||
|
java.swag.deploy_server:
|
||||||
|
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||||
|
$(MVN) clean && \
|
||||||
|
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
|
||||||
|
$(MVN) deploy -P="server"
|
||||||
|
|
||||||
|
java.swag.install_server:
|
||||||
|
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
|
||||||
|
$(MVN) clean && \
|
||||||
|
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
|
||||||
|
$(MVN) install -P="server"
|
||||||
|
|
||||||
java.compile: java.settings
|
java.compile: java.settings
|
||||||
$(MVN) compile
|
$(MVN) compile
|
||||||
|
|
||||||
|
24
README.md
24
README.md
@ -18,8 +18,24 @@
|
|||||||
5. Once you finish with the changes you can run tests using: `npm test`
|
5. Once you finish with the changes you can run tests using: `npm test`
|
||||||
6. Share you changes with the rest of the world by pushing to GitHub :smile:
|
6. Share you changes with the rest of the world by pushing to GitHub :smile:
|
||||||
|
|
||||||
Для генерации клиентского java-кода используйте команду
|
Пример подключения в проект клиентской зависимости:
|
||||||
`npm run-script build && swagger-codegen generate -i web_deploy/swagger.json -l java -o ./java --api-package "com.rbkmoney.swag.claim_management.client" --artifact-id "swag-claim-management" --artifact-version "1.1.0" --group-id "com.rbkmoney" --model-package "com.rbkmoney.swag.claim_management.model" --library resttemplate --additional-properties dateLibrary=java8`
|
|
||||||
|
|
||||||
Для генерации серверного java-кода используйте команду
|
```
|
||||||
`mvn package`
|
<dependency>
|
||||||
|
<groupId>com.rbkmoney</groupId>
|
||||||
|
<artifactId>claim-management</artifactId>
|
||||||
|
<version>1.45-5184fdc-client</version>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
Пример подключения в проект серверной зависимости:
|
||||||
|
|
||||||
|
```
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.rbkmoney</groupId>
|
||||||
|
<artifactId>claim-management</artifactId>
|
||||||
|
<version>1.45-5184fdc-server</version>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Нельзя использовать две зависимости одновременно (из-за одинакового пути в package)**
|
102
pom.xml
102
pom.xml
@ -35,6 +35,9 @@
|
|||||||
<jackson-version>2.8.9</jackson-version>
|
<jackson-version>2.8.9</jackson-version>
|
||||||
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
|
<jackson-threetenbp-version>2.6.4</jackson-threetenbp-version>
|
||||||
<spring-version>5.1.3.RELEASE</spring-version>
|
<spring-version>5.1.3.RELEASE</spring-version>
|
||||||
|
<javax-annotation-api-version>1.3.2</javax-annotation-api-version>
|
||||||
|
<javax-validation-api-version>1.1.0.Final</javax-validation-api-version>
|
||||||
|
<jaxb-version>2.3.1</jaxb-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -109,18 +112,18 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.annotation</groupId>
|
<groupId>javax.annotation</groupId>
|
||||||
<artifactId>javax.annotation-api</artifactId>
|
<artifactId>javax.annotation-api</artifactId>
|
||||||
<version>1.3.2</version>
|
<version>${javax-annotation-api-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.xml.bind</groupId>
|
<groupId>javax.xml.bind</groupId>
|
||||||
<artifactId>jaxb-api</artifactId>
|
<artifactId>jaxb-api</artifactId>
|
||||||
<version>2.3.1</version>
|
<version>${jaxb-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Bean Validation API support -->
|
<!-- Bean Validation API support -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.validation</groupId>
|
<groupId>javax.validation</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>validation-api</artifactId>
|
||||||
<version>1.1.0.Final</version>
|
<version>${javax-validation-api-version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -132,34 +135,73 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<profiles>
|
||||||
<plugins>
|
<profile>
|
||||||
<plugin>
|
<id>server</id>
|
||||||
<groupId>io.swagger</groupId>
|
<build>
|
||||||
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
<plugins>
|
||||||
<version>2.3.1</version>
|
<plugin>
|
||||||
<executions>
|
<groupId>io.swagger</groupId>
|
||||||
<execution>
|
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
||||||
<phase>generate-sources</phase>
|
<version>2.3.1</version>
|
||||||
<goals>
|
<executions>
|
||||||
<goal>generate</goal>
|
<execution>
|
||||||
</goals>
|
<id>generate-server</id>
|
||||||
<configuration>
|
<phase>generate-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>generate</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<inputSpec>web_deploy/swagger.yaml</inputSpec>
|
||||||
|
<configOptions>
|
||||||
|
<dateLibrary>java8</dateLibrary>
|
||||||
|
</configOptions>
|
||||||
|
|
||||||
<inputSpec>web_deploy/swagger.yaml</inputSpec>
|
<language>spring</language>
|
||||||
<configOptions>
|
<library>spring-mvc</library>
|
||||||
<dateLibrary>java8</dateLibrary>
|
|
||||||
</configOptions>
|
|
||||||
|
|
||||||
<language>spring</language>
|
<apiPackage>${default.package}.api</apiPackage>
|
||||||
<library>spring-mvc</library>
|
<modelPackage>${default.package}.model</modelPackage>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>client</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.swagger</groupId>
|
||||||
|
<artifactId>swagger-codegen-maven-plugin</artifactId>
|
||||||
|
<version>2.3.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>generate-client</id>
|
||||||
|
<phase>generate-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>generate</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<inputSpec>web_deploy/swagger.yaml</inputSpec>
|
||||||
|
<configOptions>
|
||||||
|
<dateLibrary>java8</dateLibrary>
|
||||||
|
</configOptions>
|
||||||
|
|
||||||
<apiPackage>${default.package}.api</apiPackage>
|
<language>java</language>
|
||||||
<modelPackage>${default.package}.model</modelPackage>
|
<library>resttemplate</library>
|
||||||
</configuration>
|
|
||||||
</execution>
|
<apiPackage>${default.package}.api</apiPackage>
|
||||||
</executions>
|
<modelPackage>${default.package}.model</modelPackage>
|
||||||
</plugin>
|
</configuration>
|
||||||
</plugins>
|
</execution>
|
||||||
</build>
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
Loading…
Reference in New Issue
Block a user