Maven 1.x Hibernate Plugin

plugin:test fails without a network connection

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.3
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

hibernate:aggregate-mappings:
[echo] Aggregating multiple hibernate mapping into one single file
Adding base dir: C:\source\maven-plugins\hibernate\src\plugin-test\target\classes
Adding base dir: C:\source\maven-plugins\hibernate\src\plugin-test\src\etc
Aggregating to C:\source\maven-plugins\hibernate\src\plugin-test/target/schema/aggregated-mappings.hbm.xml

BUILD FAILED
File...... C:\Documents and Settings\Dion Gillard\.maven\cache\maven-plugin-plugin-1.5.2-SNAPSHOT\plugin.jelly
Element... maven:maven
Line...... 314
Column.... 34
Unable to obtain goal [test-hibernate-aggregate-mappings] – C:\Documents and Settings\Dion Gillard\.maven\cache\maven-hibernate-plu
gin-1.2-SNAPSHOT\plugin.jelly:38:53: <h:aggregate-mappings> Mapping aggreagtion failed: hibernate.sourceforge.net Nested exception:
hibernate.sourceforge.net
Total time: 5 seconds
Finished at: Mon Jul 19 01:28:37 EST 2004

If I have a net connection, all is fine.

Activity

Hide
David Eric Pugh added a comment -

The test fails because the plugin attempts (I think) to validate the xml against the DTD.. I am somewhat inclined to not fix this, but instead try and make the test smarter, so it doesn't run when in offline mode. Did you run the test with the offline mode switch on? Or where you just running it not connected to the internet?

Show
David Eric Pugh added a comment - The test fails because the plugin attempts (I think) to validate the xml against the DTD.. I am somewhat inclined to not fix this, but instead try and make the test smarter, so it doesn't run when in offline mode. Did you run the test with the offline mode switch on? Or where you just running it not connected to the internet?
Hide
dion gillard added a comment -

I only ran it not connected.

For the J2EE ones, we use a custom entity resolver....Check out the ear plugin for an example

Show
dion gillard added a comment - I only ran it not connected. For the J2EE ones, we use a custom entity resolver....Check out the ear plugin for an example
Hide
David Eric Pugh added a comment -

Dion,

I took your advice and looked at the ear plugin.. Actually, found all the EntityResolver stuff in the j2ee plugin. At any rate, I added a HibernateEntityResolver etc... I think I configured everything, however I am still getting failures when not connected to the network. The HibernateEntityResolver is called, and everything looks good, but still trying to connect to hibernate.sourceforge.net.

Could you run the unit test "test-hibernate-aggregate-mappings" in plugin-test for Hibernate and give me your opinon..? I swear everything is configured properly in the MappingsAggregatorBean, but no joy!:

XMLWriter writer = new XMLWriter(new FileWriter(f), format);
writer.setEntityResolver(new HibernateEntityResolver());
//writer.setResolveEntityRefs(false);
Document finalDoc = DocumentHelper.createDocument();
Element rootHM = null;
for(int i = 0; i < files.length; i++)
{
SAXReader reader = new SAXReader(false);
reader.setEntityResolver(new HibernateEntityResolver());

Show
David Eric Pugh added a comment - Dion, I took your advice and looked at the ear plugin.. Actually, found all the EntityResolver stuff in the j2ee plugin. At any rate, I added a HibernateEntityResolver etc... I think I configured everything, however I am still getting failures when not connected to the network. The HibernateEntityResolver is called, and everything looks good, but still trying to connect to hibernate.sourceforge.net. Could you run the unit test "test-hibernate-aggregate-mappings" in plugin-test for Hibernate and give me your opinon..? I swear everything is configured properly in the MappingsAggregatorBean, but no joy!: XMLWriter writer = new XMLWriter(new FileWriter(f), format); writer.setEntityResolver(new HibernateEntityResolver()); //writer.setResolveEntityRefs(false); Document finalDoc = DocumentHelper.createDocument(); Element rootHM = null; for(int i = 0; i < files.length; i++) { SAXReader reader = new SAXReader(false); reader.setEntityResolver(new HibernateEntityResolver());
Hide
David Eric Pugh added a comment -

Fixed.. as long as you run with maven -o option.

Show
David Eric Pugh added a comment - Fixed.. as long as you run with maven -o option.
Hide
John Hogan added a comment -

This same bug is back in Maven 2. Things like hibernate do not work in offline mode because of attempted dtd resolution at hibernate.sourceforge.net, ughh

Show
John Hogan added a comment - This same bug is back in Maven 2. Things like hibernate do not work in offline mode because of attempted dtd resolution at hibernate.sourceforge.net, ughh

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: