jqassistant-plugin / jqassistant-context-mapper-plugin

@contextmapper integration for jQAssistant to scan and create Context Maps to validate as-is against to-be architecture
GNU General Public License v3.0
0 stars 1 forks source link

The plugin is not able to scan .cml files if they are provided through an url. #4

Open morpfl opened 10 months ago

morpfl commented 10 months ago

If a context map (.cml) is provided through a jQA-Plugin, it has to be included in the scanning process via the urls section as shown below.

jqassistant:
  plugins:
    - group-id: org.jqassistant.plugin
      artifact-id: jqassistant-context-mapper-plugin
      version: 2.0.0
  scan:
    include:
      urls:
        - jqassistant-plugin:context-map.cml

The configuration leads to the following error occuring during the scanning process:

Caused by: java.lang.RuntimeException: Cannot create a resource for 'file:/C:/Users/PF8CBF~1/AppData/Local/Temp/jqassistant-2851799196885517408.tmp'; a registered resource factory is needed
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource (ResourceSetImpl.java:403)
    at org.contextmapper.dsl.standalone.StandaloneContextMapper.loadCML (StandaloneContextMapper.java:51)
    at org.jqassistant.plugin.contextmapper.ContextMapperScannerPlugin.scan (ContextMapperScannerPlugin.java:41)
    at org.jqassistant.plugin.contextmapper.ContextMapperScannerPlugin.scan (ContextMapperScannerPlugin.java:27)

The error does not occur, if the .cml file is loaded as a direct file reference.

DirkMahler commented 8 months ago

The issue is that the StandaloneContextMapper requires a file with a .cml extensions whereas the file from the plugin is provided by the jQA core as a .tmp file. The proposed solution is that the latter should preserve the file name when extracting it from a ZIP file.

DirkMahler commented 8 months ago

Created issue in jQA core: https://github.com/jQAssistant/jqa-core-framework/issues/97