Skip to content

Commit

Permalink
Merge 1d2c59e into 04a2a0a
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongZhang committed Jul 12, 2018
2 parents 04a2a0a + 1d2c59e commit 58c5f3a
Show file tree
Hide file tree
Showing 27 changed files with 880 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/alipay/jarslink.svg?branch=master)](https://travis-ci.org/alipay/jarslink)
[![Coverage Status](https://coveralls.io/repos/github/alipay/jarslink/badge.svg?branch=master)](https://coveralls.io/github/alipay/jarslink)
![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)
![maven](https://img.shields.io/nexus/r/https/oss.sonatype.org/com.alipay.sofa/sofa-jarslink.svg)
![maven](https://img.shields.io/nexus/s/https/oss.sonatype.org/com.alipay.sofa/sofa-jarslink.svg)


Jarslink 2.0 是 [SOFABoot](https://github.com/alipay/sofa-boot) 官方基于 [SOFAArk](https://github.com/alipay/sofa-ark) 开发的功能插件,负责管理多应用在 SOFAArk 容器之上的合并部署,具备如下特性:
Expand Down
20 changes: 20 additions & 0 deletions sofa-jarslink-samples/README.md
@@ -0,0 +1,20 @@
## 简介
SOFA-Jarslink 提供了三个样例工程来演示 Jarslink2.0 使用,工程目录组织如下:
```text
├── spring-boot-transform-sample
├── biz-jvm-invocation-sample
└── biz-health-check-sample
```

### spring-boot-transform-sample
该工程演示了如何快速的将 Spring Boot 工程改造成 SOFABoot 工程。

### biz-jvm-invocation-sample
该工程演示了如何使用 JVM 服务实现跨应用通信。

### biz-health-check-sample
该工程演示了如何集成 SOFABoot 健康检查能力。
1 change: 1 addition & 0 deletions sofa-jarslink-samples/biz-health-check-sample/README.md
@@ -0,0 +1 @@
详细参考[官方文档链接](http://www.sofastack.tech/sofa-boot/docs/sofa-jarslink-jarslink-health-demo)
109 changes: 109 additions & 0 deletions sofa-jarslink-samples/biz-health-check-sample/app-one/pom.xml
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofaboot-dependencies</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>me.qlong.tech</groupId>
<artifactId>app-one</artifactId>
<version>1.0.0</version>

<dependencies>
<!-- 用于 ark-biz 动态管理 -->
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-jarslink-ark-starter</artifactId>
<classifier>ark-plugin</classifier>
<version>2.0.0-SNAPSHOT</version>
</dependency>

<!-- 用于健康检查 -->
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>runtime-sofa-boot-starter</artifactId>
<classifier>ark-plugin</classifier>
</dependency>
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>runtime-sofa-boot-starter</artifactId>
</dependency>

<!-- 用于 IDE 运行或者执行测试用例 -->
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-springboot-starter</artifactId>
</dependency>

<!-- web 应用 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!--health check-->
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>healthcheck-sofa-boot-starter</artifactId>
</dependency>

</dependencies>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-maven-plugin</artifactId>
<executions>
<execution>
<!--goal executed to generate executable-ark-jar -->
<goals>
<goal>repackage</goal>
</goals>

<configuration>
<!--specify destination where executable-ark-jar will be saved, default saved to ${project.build.directory}-->
<outputDirectory>target</outputDirectory>

<!--default none-->
<arkClassifier>executable-ark</arkClassifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.qlong;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @author qilong.zql 18/6/12-下午8:48
*/
@SpringBootApplication
public class AppOneApplication {
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(AppOneApplication.class);
springApplication.run(args);
}
}
@@ -0,0 +1,6 @@
# can't be deleted
spring.application.name=appOne

logging.path=./logs

com.alipay.sofa.boot.skipJvmReferenceHealthCheck=true
94 changes: 94 additions & 0 deletions sofa-jarslink-samples/biz-health-check-sample/app-two/pom.xml
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofaboot-dependencies</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>me.qlong.tech</groupId>
<artifactId>app-two</artifactId>
<version>1.0.0</version>

<dependencies>
<!-- 用于健康检查 -->
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>runtime-sofa-boot-starter</artifactId>
<classifier>ark-plugin</classifier>
</dependency>
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>runtime-sofa-boot-starter</artifactId>
</dependency>

<!--health check-->
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>healthcheck-sofa-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-maven-plugin</artifactId>
<executions>
<execution>
<!--goal executed to generate executable-ark-jar -->
<goals>
<goal>repackage</goal>
</goals>

<configuration>
<attach>true</attach>
<!--specify destination where executable-ark-jar will be saved, default saved to ${project.build.directory}-->
<outputDirectory>target</outputDirectory>

<!--default none-->
<arkClassifier>executable-ark</arkClassifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.qlong.tech.service;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @author qilong.zql 18/6/13-上午11:34
*/
@SpringBootApplication
public class AppTwoApplication {
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(AppTwoApplication.class);
springApplication.run(args);
}
}
@@ -0,0 +1,4 @@
# can't be deleted
spring.application.name=appTwo

logging.path=./logs
39 changes: 39 additions & 0 deletions sofa-jarslink-samples/biz-health-check-sample/pom.xml
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>biz-health-check-sample</artifactId>
<packaging>pom</packaging>
<groupId>me.qlong.tech</groupId>
<version>1.0.0</version>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

</project>
1 change: 1 addition & 0 deletions sofa-jarslink-samples/biz-jvm-invocation-sample/README.md
@@ -0,0 +1 @@
详细参考[官方文档链接](http://www.sofastack.tech/sofa-boot/docs/sofa-jarslink-jarslink-invocation-demo)

0 comments on commit 58c5f3a

Please sign in to comment.