I have a project that uses "system" scope to specify a jar file included in my project's WEB-INF/lib
dir. This artifact is not in any of the maven repositories, so I must include it as part of my project. I do so with the following:
<dependency>
<groupId>com.example</groupId>
<artifactId>MySpecialLib</artifactId>
<version>1.2</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/MySpecialLib-1.2.jar</systemPath>
</dependency>
This has worked great for most things.
But now I'm trying to run some code on the command line (outside of my webapp, via a main()
method I have added) and mvn exec:java
can't resolve code in MySpecialLib because it's not included in the "runtime" classpath.
How can I either:
- add MySpecialLib to the runtime classpath
or
- tell
mvn exec:java
to also use the system
classpath ?
I've tried mvn exec:java -Dexec.classpathScope=system
, but that leaves off everything that's on runtime
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…