用 IKVM 把 xxl-sso-core 打包成 dll

准备工作:
1、下载MAVEN(这里用到的是V3.6.3),解压后把bin目录配置到环境变量;
2、下载IKVM(这里用到的是ikvmbin-8.1.5717.0.zip),解压后把bin目录配置到环境变量;
3、安装JDk1.8;
4、下载 xxl-sso-v1.1.0,解压后得到 xxl-sso-core 项目;

开始:
1、修改 pom.xml,添加 slf4j-simple、cglib 的引用,添加 build 节点用于mvn打包。
slf4j-simple 处理提示: Failed to load class "org.slf4j.impl.StaticLoggerBinder" 或者 warning IKVMC0100: Class "org.slf4j.impl.StaticLoggerBinder" not found ;
cglib 处理提示: warning IKVMC0100: Class "net.sf.cglib.proxy.MethodInterceptor" not found 。

<?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>
    <parent>
        <groupId>com.xuxueli</groupId>
        <artifactId>xxl-sso</artifactId>
        <version>1.1.0</version>
    </parent>
    <artifactId>xxl-sso-core</artifactId>
    <packaging>jar</packaging>

    <dependencies>

        <!-- servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${javax.servlet-api.version}</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>3.2.4</version>
        </dependency>
        <!-- slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j-api.version}</version>
        </dependency>
        <!-- jedis -->
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>${jedis.version}</version>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.xxl.sso.core.util.JedisUtil</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

2、在 xxl-sso-core 项目目录打开CMD窗口,执行以下命令,在 target 目录会生成 xxl-sso-core-1.1.0-jar-with-dependencies.jar 。

mvn assembly:assembly

3、在 xxl-sso-core 的 target 目录打开CMD窗口,执行以下命令,同目录下生成 xxl-sso-core-1.1.0-jar-with-dependencies.dll,大功告成。

ikvmc -target:library xxl-sso-core-1.1.0-jar-with-dependencies.jar

参考文章:
https://blog.csdn.net/a748448660/article/details/81776193
https://www.cnblogs.com/tuifeideyouran/p/5277893.html
https://blog.csdn.net/u010696630/article/details/84991116
https://stackoverflow.com/questions/40203004/java-class-not-found-net-sf-cglib-proxy-methodinterceptor

IKVM

我来吐槽

*

*