persistence.xml's jar-file setting is misinterpreted
----------------------------------------------------

                 Key: MHIBERNATE-117
                 URL: http://jira.codehaus.org/browse/MHIBERNATE-117
             Project: Maven 2.x Hibernate Plugin
          Issue Type: Bug
          Components: hbm2ddl
    Affects Versions: 2.2
         Environment: WinXP, Maven 2.2.1
            Reporter: Stefan Schilling
            Assignee: Johann Reyes


I have the following project setup:
MainProject (consists of several sub projects)
-> Model1
-> Model2
-> Model3
-> EJB
----> src/main/resources/META-INF
----------> persistence.xml (references Model1-3 via <jar-file>)
----> target/EJB
-> EAR
----> target
----------> MainProject (the .ear file's name)
--------------> lib
-----------------------> Model1.jar
-----------------------> Model2.jar
-----------------------> Model3.jar
----------> ejb.jar
--------------> META-INF
-----------------------> persistence.xml (references Model1-3 via <jar-file>)
----> pom.xml

Due to the flexibility required here, the EJB project's Java / Maven part knows 
about Model1 (not Model2-3) only. Therefore, the hibernate tools are configured 
in the EAR pom.xml (as there are all Model.jars available). Using the plugin 
configuration below, the plugin scans the EAR's target directory, finds the 
persistence.xml and reads the <jar-file> setting. As the ear file is to be 
deployed on an AppServer, the Model jars are referenced as "../lib/Model1.jar" 
(../lib/Model2.jar, ../lib/Model3.jar).

Sadly, the plugin misinterprets that path definition. It is not starting at the 
persistence.xml's location, but in the folder the pom.xml was found. It 
therefore expects the Model.jars to be located at MainProject/lib/Model1-3.jar 
(which is: ear pom.xml and then cd ../lib).

As a fix, I would probably introduce an optional parameter, which allows the 
user to provide the starting folder for the jar search. Alternatively, have it 
start at the persistence.xml's location by default.

Please do not hesitate to ask for any further detauls.

Thanks in advance for your support.

Stefan

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to