Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
using ark plugin for all adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjing2 committed Dec 28, 2023
1 parent d21d65f commit 5849833
Show file tree
Hide file tree
Showing 11 changed files with 426 additions and 356 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
spring.application.name=biz2

logging.file.path=./web/tomcat/logs
logging.path=./web/tomcat/logs
logging.path=./web/tomcat/logs
2 changes: 1 addition & 1 deletion sofa-serverless-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<packaging>pom</packaging>

<properties>
<revision>0.5.5</revision>
<revision>0.5.6-SNAPSHOT</revision>
<sofa.ark.version>2.2.5</sofa.ark.version>
<spring.boot.version>2.7.15</spring.boot.version>
<logback.core>1.2.9</logback.core>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
<artifactId>sofa-ark-spi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -76,4 +71,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,47 @@
<version>2.6.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-spi</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
<build>
<plugins>
<plugin>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-plugin-maven-plugin</artifactId>
<version>${sofa.ark.version}</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>ark-plugin</goal>
</goals>

<configuration>
<activator>
com.alipay.sofa.serverless.adapter.Dubbo26AdapterActivator
</activator>
<exported>
<mode>override</mode>
<packages>
<package>com.alibaba.dubbo.common</package>
<package>com.alibaba.dubbo.config.spring.extension</package>
<package>com.alibaba.dubbo.rpc.protocol.dubbo</package>
</packages>
</exported>
<excludes>
<exclude>*:*:*</exclude>
<exclude>com.alipay.sofa.serverless:sofa-serverless-adapter-dubbo2.6</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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 com.alipay.sofa.serverless.adapter;

import com.alipay.sofa.ark.spi.model.PluginContext;
import com.alipay.sofa.ark.spi.service.PluginActivator;

/**
* @author lvjing2
* @since 0.5.5
*/
public class Dubbo26AdapterActivator implements PluginActivator {
@Override
public void start(PluginContext context) {
}

@Override
public void stop(PluginContext context) {
// no op
}
}
Original file line number Diff line number Diff line change
@@ -1,73 +1,75 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.alipay.sofa.serverless</groupId>
<artifactId>sofa-serverless-adapter-ext</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sofa-serverless-adapter-log4j2</artifactId>
<version>${revision}</version>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.alipay.sofa.serverless</groupId>
<artifactId>sofa-serverless-adapter-ext</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>sofa-serverless-adapter-log4j2</artifactId>
<version>${revision}</version>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring.boot.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>${spring.boot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>android-json</artifactId>
<groupId>com.vaadin.external.google</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.16.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>juint</groupId>
<artifactId>junit-dep</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring.boot.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>${spring.boot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-spi</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-ark-plugin-maven-plugin</artifactId>
<version>${sofa.ark.version}</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>ark-plugin</goal>
</goals>

<configuration>
<activator>
com.alipay.sofa.serverless.adapter.Log4j2AdapterActivator
</activator>
<exported>
<mode>override</mode>
<classes>
<class>
org.springframework.boot.logging.log4j2.Log4J2LoggingSystem
</class>
</classes>
</exported>
<excludes>
<exclude>*:*:*</exclude>
<exclude>com.alipay.sofa.serverless:sofa-serverless-adapter-log4j2</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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 com.alipay.sofa.serverless.adapter;

import com.alipay.sofa.ark.spi.model.PluginContext;
import com.alipay.sofa.ark.spi.service.PluginActivator;

/**
* @author lvjing2
* @since 0.5.5
*/
public class Log4j2AdapterActivator implements PluginActivator {
@Override
public void start(PluginContext context) {
}

@Override
public void stop(PluginContext context) {
// no op
}
}
Loading

0 comments on commit 5849833

Please sign in to comment.