Fortify Sourceanalyzer - 分析 XWiki 时缺少 java 类

发布于 2024-07-29 00:55:49 字数 220 浏览 7 评论 0原文

缺少的类是com.xpn.xwiki.test.AbstractXWikiComponentTestCase。 这是唯一无法解决的类。 我跑了:

mvn包

然后我尝试使用 sourceanalyzer 进行构建,这是唯一找不到的类。 我不明白为什么 mvn package 不会为我得到这个。

The missing class is com.xpn.xwiki.test.AbstractXWikiComponentTestCase. This is the only class that cannot be resolved. I have run:

mvn package

Then I have tried to build with sourceanalyzer and this is the only class that cannot be found. I do not understand why mvn package would not have gotten this for me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兮颜 2024-08-05 00:55:49

如果您在使用 Fortify SCA Maven2 插件构建时缺少依赖项,则应该尝试“安装”目标而不是“打包”目标。

“安装”将依赖项放入您的存储库中。 Fortify SCA Maven2 插件在存储库中查找依赖项。

我希望这有帮助! 请告诉我们。

If you're getting missed dependencies when building with the Fortify SCA Maven2 plugin, you should try the "install" goal instead of the "package" goal.

"install" puts the dependencies into your repository. The Fortify SCA Maven2 Plugin looks in the repository for dependencies.

I hope this helps! Please let us know.

小红帽 2024-08-05 00:55:49

看起来你缺少一个罐子。 您是否在构建之前看到任何尝试下载依赖项的行?

XWiki jar 不托管在中心,但您可以使用如下配置将 XWiki 存储库添加到您的 pom 中:

<repositories>
  <repository>
    <id>xwiki-releases</id>
    <name>XWiki Maven2 Remote Repository for Releases</name>
    <url>http://maven.xwiki.org/releases</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>

添加该配置后,Maven 应该下载所有必需的依赖项。 如果仍然没有,您可以将缺少的依赖项显式添加到 POM 中:

<dependencies>
  ...
  <dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-core-shared-tests</artifactId>
    <version>??</version>
    <scope>test<!--assume this is just for tests, if not omit the scope declaration--></scope>
  </dependency>
</dependencies>

Looks like you're missing a jar. did you see any lines earlier in the build attempting to download dependencies?

The XWiki jars aren't hosted on central, but you can add the XWiki repository to your pom using configuration like this:

<repositories>
  <repository>
    <id>xwiki-releases</id>
    <name>XWiki Maven2 Remote Repository for Releases</name>
    <url>http://maven.xwiki.org/releases</url>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
  </repository>
</repositories>

Once that configuration is added, Maven should download all the required dependencies. If it still doesn't, you can explicitly add the missing dependency to your POM:

<dependencies>
  ...
  <dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-core-shared-tests</artifactId>
    <version>??</version>
    <scope>test<!--assume this is just for tests, if not omit the scope declaration--></scope>
  </dependency>
</dependencies>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文