Hi,
I've got a simple transformation that take ModelA.uml in input and
ModelB.uml in output
ModelA.uml uses sterotypes from a profile 'Test.profile.uml'
Here is what I do in my program to register the resources.
------------------------8<------------------------
ResourceSet resourceSet = ASMEMFModel.getResourceSet();
resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
UMLPackage.eINSTANCE);
// Profile registration
resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
UMLPackage.eINSTANCE);
URI uri =
URI.createURI("jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/ATL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v200805131030.jar!/");
Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
uRIMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uRIMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uRIMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
------------------------8<-------------------------
I've got a Java project from which I launch programatically the
transformation.
And I've got an ATL project where are located my models, profile, and my
transformation.
Now the problem is that when I launch (programmatically) my
transformation, I obtain this error :
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
(file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspace/LaunchAtlUml/A,
23, 93)
EMF is looking for the profile in my Java project. If I put it there, it
works fine.
But I would like to keep my profile in my Transformation project.
I suppose I can do that with the URIConverter or something like that.
Any idea ?