【发布时间】:2021-06-28 15:09:44
【问题描述】:
我正在制作一个使用基于属性的加密的 Spring Boot 应用程序,并且在本地一切正常。但是,由于我使用的库在 maven 存储库中不可用,我通过直接引用 jar 将它添加到我的 pom 中。但是,当我部署到 GAE 并尝试使用它时,我得到了错误:
java.lang.ClassNotFoundException: co.junwei.bswabe.SerializeUtils
不知道为什么在我构建我的应用程序 .jar 时没有包含它,任何帮助将不胜感激。 我的 pom 看起来像这样:
<dependencies>
<dependency>
<groupId>it.unisa.dia.gas</groupId>
<artifactId>jpbc-api</artifactId>
<version>1.2.1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/jpbc-api-1.2.1.jar</systemPath>
</dependency>
<dependency>
<groupId>it.unisa.dia.gas</groupId>
<artifactId>jpbc-plaf</artifactId>
<version>1.2.1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/jpbc-plaf-1.2.1.jar</systemPath>
</dependency>
<dependency>
<groupId>co.junwei.cpabe</groupId>
<artifactId>cpabe-api</artifactId>
<version>1.0.2</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/cpabe-api-1.0.2.jar</systemPath>
</dependency>
</dependencies>
我确实知道在 maven 中使用 systemPath 已被弃用,但不确定我可以使用什么来代替它。我尝试使用此处列出的内容:https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html 但是,这只是在尝试本地运行时导致此错误:
java.lang.Error: Unresolved compilation problems:
BswabePub cannot be resolved to a type
SerializeUtils cannot be resolved
BswabePrv cannot be resolved to a type
SerializeUtils cannot be resolved
【问题讨论】:
标签: java maven google-app-engine dependency-management