Skip to content
Discussion options

You must be logged in to vote

hi! When you use JavaTemplate, or when you provide test text blocks, those are snippets get compiled in complete isolation from your project classpath. This is to allow multiple major versions of libraries to be used within a single recipe module, but does then indeed require that you construct a JavaParser, and provide it with the entries it should place on the classpath (and any imports) when you compile the provided snippets.

For your tests the above pattern already looks correct to me (maybe add a version suffix such as tupstdmid-log-api-1); for your main code you'll similarly want to use classpathFromResources but provide it with the ExecutionContext instance that's already passed in…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mensinda
Comment options

@timtebeek
Comment options

@mensinda
Comment options

@timtebeek
Comment options

@mensinda
Comment options

Answer selected by timtebeek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants