Search code examples
jettyembedded-jettyjetty-9

jetty-all source jar (9.3)


Migrating from Jetty 9.2.x to 9.3.x I do not find anymore the jetty-all-9.2.9.v20150224-sources.jar ( https://repo1.maven.org/maven2/org/eclipse/jetty/aggregate/jetty-all/9.2.19.v20160908/ ) for 9.3.x

Is there any way to retrieve such a JAR for 9.3.x ?

Thx.


Solution

  • First, see prior answers about jetty-all.

    Know that jetty-all-*.jar is only for the command line examples in the jetty documentation.

    If you are using any variation of jetty-all-*.jar in your project or build, then you are using it incorrectly.

    If you are using the jetty-all <dependency> in your build, then your build is currently using the individual downstream dependencies from that pom declared coordinate. Each of those dependencies have their own sources classified attached artifacts (and javadoc classified too) for you to download and access the source from.

    Example Maven project 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>
    

    Which will produce the following list of dependencies

    $ 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] ------------------------------------------------------------------------
    

    Each and every one of those dependencies has its own sources jar.

    We've tested NetBeans, Eclipse, and IntelliJ, they all can access / download those sources jars from the global central repository system. Each of those 3 IDE's can also use jetty-all from any of the popular build systems (maven, gradle, ant+ivy, buildr, grape, grails, sbt, etc)

    Maven and Gradle even have available tooling to download those dependencies and/or sources jars for you.

    To download default artifacts (normally jars) to target/dependency/

    $ mvn dependency:copy-dependencies
    

    To download sources artifacts to target/dependency/

    $ mvn dependency:copy-dependencies -Dclassifier=sources