When the agent is run outside of a git repository, it fails when trying to collect metadata:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
at com.appland.shade.org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:636)
at com.appland.shade.org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:600)
at com.appland.shade.org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:55)
at com.appland.appmap.util.GitUtil.open(GitUtil.java:65)
at com.appland.appmap.util.GitUtil.open(GitUtil.java:53)
at com.appland.appmap.util.GitUtil.findSourceRoots(GitUtil.java:158)
at com.appland.appmap.Agent.premain(Agent.java:63)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed
When the agent is run outside of a git repository, it fails when trying to collect metadata: