Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #8895 - Introduce jetty-home-<ver>-with-docs.zip #8898

Merged
merged 15 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion documentation/jetty-asciidoctor-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</dependency>
<dependency>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>test-distribution</artifactId>
<artifactId>jetty-home-tester</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.asciidoctor.extension.IncludeProcessor;
import org.asciidoctor.extension.PreprocessorReader;
import org.asciidoctor.jruby.extension.spi.ExtensionRegistry;
import org.eclipse.jetty.tests.distribution.JettyHomeTester;
import org.eclipse.jetty.tests.hometester.JettyHomeTester;

/**
* <p>Asciidoctor <em>include</em> extension that includes into
Expand Down
2 changes: 1 addition & 1 deletion javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<id>build-javadoc</id>
<phase>prepare-package</phase>
<goals>
<goal>javadoc</goal>
<goal>jar</goal>
</goals>
<configuration>
<doctitle>Eclipse Jetty API Doc - v${project.version}</doctitle>
Expand Down
70 changes: 69 additions & 1 deletion jetty-home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<properties>
<assembly-directory>${basedir}/target/jetty-home</assembly-directory>
<source-assembly-directory>${basedir}/target/jetty-home-sources</source-assembly-directory>
<docs-assembly-directory>${basedir}/target/jetty-home-with-docs</docs-assembly-directory>
<jetty-setuid-version>1.0.4</jetty-setuid-version>
<spotbugs.skip>true</spotbugs.skip>
</properties>
Expand Down Expand Up @@ -49,6 +50,7 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
Expand Down Expand Up @@ -120,7 +122,6 @@
</artifactItems>
</configuration>
</execution>

<execution>
<id>copy-lib-deps</id>
<phase>generate-resources</phase>
Expand Down Expand Up @@ -508,6 +509,44 @@
<outputDirectory>${assembly-directory}</outputDirectory>
</configuration>
</execution>
<execution>
<id>unpack-documentation</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty.documentation</groupId>
<artifactId>jetty-documentation</artifactId>
<version>${project.version}</version>
<classifier>html</classifier>
<type>zip</type>
</artifactItem>
</artifactItems>
<outputDirectory>${docs-assembly-directory}/docs</outputDirectory>
</configuration>
</execution>
<execution>
<id>unpack-javadoc-aggregate</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclipse.jetty</groupId>
<artifactId>javadoc</artifactId>
<version>${project.version}</version>
<classifier>javadoc</classifier>
<type>jar</type>
</artifactItem>
</artifactItems>
<outputDirectory>${docs-assembly-directory}/javadoc</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -563,6 +602,19 @@
<appendAssemblyId>true</appendAssemblyId>
</configuration>
</execution>
<execution>
<id>docs</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/jetty-with-docs-assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>true</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down Expand Up @@ -876,6 +928,22 @@
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.documentation</groupId>
<artifactId>jetty-documentation</artifactId>
<version>${project.version}</version>
<classifier>html</classifier>
<type>zip</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>javadoc</artifactId>
<version>${project.version}</version>
<classifier>javadoc</classifier>
<type>jar</type>
<optional>true</optional>
</dependency>
joakime marked this conversation as resolved.
Show resolved Hide resolved
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down
46 changes: 46 additions & 0 deletions jetty-home/src/main/assembly/jetty-with-docs-assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<assembly>
<id>with-docs</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${assembly-directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/META-INF/**</exclude>
<exclude>*-config.jar</exclude>
<!-- we'll build up shell scripts with execute in separate file-set -->
<exclude>bin/*.sh</exclude>
</excludes>
<!-- The archive is generated with the uid / gid of the user that
built the jetty release. which is highly unlikely to
exist on the target machines that unpack this tarball.
We set the user / group / other to have read-only access
to files, and read-execute access to directories
in the unpacked contents. -->
<fileMode>0444</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
<fileSet>
<directory>${assembly-directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>bin/*.sh</include>
</includes>
<!-- Set read-execute for shell scripts -->
<fileMode>0555</fileMode>
</fileSet>
<fileSet>
<directory>${docs-assembly-directory}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
12 changes: 8 additions & 4 deletions jetty-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,18 @@
<artifactId>jetty-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope it depends on it.
see comment here #8898 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet the build is green without it present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this present, we get ...

[ERROR] [ERROR] The projects in the reactor contain a cyclic reference: Edge between
   'Vertex{label='org.eclipse.jetty:javadoc:10.0.13-SNAPSHOT'}' and 
   'Vertex{label='org.eclipse.jetty:jetty-maven-plugin:10.0.13-SNAPSHOT'}' introduces to cycle in the graph
   org.eclipse.jetty:jetty-maven-plugin:10.0.13-SNAPSHOT --> 
   org.eclipse.jetty:jetty-home:10.0.13-SNAPSHOT --> 
   org.eclipse.jetty:javadoc:10.0.13-SNAPSHOT --> 
   org.eclipse.jetty:jetty-maven-plugin:10.0.13-SNAPSHOT @ 
[ERROR] The projects in the reactor contain a cyclic reference: Edge between 
   'Vertex{label='org.eclipse.jetty:javadoc:10.0.13-SNAPSHOT'}' and 
   'Vertex{label='org.eclipse.jetty:jetty-maven-plugin:10.0.13-SNAPSHOT'}' introduces to cycle in the graph
   org.eclipse.jetty:jetty-maven-plugin:10.0.13-SNAPSHOT --> 
   org.eclipse.jetty:jetty-home:10.0.13-SNAPSHOT --> 
   org.eclipse.jetty:javadoc:10.0.13-SNAPSHOT --> 
   org.eclipse.jetty:jetty-maven-plugin:10.0.13-SNAPSHOT -> [Help 1]

Perhaps we should remove jetty-maven-plugin from the javadoc?

<!--<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-home</artifactId>
Copy link
Contributor Author

@joakime joakime Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olamy do you recall why is this dependency here?
When I comment it out, the plugin still works (and tests properly).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just delete it.

Copy link
Member

@olamy olamy Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because jetty-maven-plugin depends on it (see https://github.com/eclipse/jetty.project/blob/3569f6506618f0a4d95f76b72979cc0548cc6a42/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java#L68 and https://github.com/eclipse/jetty.project/blob/3569f6506618f0a4d95f76b72979cc0548cc6a42/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java#L557) there is forked mode using/downloaded the distro
It can work because you download a SNAPSHOT of jetty-home or use one already here locally but it really depends on it.
Try running: mvn clean install -pl :jetty-maven-plugin -am with an empty repository.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that jetty-home doesn't build before jetty-maven-plugin, but I really cannot make it fail, even with a new <version>!

<scope>test</scope>
<type>zip</type>
<exclusions>
<!-- eliminating dependencies of jetty-home that are being pulled in when in reactor
for the jetty build itself. This can cause accidental cyclic references. -->
&lt;!&ndash; eliminating dependencies of jetty-home that are being pulled in when in reactor
for the jetty build itself. This can cause accidental cyclic references. &ndash;&gt;
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>javadoc</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-conscrypt-server</artifactId>
Expand Down Expand Up @@ -365,7 +369,7 @@
<artifactId>jboss-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>-->
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
Expand Down
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
<module>documentation</module>
<module>jetty-keystore</module>
<module>jetty-unixdomain-server</module>
<module>javadoc</module>
</modules>

<build>
Expand Down Expand Up @@ -1339,6 +1340,12 @@
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>jetty-home-tester</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
Expand Down Expand Up @@ -2206,9 +2213,6 @@
</profile>
<profile>
<id>eclipse-release</id>
<modules>
<module>javadoc</module>
</modules>
<build>
<plugins>
<plugin>
Expand Down
84 changes: 84 additions & 0 deletions tests/jetty-home-tester/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>tests-parent</artifactId>
<version>10.0.13-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>jetty-home-tester</artifactId>
<name>Jetty Tests :: jetty-home Tester</name>
<packaging>jar</packaging>

<properties>
<bundle-symbolic-name>${project.groupId}.tests.jettyhometester</bundle-symbolic-name>
</properties>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-spi</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
<version>${maven.resolver.version}</version>
<exclusions>
<!-- Used when running in SISU container to manage beans lifecycle (of locking factories) -->
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ========================================================================
//

package org.eclipse.jetty.tests.distribution;
package org.eclipse.jetty.tests.hometester;

import java.io.BufferedReader;
import java.io.Closeable;
Expand Down Expand Up @@ -40,6 +40,7 @@

import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.aether.AbstractRepositoryListener;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositoryEvent;
Expand All @@ -60,10 +61,8 @@
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.IO;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.NanoTime;
import org.eclipse.jetty.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -162,9 +161,9 @@ public JettyHomeTester.Run start(List<String> args) throws Exception
args = new ArrayList<>(args);

String mavenLocalRepository = config.getMavenLocalRepository();
if (StringUtil.isNotBlank(mavenLocalRepository))
if (StringUtils.isNotBlank(mavenLocalRepository))
mavenLocalRepository = System.getProperty("mavenRepoPath");
if (StringUtil.isNotBlank(mavenLocalRepository))
if (StringUtils.isNotBlank(mavenLocalRepository))
args.add("maven.local.repo=" + mavenLocalRepository);

// if this JVM has `maven.repo.uri` defined, make sure to propagate it to child
Expand Down Expand Up @@ -559,8 +558,8 @@ public void close()
*/
public boolean awaitConsoleLogsFor(String txt, long time, TimeUnit unit) throws InterruptedException
{
long start = NanoTime.now();
while (NanoTime.since(start) < unit.toNanos(time))
long end = System.currentTimeMillis() + unit.toMillis(time);
while (System.currentTimeMillis() < end)
{
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
if (result)
Expand All @@ -587,8 +586,8 @@ public boolean awaitLogsFileFor(Path logFile, String txt, long time, TimeUnit un
thread.start();
try
{
long start = NanoTime.now();
while (NanoTime.since(start) < unit.toNanos(time))
long end = System.currentTimeMillis() + unit.toMillis(time);
joakime marked this conversation as resolved.
Show resolved Hide resolved
while (System.currentTimeMillis() < end)
{
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
if (result)
Expand Down
Loading