Community
Participate
Working Groups
Versions: * Eclipse Kepler Service Release 1 * m2e - Maven Integration for Eclipse 1.4.0.20130601-0317 * m2e-wtp - JPA configurator for WTP 1.0.1.e43-20130911-1546 * m2e-wtp - Maven Integration for WTP 1.0.1.20130911-1545 Example persistence.xml: <persistence> <persistence-unit> ... <jar-file>some-jar-${some.version}.jar</jar-file> ... </persistence-unit> </persistence> Error: Type: JPA Problem Description: JAR file "some-jar-${some.version}.jar" cannot be resolved persistence.xml
Can you please attach a sample project reproducing the error? Also do you see an error if the filename is hardcoded?
I can't add a sample project at this time. I'd need to create a dummy project and I just don't have time right at the moment. I might be able to get to that soon, but I suspect you will need that on your side. Adding a specific version doesn't seem to help.
Does the target file correspond to an open project? I suspect there might be 2 bugs here : - the filtered version of the persistence.xml isn't used by Dali (WTP's JPA support). I guess this is a resource locator issue on the m2e-jpa side - Dali doesn't support <jar-file> resolution somehow. We'll still need a sample project anyway
cc'ing Neil Hauge of Dali's fame, who might have some ideas
(In reply to Fred Bricon from comment #3) > Does the target file correspond to an open project? > > I suspect there might be 2 bugs here : > - the filtered version of the persistence.xml isn't used by Dali (WTP's JPA > support). I guess this is a resource locator issue on the m2e-jpa side > - Dali doesn't support <jar-file> resolution somehow. > > We'll still need a sample project anyway Currently Dali doesn't support resource filtering, so that is likely the issue. We do support jar-file resolution, but not one with variables.
@Fred - re: 2 bugs. Yes I agree, I tried a maven filter var and one w/o the filter var. Neither one seems to work.
@Neil - is this on the roadmap? ETA? If not, can this be added? Thanks - M
Neil, if m2e-jpa provides the filtered persistence.xml via a resource locator, would that be enough? I'm not sure as I suspect the marker is applied to the non-filtered file being edited. The fact a non-filtered version doesn't find the jar makes me think there might be an issue with Dali's jar file resolution anyway.
Ah, missed that comment about a specific version not helping. You may need to do a project clean after adding a jar in order to specify the jar-file. Try a hardcoded example and a project clean after adding the jar and the jar-file ref to see if that clears up the warning. jar-file refs are a deployment time concept, so there are cases where it would not resolve at design-time, but we try to cast a wide net to resolve it. I would think a resource locator that provides the resolved persistence.xml would be sufficient to fix the filtering issue. I'll try to verify.
When I changed to a non-variable I am still having the same problem: JAR file "some-jar-2.1.8-SNAPSHOT.jar" cannot be resolved. Just to be sure, some-jar-2.1.8-SNAPSHOT.jar is showing up under Maven Dependencies. The problem happens in both of these scenarios: 1) Project reference (I have the some-jar project loaded in Eclipse) and the Maven Dependency is referencing the project 2) JAR reference - closing the some-jar project and pulling the JAR from maven repo
Oh and sorry, yes, I do a Clean each time I make a change, still doesn't work.
(In reply to Marcus Malcom from comment #11) > Oh and sorry, yes, I do a Clean each time I make a change, still doesn't > work. In that case the JAR must not be getting picked up as a JPA file in our project scan. That would indicate a deeper issue. A JPA file is found by visiting all the resources in an IProject. It then has to pass a number of tests, including: - is it a java related file - javaProject isOnClassPath() answers true - the fileResourceLocationIsVaid (this is a ResourceLocator implemented method and may be where the problem is occurring?) This logic is found in AbstractJpaProject.addJpaFileMaybe_(IFile).
Is there anything I can do on my side? The project/jar should adhere to those contraints ... not sure what fileResourceLocationIsVaid is all about.
(In reply to Marcus Malcom from comment #13) > Is there anything I can do on my side? The project/jar should adhere to > those contraints ... not sure what fileResourceLocationIsVaid is all about. I don't think so. I think the custom ResourceLocator is going to have to change to support this Maven related requirement
This is still happening on Eclipse Mars However, I don't think Dali should try to do any resource filtering. However, it should read the Deployment Assembly and process it based on the "deployed" version rather than the source version.