You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a sample code on how I'm trying to use "node-java-maven"
#!/usr/bin/env node
constjava=require('java');constmvn=require('node-java-maven');java.asyncOptions={asyncSuffix: undefined,syncSuffix: "",promiseSuffix: "Promise",promisify: require('util').promisify};mvn(function(err,mvnResults){if(err){returnconsole.error('could not resolve maven dependencies',err);}mvnResults.classpath.forEach(function(c){console.log('adding '+c+' to classpath');java.classpath.push(c);});// My code to work with java jars goes here. Works fine!!});// But any usage of the java jars outside mvn() fails. !!!
The issue here is if I need to write unit/jest tests for my functions written within mvn() they would fail because the java dependencies are valid only within mvn(). I see that mvn() executes at the very end making it impossible to refer to the java jar imports anywhere outside mvn().
Can you please share the right way to use "Node-java-maven" so that the java.classpath pushed within mvn() is available globally?
The text was updated successfully, but these errors were encountered:
Here is a sample code on how I'm trying to use "node-java-maven"
The issue here is if I need to write unit/jest tests for my functions written within mvn() they would fail because the java dependencies are valid only within mvn(). I see that mvn() executes at the very end making it impossible to refer to the java jar imports anywhere outside mvn().
Can you please share the right way to use "Node-java-maven" so that the java.classpath pushed within mvn() is available globally?
The text was updated successfully, but these errors were encountered: