AnsweredAssumed Answered

replacing resources in sdk during runtime

Question asked by qwertz on Jul 5, 2017

Hey!

 

I am currently working on a JAR module that contains an html file transformer.html which is used by a custom java transformer. The goal is that once the JAR Module is deployed to the real server the file transformer.html can be replaced with a new version without restarting the server. I have placed transformer.html under src/main/resources/alfresco/extension and I load the file in the code of my transformer with an Inputstream from the classpath:

this.getClass().getClassLoader().getResourceAsStream("alfresco/extension/transformer.html")

 

I would like to test this scenario in my local sdk, so I have placed a new transformer.html (with some changes) under src/test/resources/alfresco/extension which then gets copied to target/test-classes/alfresco/extension when I start the sdk project.

 

Now to the problem: My transformer always loads the transformer.html I've placed in src/main/resources/alfresco/extension/ (which is contained in the created JAR module in the target/ directory at runtime).

 

I made this module under the assumption that files located under src/test/resources/alfresco/extension/ are earlier in the classpath an therefore are loaded instead of files that are located under src/main/resources/alfresco/extension.

 

Does anyone have a suggestion how I can test the replacement of transformer.html in my sdk?

Outcomes