Skip to content

Conversation

@kwin
Copy link
Member

@kwin kwin commented Feb 13, 2025

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MSITE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MSITE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@kwin kwin requested review from hboutemy and michael-o February 13, 2025 13:53
@kwin kwin force-pushed the bugfix/unwrap-scm-urls-for-distribution-site-urls branch from 730b1d9 to a254952 Compare February 13, 2025 13:56
@kwin kwin marked this pull request as draft February 13, 2025 14:09
@kwin
Copy link
Member Author

kwin commented Feb 13, 2025

I still need to look into the failing IT:

Running post-build script: /home/runner/work/maven-site-plugin/maven-site-plugin/target/it/site-inheritance/verify.bsh
staged moduleDirectory index.html has wrong links!
staged subModuleDirectory is missing or not a directory.
incorrect index file in staged subModuleDirectory!
java.nio.file.NoSuchFileException: /home/runner/work/maven-site-plugin/maven-site-plugin/target/it/site-inheritance/webhost.company.com/stage/www/website/sub_module/index.html
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
	at java.base/java.nio.file.Files.readString(Files.java:3366)
	at org.codehaus.plexus.util.BaseFileUtils.fileRead(BaseFileUtils.java:17)
	at org.codehaus.plexus.util.FileUtils.fileRead(FileUtils.java:322)
	at jdk.internal.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at bsh.Reflect.invokeMethod(Reflect.java:131)
	at bsh.Reflect.invokeStaticMethod(Reflect.java:95)
	at bsh.Name.invokeMethod(Name.java:793)
	at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:69)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
	at bsh.BSHAssignment.eval(BSHAssignment.java:71)
	at bsh.BSHBlock.evalBlock(BSHBlock.java:125)
	at bsh.BSHBlock.eval(BSHBlock.java:75)
	at bsh.BSHBlock.eval(BSHBlock.java:41)
	at bsh.BSHTryStatement.eval(BSHTryStatement.java:80)
	at bsh.Interpreter.eval(Interpreter.java:659)
	at bsh.Interpreter.eval(Interpreter.java:750)
	at bsh.Interpreter.eval(Interpreter.java:739)
	at org.apache.maven.shared.scriptinterpreter.BeanShellScriptInterpreter.evaluateScript(BeanShellScriptInterpreter.java:145)
	at org.apache.maven.shared.scriptinterpreter.ScriptRunner.executeRun(ScriptRunner.java:222)
	at org.apache.maven.shared.scriptinterpreter.ScriptRunner.run(ScriptRunner.java:158)
	at org.apache.maven.plugins.invoker.AbstractInvokerMojo.runPostBuildHook(AbstractInvokerMojo.java:1957)
	at org.apache.maven.plugins.invoker.AbstractInvokerMojo.runBuild(AbstractInvokerMojo.java:1914)
	at org.apache.maven.plugins.invoker.AbstractInvokerMojo.runBuild(AbstractInvokerMojo.java:1584)
	at org.apache.maven.plugins.invoker.AbstractInvokerMojo.lambda$runBuilds$4(AbstractInvokerMojo.java:1346)
	at org.apache.maven.plugins.invoker.JobExecutor.lambda$forEach$0(JobExecutor.java:63)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Finished post-build script: /home/runner/work/maven-site-plugin/maven-site-plugin/target/it/site-inheritance/verify.bsh
*** end build.log for: site-inheritance/pom.xml ***

Update: Debugging revealed the following distributionMgmt.site.url being used for it/site-inheritance/module and it/site-inheritance-submodule:

  1. target/it/site-inheritance/webhost.company.com/deploy/www/website/module
  2. target/it/site-inheritance/webhost.company.com/deploy/www/website/sub_module

So in fact those are siblings not nested, seems that the inheritance works a bit differently than outlined in https://maven.apache.org/ref/3-LATEST/maven-model-builder/ (compare with https://maven.apache.org/ref/3-LATEST/maven-model-builder/xref/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.html#L95).

I would argue the expected behaviour is wrong and submodule should not end up below module but next to it!

public class AbstractDeployMojoTest {

@Test
public void testIsSameSite() {
Copy link
Member

@slawekjaranowski slawekjaranowski Feb 13, 2025

Choose a reason for hiding this comment

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

Should be the same for?

scm:git:ssh://abc.abc
scm:git:https://abc.abc

Copy link
Member Author

@kwin kwin Feb 13, 2025

Choose a reason for hiding this comment

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

@kwin kwin force-pushed the bugfix/unwrap-scm-urls-for-distribution-site-urls branch from a254952 to 3a7f305 Compare February 13, 2025 17:42
@kwin kwin force-pushed the bugfix/unwrap-scm-urls-for-distribution-site-urls branch from 3a7f305 to 7251576 Compare February 13, 2025 18:28
@jira-importer
Copy link

Resolve #1159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants