Re: [I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-09-03 Thread via GitHub


gsmet commented on issue #929:
URL: https://github.com/apache/maven-mvnd/issues/929#issuecomment-2326780258

   I just got hit by this issue when building `quarkus-langchain4j` with mvnd 
1.0.2. I'm not sure this has been fixed by the PR that is mentioned here:
   
   ```
   [INFO] Installing 
/home/gsmet/git/quarkus-langchain4j/samples/review-triage/target/quarkus-langchain4j-sample-review-triage-1.0-SNAPSHOT.jar
 to 
/home/gsmet/.m2/repository/io/quarkiverse/langchain4j/quarkus-langchain4j-sample-review-triage/1.0-SNAPSHOT/quarkus-langchain4j-sample-review-triage-1.0-SNAPSHOT.jar
   Exception in thread "main" java.lang.StringIndexOutOfBoundsException: Index 
29 out of bounds for length 29
at 
java.base@22.0.2/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
at 
java.base@22.0.2/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
at 
java.base@22.0.2/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at 
java.base@22.0.2/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at 
java.base@22.0.2/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at 
java.base@22.0.2/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at 
java.base@22.0.2/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base@22.0.2/java.lang.String.checkIndex(String.java:4881)
at java.base@22.0.2/java.lang.StringLatin1.charAt(StringLatin1.java:46)
at java.base@22.0.2/java.lang.String.charAt(String.java:1582)
at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.pathToMaven(TerminalOutput.java:728)
at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.formatTransfers(TerminalOutput.java:701)
at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.addProjectLine(TerminalOutput.java:814)
at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.update(TerminalOutput.java:619)
at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.accept(TerminalOutput.java:205)
at 
org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:401)
at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:171)
at 
java.base@22.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-04-12 Thread via GitHub


ppalaga commented on issue #929:
URL: https://github.com/apache/maven-mvnd/issues/929#issuecomment-2052375052

   > Would logging just bare file name not be enough?
   
   The full URL is much longer. The g:a:v makes the text UI much better 
readable.
   
   > It looks like it's missing the packaging in the URL, which should default 
to jar if not specified in the model.
   
   Fixing the rendering in the console would be easy. Omitting the packaging is 
wrong at its source (wherever it comes from) because there are download 
failures logged for each of these incomplete URLs. 
   I wonder whether it is the sundr-maven-plugin that is called from 
quarkus-langchain4j-parent?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-04-12 Thread via GitHub


gastaldi commented on issue #929:
URL: https://github.com/apache/maven-mvnd/issues/929#issuecomment-2052259867

   It looks like it's missing the `packaging` in the URL, which should default 
to `jar` if not specified in the model. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-04-12 Thread via GitHub


cstamas commented on issue #929:
URL: https://github.com/apache/maven-mvnd/issues/929#issuecomment-2051952768

   Stunts like these ("reverse engineering URL into artifact" IIUC) should be 
avoided. Please do not do this :smile: Would logging just bare file name not be 
enough?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-04-12 Thread via GitHub


ppalaga commented on issue #929:
URL: https://github.com/apache/maven-mvnd/issues/929#issuecomment-2051843233

   
[daemon-167cc94d.log](https://github.com/apache/maven-mvnd/files/14959771/daemon-167cc94d.log)
   Attaching the whole log after applying the linked patch in case somebody 
would like to investigate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-04-12 Thread via GitHub


ppalaga commented on issue #929:
URL: https://github.com/apache/maven-mvnd/issues/929#issuecomment-2051825980

   When I make `TerminalOutput.pathToMaven()` more robust, I see many such 
extension-less URLs
   
   ```
   $ grep "\-3.8.2'" daemon-167cc94d.log 
   15:43:45.779 I Dispatch message: 
TransferInitiated{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-junit5-internal/3.8.2/quarkus-junit5-internal-3.8.2',
 contentLength=-1, transferredBytes=0, exception='null'}
   15:43:45.780 I Dispatch message: 
ProjectLogMessage{projectId='quarkus-langchain4j-parent', message='[INFO] 
Downloading from central: 
https://repo.maven.apache.org/maven2/io/quarkus/quarkus-junit5-internal/3.8.2/quarkus-junit5-internal-3.8.2'}
   15:43:45.878 I Dispatch message: 
TransferFailed{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-junit5-internal/3.8.2/quarkus-junit5-internal-3.8.2',
 contentLength=-1, transferredBytes=0, 
exception='org.eclipse.aether.transfer.ArtifactNotFoundException: Could not 
find artifact io.quarkus:quarkus-junit5-internal::3.8.2 in central 
(https://repo.maven.apache.org/maven2)'}
   15:43:51.300 I Dispatch message: 
TransferInitiated{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-vertx-http-dev-ui-tests/3.8.2/quarkus-vertx-http-dev-ui-tests-3.8.2',
 contentLength=-1, transferredBytes=0, exception='null'}
   15:43:51.300 I Dispatch message: 
ProjectLogMessage{projectId='quarkus-langchain4j-parent', message='[INFO] 
Downloading from central: 
https://repo.maven.apache.org/maven2/io/quarkus/quarkus-vertx-http-dev-ui-tests/3.8.2/quarkus-vertx-http-dev-ui-tests-3.8.2'}
   15:43:51.392 I Dispatch message: 
TransferFailed{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-vertx-http-dev-ui-tests/3.8.2/quarkus-vertx-http-dev-ui-tests-3.8.2',
 contentLength=-1, transferredBytes=0, 
exception='org.eclipse.aether.transfer.ArtifactNotFoundException: Could not 
find artifact io.quarkus:quarkus-vertx-http-dev-ui-tests::3.8.2 in central 
(https://repo.maven.apache.org/maven2)'}
   15:43:53.943 I Dispatch message: 
TransferInitiated{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-smallrye-fault-tolerance/3.8.2/quarkus-smallrye-fault-tolerance-3.8.2',
 contentLength=-1, transferredBytes=0, exception='null'}
   15:43:53.943 I Dispatch message: 
ProjectLogMessage{projectId='quarkus-langchain4j-parent', message='[INFO] 
Downloading from central: 
https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-fault-tolerance/3.8.2/quarkus-smallrye-fault-tolerance-3.8.2'}
   15:43:54.035 I Dispatch message: 
TransferFailed{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-smallrye-fault-tolerance/3.8.2/quarkus-smallrye-fault-tolerance-3.8.2',
 contentLength=-1, transferredBytes=0, 
exception='org.eclipse.aether.transfer.ArtifactNotFoundException: Could not 
find artifact io.quarkus:quarkus-smallrye-fault-tolerance::3.8.2 in central 
(https://repo.maven.apache.org/maven2)'}
   15:43:54.425 I Dispatch message: 
TransferInitiated{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-junit5/3.8.2/quarkus-junit5-3.8.2', 
contentLength=-1, transferredBytes=0, exception='null'}
   15:43:54.425 I Dispatch message: 
ProjectLogMessage{projectId='quarkus-langchain4j-parent', message='[INFO] 
Downloading from central: 
https://repo.maven.apache.org/maven2/io/quarkus/quarkus-junit5/3.8.2/quarkus-junit5-3.8.2'}
   15:43:54.518 I Dispatch message: 
TransferFailed{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-junit5/3.8.2/quarkus-junit5-3.8.2', 
contentLength=-1, transferredBytes=0, 
exception='org.eclipse.aether.transfer.ArtifactNotFoundException: Could not 
find artifact io.quarkus:quarkus-junit5::3.8.2 in central 
(https://repo.maven.apache.org/maven2)'}
   15:44:06.374 I Dispatch message: 
TransferInitiated{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-devtools-testing/3.8.2/quarkus-devtools-testing-3.8.2',
 contentLength=-1, transferredBytes=0, exception='null'}
   15:44:06.374 I Disp

[I] TerminalOutput.pathToMaven throws StringIndexOutOfBoundsException [maven-mvnd]

2024-04-12 Thread via GitHub


ppalaga opened a new issue, #929:
URL: https://github.com/apache/maven-mvnd/issues/929

   Steps to reproduce:
   
   ```
   git clone g...@github.com:quarkiverse/quarkus-langchain4j.git
   cd quarkus-langchain4j
   git reset --hard 177efc97b49823ad747a87766ea1e1d0c2b71ef6
   
   mvnd --stop
   mvnd -v 
   Apache Maven Daemon (mvnd) 1.0-m8 linux-amd64 native client 
(0f4bdb6df5e74453d8d558d292789da4e66a7933)Terminal: 
org.jline.terminal.impl.PosixSysTerminal with pty 
org.jline.terminal.impl.jansi.linux.LinuxNativePty
   Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
   Maven home: /home/ppalaga/.sdkman/candidates/mvnd/1.0-m8-m39/mvn
   Java version: 17.0.9, vendor: Eclipse Adoptium, runtime: 
/home/ppalaga/.sdkman/candidates/java/17.0.9-tem
   Default locale: en_IE, platform encoding: UTF-8
   OS name: "linux", version: "6.4.11-200.fc38.x86_64", arch: "amd64", family: 
"unix"
   
   rm -Rf /tmp/empty-local-maven-repo
   mvnd clean install -DskipTests -Dquarkus.build.skip 
-Dmaven.repo.local=/tmp/empty-local-maven-repo
   ...
   Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String 
index out of range: 17
   at 
java.base@17.0.6/java.lang.StringLatin1.charAt(StringLatin1.java:48)
   at java.base@17.0.6/java.lang.String.charAt(String.java:1513)
   at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.pathToMaven(TerminalOutput.java:724)
   at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.formatTransfers(TerminalOutput.java:697)
   at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.addProjectLine(TerminalOutput.java:810)
   at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.update(TerminalOutput.java:615)
   at 
org.mvndaemon.mvnd.common.logging.TerminalOutput.accept(TerminalOutput.java:217)
   at 
org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:366)
   at 
org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:161)
   ```
   
   The daemon log contains the following lines that cause the issue in the 
client:
   
   ```
   15:23:09.559 I Dispatch message: 
TransferInitiated{projectId=quarkus-langchain4j-parent, requestType=0, 
repositoryId='central', repositoryUrl='https://repo.maven.apache.org/maven2/', 
resourceName='io/quarkus/quarkus-jackson/3.8.2/quarkus-jackson-3.8.2', 
contentLength=-1, transferredBytes=0, exception='null'}
   15:23:09.559 I Dispatch message: 
ProjectLogMessage{projectId='quarkus-langchain4j-parent', 
message='[INFO] Downloading from central: 
https://repo.maven.apache.org/maven2/io/quarkus/quarkus-jackson/3.8.2/quarkus-jackson-3.8.2'}
   ```
   
   Normally the artifact URL has an extension, such as `.pom` or `.jar`. There 
is no such in 
`https://repo.maven.apache.org/maven2/io/quarkus/quarkus-jackson/3.8.2/quarkus-jackson-3.8.2`
 above. 
   I have no idea where it is coming from. 
   
   In any case, we should make the `TerminalOutput.pathToMaven()` method more 
robust so that it does not fail on this kind of input.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org