Coder Social home page Coder Social logo

XBoot.encrypt 方法执行完之后springboot 依赖的lib下面的jar并没有什么变化 ,而且新生成的jar springboot启动不了了 about xjar HOT 31 OPEN

core-lib avatar core-lib commented on July 23, 2024
XBoot.encrypt 方法执行完之后springboot 依赖的lib下面的jar并没有什么变化 ,而且新生成的jar springboot启动不了了

from xjar.

Comments (31)

core-lib avatar core-lib commented on July 23, 2024

能粘贴上加密的代码吗

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

image

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

Video-1.0-SNAPSHOT.jar是我springboot 子模块的jar

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

image

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

是我使用方式不对还是咱们项目中代码的问题?需要你帮我确定一下

from xjar.

core-lib avatar core-lib commented on July 23, 2024

图片看不到

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

public static void main(String[] args) {

    try {

        XBoot.encrypt("/Users/dapeng/IdeaProjects/backend/Application/target/Application-1.0-SNAPSHOT.jar",
                "/Users/dapeng/IdeaProjects/backend/Application/target/test.jar",
                "123",
                new XJarAntEntryFilter("BOOT-INF/lib/Video-1.0-SNAPSHOT.jar"));

    } catch (Exception e) {
        e.printStackTrace();
    }


}

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

我这图片能显示啊,我用的chrom

from xjar.

core-lib avatar core-lib commented on July 23, 2024

你用的版本是多少

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

Google Chrome 版本 71.0.3578.98

springboot 1.5.9.RELEASE

from xjar.

core-lib avatar core-lib commented on July 23, 2024

XJar 的版本

from xjar.

845999248 avatar 845999248 commented on July 23, 2024
com.github.core-lib xjar v1.1.0

com.github.core-lib
xjar-maven-plugin
v1.0.6

from xjar.

core-lib avatar core-lib commented on July 23, 2024

我测试下

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

好的

from xjar.

core-lib avatar core-lib commented on July 23, 2024

你更新到 v1.1.1

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

好的,我试试

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

可以了,这种直接运行单独的程序方式可以对springboot+jpa加密打包 ,问题#4 是用插件打的,有好的办法解决吗

from xjar.

core-lib avatar core-lib commented on July 23, 2024

JPA的问题和XJar的使用方式无关,用插件打包其内部实际上也是调用 XBoot 来加密。
JPA的问题是它自己去解析 Spring 的 FatJar 所以只能修改它的源码来适配加密后的Spring FatJar

from xjar.

core-lib avatar core-lib commented on July 23, 2024

如果你用上面的代码加密没问题 那用最新的插件也是没问题 你试下更新插件到1.0.7

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

好的,如果JPA的问题没有好的解决方式,那我是不是可以在maven打包之后 执行一下那个单独加密方法,在pom里面是可以执行脚本的吧?

from xjar.

core-lib avatar core-lib commented on July 23, 2024

你确定你的项目用了 JPA 吗? 如果用了JPA应该是无法加密启动才对的。

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

我确实用了jpa,成功生成xjar了,但是启动的时候 while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.boot.archive.spi.ArchiveException: Could not build ClassFile

from xjar.

core-lib avatar core-lib commented on July 23, 2024

嗯嗯 那这样的确是成功加密了 只是JPA无法解析加密后的class,目前可能的解决办法就是我提供一个改过源码的JPA包

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

非常感谢您能及时修复问题 ,并且及时回答我的疑惑

from xjar.

core-lib avatar core-lib commented on July 23, 2024

必须的

from xjar.

core-lib avatar core-lib commented on July 23, 2024

我找到了不修改JPA源码的方式支持 JPA 你要不要试下

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

你已经提交新的版本了吗?关于jpa这个问题

from xjar.

core-lib avatar core-lib commented on July 23, 2024

image
采用 JVMTI 的方式来实现

from xjar.

core-lib avatar core-lib commented on July 23, 2024

你看下 README 中间关于这个问题的描述,我也是昨天才上传这个问题的解决方案,我测试没有问题,应该对你也是通用的,你可以测试下。

from xjar.

845999248 avatar 845999248 commented on July 23, 2024

我简单测试了一下 启动没问题

from xjar.

core-lib avatar core-lib commented on July 23, 2024

那就是可以适配 JPA(Hibernate) 的问题是吧

from xjar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.