繁体   English   中英

HyperJaxb3项目中发生了什么?

[英]What's happening in HyperJaxb3 project?

我知道Hyperjaxb3库对于我的项目将非常有用,阅读了多个站点的几个描述,并决定将其嵌入到Spring-Hibernate项目中。

我发现到Hyperjaxb3参考https://jaxb.java.net/ ,这看起来很正式,但超链接- http://confluence.highsource.org/display/HJ3/Home -不开。

我找到了一些旧的POM示例,将其包含到我的项目中,并找到了一些旧版本的引用,试图消除它们,但是现在看来,我碰到了对旧Hibernate版本的依赖,错误就像这个:

java.util.ServiceConfigurationError:com.sun.tools.xjc.Plugin:提供者org.jvnet.hyperjaxb3.hibernate.plugin.HibernatePlugin无法实例化:java.lang.NoClassDefFoundError:org / hibernate / type / MutableType

我想知道是否有更好的Maven条目,项目是否还在运行以及如何与现代的Hibernate一起使用。

这是我关于Hyperjaxb3的pom摘录,其中排除了一些过时的链接并指定了其他依赖项的最新版本:

    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>${jaxb-version}</version>
    </dependency>        
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-xjc</artifactId>
        <version>${jaxb-version}</version>
    </dependency>  
    <!--<dependency>
        <groupId>org.jvnet.hyperjaxb3</groupId>
        <artifactId>hyperjaxb3</artifactId>
        <version>0.6.1</version>
    </dependency>        -->
    <dependency>
        <groupId>org.jvnet.hyperjaxb3</groupId>
        <artifactId>hyperjaxb3-hibernate-plugin</artifactId>
        <version>0.1</version>
        <exclusions>
            <exclusion>
                <groupId>hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
            </exclusion>
            <exclusion>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
            </exclusion>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
            <exclusion>
                <groupId>net.sf.saxon</groupId>
                <artifactId>saxon</artifactId>
            </exclusion>
            <exclusion>
                <groupId>net.sf.saxon</groupId>
                <artifactId>saxon-dom</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-xjc</artifactId>
            </exclusion>
        </exclusions>
    </dependency>  
    <dependency>
        <groupId>asm</groupId>
        <artifactId>asm</artifactId>
        <version>3.3.1</version>
    </dependency>
    <dependency>
        <groupId>asm</groupId>
        <artifactId>asm-attrs</artifactId>
        <version>2.2.3</version>
    </dependency>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>3.2.1</version>
    </dependency>

    <dependency>
        <groupId>commons-beanutils</groupId>   
        <artifactId>commons-beanutils</artifactId>
        <version>1.9.2</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>   
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>commons-logging</groupId>   
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>

我目前不是在尝试生成带注释的Hibernate实体类,而是从PurchaseOdrer示例生成POJO。 这是我目前正在做的事情:

public void initializeModel(String name, InputStream src, String dir) throws IOException, URISyntaxException{
    dir = Paths.get(new URL(dir).toURI()).toString();
    File directory = new File(dir);
    directory.mkdirs();

    SchemaCompiler sc = XJC.createSchemaCompiler();
    sc.setDefaultPackageName(this.getClass().getPackage().getName() + ".generated");

    InputSource is = new InputSource(src);
    is.setSystemId(name);

    sc.parseSchema(is);
    S2JJAXBModel model = sc.bind();
    JCodeModel codeModel = model.generateCode(null, null);

    CodeWriter cw = new FileCodeWriter(directory);        
    codeModel.build(cw);
}

免责声明:我是Hyperjaxb3的作者。

该项目托管在GitHub上:

最新版本0.6.1可以正常运行。

但是,我不再积极开发它。

它可以与当前的休眠版本一起使用吗?

版本0.6.1的作品已在Hibernate 4.1.7中进行了测试。 HJ3只是一个代码生成器,可生成标准的JPA注释类。 因此,它很可能与最新版本的Hibernate一起使用。

我只是无法从Maven获得0.6.1的罐子。 似乎它已从Maven存储库中删除。

真? 还在那里。

http://repo1.maven.org/maven2/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-plugin/0.6.1/

我不知道我是否需要从2011年开始使用的“ hyperjaxb3-hibernate-plugin” 0.1。

你绝对不会。

还是您知道任何叉子或类似物?

不幸的是,没有什么可以接近的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM