jetty-all 源 jar (9.3)

jetty-all source jar (9.3)

从 Jetty 9.2.x 迁移到 9.3.x 我再也找不到 jetty-all-9.2.9.v20150224-sources.jar ( https://repo1.maven.org/maven2/org/eclipse/jetty/aggregate/jetty-all/9.2.19.v20160908/ ) 9.3.x

有没有办法为 9.3.x 检索这样的 JAR?

谢谢。

首先,请参阅之前关于 jetty-all 的回答。

知道 jetty-all-*.jar 用于码头文档中的命令行示例。

如果您在项目或构建中使用了 jetty-all-*.jar 的任何变体,那么您的使用不正确。

如果您在构建中使用 jetty-all <dependency>,那么您的构建当前正在使用来自 pom 声明坐标的各个下游依赖项。这些依赖项中的每一个都有自己的 sources 分类附加工件(并且 javadoc 也分类)供您下载和访问源代码。

示例 Maven 项目 pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.test</groupId>
    <artifactId>jetty-all-demo</artifactId>
    <version>1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty.aggregate</groupId>
            <artifactId>jetty-all</artifactId>
            <version>9.3.11.v20160721</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</project>

这将产生以下依赖项列表

$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jetty-all-demo 1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ jetty-all-demo ---
[INFO] com.test:jetty-all-demo:jar:1-SNAPSHOT
[INFO] \- org.eclipse.jetty.aggregate:jetty-all:pom:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-client:jar:9.3.11.v20160721:compile
[INFO]    |  +- org.eclipse.jetty:jetty-http:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty:jetty-io:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-deploy:jar:9.3.11.v20160721:compile
[INFO]    |  +- org.eclipse.jetty:jetty-webapp:jar:9.3.11.v20160721:compile
[INFO]    |  |  \- org.eclipse.jetty:jetty-servlet:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty:jetty-xml:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-jmx:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-plus:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-annotations:jar:9.3.11.v20160721:compile
[INFO]    |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO]    |  +- org.ow2.asm:asm:jar:5.0.1:compile
[INFO]    |  \- org.ow2.asm:asm-commons:jar:5.0.1:compile
[INFO]    |     \- org.ow2.asm:asm-tree:jar:5.0.1:compile
[INFO]    +- org.eclipse.jetty:jetty-util:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-jaspi:jar:9.3.11.v20160721:compile
[INFO]    |  +- org.eclipse.jetty:jetty-security:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty.orbit:javax.security.auth.message:jar:1.0.0.v201108011116:compile
[INFO]    +- org.eclipse.jetty:jetty-jndi:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-rewrite:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty:jetty-server:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-servlets:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty:jetty-continuation:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-quickstart:jar:9.3.11.v20160721:compile
[INFO]    |  \- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO]    +- org.eclipse.jetty.websocket:websocket-servlet:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty.websocket:websocket-api:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.3.11.v20160721:compile
[INFO]    |  +- org.eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty.websocket:websocket-server:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty.websocket:websocket-client:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty.websocket:websocket-common:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty:jetty-alpn-client:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty.http2:http2-server:jar:9.3.11.v20160721:compile
[INFO]    |  \- org.eclipse.jetty.http2:http2-common:jar:9.3.11.v20160721:compile
[INFO]    |     \- org.eclipse.jetty.http2:http2-hpack:jar:9.3.11.v20160721:compile
[INFO]    +- org.eclipse.jetty.http2:http2-client:jar:9.3.11.v20160721:compile
[INFO]    +- javax.websocket:javax.websocket-api:jar:1.0:compile
[INFO]    +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO]    +- org.eclipse.jetty.orbit:javax.mail.glassfish:jar:1.4.1.v201005082020:compile
[INFO]    |  \- org.eclipse.jetty.orbit:javax.activation:jar:1.1.0.v201105071233:compile
[INFO]    \- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.164 s
[INFO] Finished at: 2016-09-16T05:41:17-07:00
[INFO] Final Memory: 15M/485M
[INFO] ------------------------------------------------------------------------

这些依赖项中的每一个都有自己的 sources jar。

我们测试了 NetBeans、Eclipse 和 IntelliJ,它们都可以从全球中央存储库系统访问/下载那些 sources jar。这 3 个 IDE 中的每一个还可以使用来自任何流行构建系统(maven、gradle、ant+ivy、buildr、grape、grails、sbt 等)的 jetty-all

Maven 和 Gradle 甚至有可用的工具来为您下载这些依赖项 and/or 源 jar。

将默认工件(通常是 jar)下载到 target/dependency/

$ mvn dependency:copy-dependencies

将源工件下载到 target/dependency/

$ mvn dependency:copy-dependencies -Dclassifier=sources