[英]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.