我正在尝试使用 javax.json lib,因此我将其添加到我的 pom.xml 文件中,如下所示:
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
这个在标签内。但是,当我尝试运行我的项目时,执行 run as 然后将目标设置为“package”或“install”,我希望在 Maven 依赖项库中看到 json 库,就像其他库(例如 Junit)一样。但我什么也没看到。因此,如果您知道问题可能出在哪里,请告诉我。
PS:我对 Maven 还很陌生。
编辑:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building RssApp Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ RssApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ RssApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ RssApp ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\trist_000\Eclipse\RssApp\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ RssApp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ RssApp ---
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ RssApp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [RssApp] in [C:\Users\trist_000\Eclipse\RssApp\target\RssApp]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\trist_000\Eclipse\RssApp\src\main\webapp]
[INFO] Webapp assembled in [75 msecs]
[INFO] Building war: C:\Users\trist_000\Eclipse\RssApp\target\RssApp.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.751 s
[INFO] Finished at: 2016-04-27T01:53:10+02:00
[INFO] Final Memory: 10M/119M
[INFO] ------------------------------------------------------------------------
最佳答案
在 Eclipse 中,您必须右键单击该项目并选择“Maven...更新项目”,pom.xml 文件中新添加的库将下载到您的库目录中。
关于java - 使用maven下载javax.json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36877870/