[jira] [Closed] (MNG-7976) Investigate MNG-6127 IT instability

2024-02-27 Thread Zhongming Hua (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-7976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhongming Hua closed MNG-7976.
--

> Investigate MNG-6127 IT instability
> ---
>
> Key: MNG-7976
> URL: https://issues.apache.org/jira/browse/MNG-7976
> Project: Maven
>  Issue Type: Task
>  Components: Core
>Reporter: Tamas Cservenak
>Assignee: Zhongming Hua
>Priority: Major
> Fix For: 4.0.0-alpha-13
>
>
> The MNG-6127 IT quite often fails, and passes when CI job rebuilt, seems 
> unstable.
> Look into it why (lurking concurrency bug somewhere? or just the IT is 
> flakey?) and fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (MNG-7976) Investigate MNG-6127 IT instability

2024-02-27 Thread Zhongming Hua (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-7976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhongming Hua resolved MNG-7976.

Fix Version/s: 4.0.0-alpha-13
   (was: 4.0.x-candidate)
   (was: 4.0.0)
   Resolution: Fixed

> Investigate MNG-6127 IT instability
> ---
>
> Key: MNG-7976
> URL: https://issues.apache.org/jira/browse/MNG-7976
> Project: Maven
>  Issue Type: Task
>  Components: Core
>Reporter: Tamas Cservenak
>Assignee: Zhongming Hua
>Priority: Major
> Fix For: 4.0.0-alpha-13
>
>
> The MNG-6127 IT quite often fails, and passes when CI job rebuilt, seems 
> unstable.
> Look into it why (lurking concurrency bug somewhere? or just the IT is 
> flakey?) and fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (MNG-7976) Investigate MNG-6127 IT instability

2024-02-27 Thread Zhongming Hua (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-7976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhongming Hua reassigned MNG-7976:
--

Assignee: Zhongming Hua

> Investigate MNG-6127 IT instability
> ---
>
> Key: MNG-7976
> URL: https://issues.apache.org/jira/browse/MNG-7976
> Project: Maven
>  Issue Type: Task
>  Components: Core
>Reporter: Tamas Cservenak
>Assignee: Zhongming Hua
>Priority: Major
> Fix For: 4.0.x-candidate, 4.0.0
>
>
> The MNG-6127 IT quite often fails, and passes when CI job rebuilt, seems 
> unstable.
> Look into it why (lurking concurrency bug somewhere? or just the IT is 
> flakey?) and fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-7976) Investigate MNG-6127 IT instability

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821549#comment-17821549
 ] 

ASF GitHub Bot commented on MNG-7976:
-

CrazyHZM merged PR #1422:
URL: https://github.com/apache/maven/pull/1422




> Investigate MNG-6127 IT instability
> ---
>
> Key: MNG-7976
> URL: https://issues.apache.org/jira/browse/MNG-7976
> Project: Maven
>  Issue Type: Task
>  Components: Core
>Reporter: Tamas Cservenak
>Priority: Major
> Fix For: 4.0.x-candidate, 4.0.0
>
>
> The MNG-6127 IT quite often fails, and passes when CI job rebuilt, seems 
> unstable.
> Look into it why (lurking concurrency bug somewhere? or just the IT is 
> flakey?) and fix it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MNG-7976] Investigate MNG-6127 IT instability [maven]

2024-02-27 Thread via GitHub


CrazyHZM merged PR #1422:
URL: https://github.com/apache/maven/pull/1422


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



[jira] [Resolved] (MNG-8060) Use String#isEmpty instead of length

2024-02-27 Thread Zhongming Hua (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-8060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhongming Hua resolved MNG-8060.

Fix Version/s: 4.0.0-alpha-13
   Resolution: Fixed

> Use String#isEmpty instead of length
> 
>
> Key: MNG-8060
> URL: https://issues.apache.org/jira/browse/MNG-8060
> Project: Maven
>  Issue Type: Task
>Reporter: Zhongming Hua
>Assignee: Zhongming Hua
>Priority: Minor
> Fix For: 4.0.0-alpha-13
>
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Assigned] (MNG-8060) Use String#isEmpty instead of length

2024-02-27 Thread Zhongming Hua (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-8060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhongming Hua reassigned MNG-8060:
--

Assignee: Zhongming Hua

> Use String#isEmpty instead of length
> 
>
> Key: MNG-8060
> URL: https://issues.apache.org/jira/browse/MNG-8060
> Project: Maven
>  Issue Type: Task
>Reporter: Zhongming Hua
>Assignee: Zhongming Hua
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Closed] (MNG-8060) Use String#isEmpty instead of length

2024-02-27 Thread Zhongming Hua (Jira)


 [ 
https://issues.apache.org/jira/browse/MNG-8060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhongming Hua closed MNG-8060.
--

> Use String#isEmpty instead of length
> 
>
> Key: MNG-8060
> URL: https://issues.apache.org/jira/browse/MNG-8060
> Project: Maven
>  Issue Type: Task
>Reporter: Zhongming Hua
>Assignee: Zhongming Hua
>Priority: Minor
> Fix For: 4.0.0-alpha-13
>
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-8060) Use String#isEmpty instead of length

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-8060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821547#comment-17821547
 ] 

ASF GitHub Bot commented on MNG-8060:
-

CrazyHZM merged PR #1420:
URL: https://github.com/apache/maven/pull/1420




> Use String#isEmpty instead of length
> 
>
> Key: MNG-8060
> URL: https://issues.apache.org/jira/browse/MNG-8060
> Project: Maven
>  Issue Type: Task
>Reporter: Zhongming Hua
>Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MNG-8060] Use String#isEmpty instead of length [maven]

2024-02-27 Thread via GitHub


CrazyHZM merged PR #1420:
URL: https://github.com/apache/maven/pull/1420


-- 
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: [PR] [MNG-8061] Maven: Require Java 17 [maven-parent]

2024-02-27 Thread via GitHub


olamy commented on PR #165:
URL: https://github.com/apache/maven-parent/pull/165#issuecomment-1968268061

   this means all plugins will be 17 required.
   so all plugins upgrading to to this parent will not work for users of maven 
3.x and jdk 8/11.
   sounds an issue to solve as it would mean eventually having branches for 
plugins in case of major bugs and/or security issues.
   


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



[jira] [Commented] (MNG-7539) Validate/Download SNAPSHOT dependencies once

2024-02-27 Thread Adrian Tarau (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-7539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821483#comment-17821483
 ] 

Adrian Tarau commented on MNG-7539:
---

I am unable to replicate the issue outside of the closed-source project, and 
cannot determine why it is behaving abnormally. The POM appears to have the 
correct settings in the appropriate places. 

> Validate/Download SNAPSHOT dependencies once
> 
>
> Key: MNG-7539
> URL: https://issues.apache.org/jira/browse/MNG-7539
> Project: Maven
>  Issue Type: Improvement
>  Components: Dependencies
>Reporter: Adrian Tarau
>Assignee: Tamas Cservenak
>Priority: Major
>
> Building an unreleased multi-module project (30-40 modules) that depends on 
> various other unreleased modules puts significant pressure on the Maven 
> Repository (a local Nexus instance), and artifact resolution could slow down 
> the build 2x-3x.
> I do acknowledge that it is the job of the repository to cache and serve 
> those responses fast, and for some reason, sometimes it slows down without an 
> apparent reason.
> However, the whole build process will be faster if Maven validates a SNAPSHOT 
> once for multi-module (when the dependency is reached the first time) and 
> then use that version. Even if Maven Repository is relative fast, there is 
> still network traffic done. Outside the fact that it should not be done, it 
> might also introduce flaky behaviors:
>  * one module downloads a version of artifact A, works with it, and 
> everything is fine
>  * 10 minutes later, another module needs artifact A and gets a newer 
> version, which has some issues, and various (test) failures will be raised
> For consistency, on a multi-module build, all modules should _see_ the same 
> version of a SNAPSHOT artifact. It will be faster, and it will be consistent 
> (which is very important).
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MRESOLVER-499) IPC Named Locks

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MRESOLVER-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821459#comment-17821459
 ] 

ASF GitHub Bot commented on MRESOLVER-499:
--

gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505156559


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcMessages.java:
##
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+/**
+ * Constants used for the inter-process communication protocol.
+ *
+ * @since 2.0.0
+ */
+public class IpcMessages {
+
+public static final String REQUEST_CONTEXT = "request-context";
+public static final String REQUEST_ACQUIRE = "request-acquire";
+public static final String REQUEST_CLOSE = "request-close";
+public static final String REQUEST_STOP = "request-stop";
+public static final String RESPONSE_CONTEXT = "response-context";
+public static final String RESPONSE_ACQUIRE = "response-acquire";
+public static final String RESPONSE_CLOSE = "response-close";
+public static final String RESPONSE_STOP = "response-stop";
+}

Review Comment:
   It would require rewriting the socket protocol, which is currently written 
to read/write a `List`, so definitely not an enum:
   
https://github.com/apache/maven-resolver/blob/814b6732a49447281ef085de3ef8542c45508371/maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcClient.java#L266-L308
 





> IPC Named Locks
> ---
>
> Key: MRESOLVER-499
> URL: https://issues.apache.org/jira/browse/MRESOLVER-499
> Project: Maven Resolver
>  Issue Type: New Feature
>  Components: Resolver
>Reporter: Tamas Cservenak
>Assignee: Tamas Cservenak
>Priority: Major
> Fix For: 2.0.0, 2.0.0-alpha-9
>
>
> Create IPC named locks implementation. Depends on MRESOLVER-421.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MRESOLVER-499] IPC Named locks [maven-resolver]

2024-02-27 Thread via GitHub


gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505156559


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcMessages.java:
##
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+/**
+ * Constants used for the inter-process communication protocol.
+ *
+ * @since 2.0.0
+ */
+public class IpcMessages {
+
+public static final String REQUEST_CONTEXT = "request-context";
+public static final String REQUEST_ACQUIRE = "request-acquire";
+public static final String REQUEST_CLOSE = "request-close";
+public static final String REQUEST_STOP = "request-stop";
+public static final String RESPONSE_CONTEXT = "response-context";
+public static final String RESPONSE_ACQUIRE = "response-acquire";
+public static final String RESPONSE_CLOSE = "response-close";
+public static final String RESPONSE_STOP = "response-stop";
+}

Review Comment:
   It would require rewriting the socket protocol, which is currently written 
to read/write a `List`, so definitely not an enum:
   
https://github.com/apache/maven-resolver/blob/814b6732a49447281ef085de3ef8542c45508371/maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcClient.java#L266-L308
 



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



[jira] [Commented] (MRESOLVER-499) IPC Named Locks

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MRESOLVER-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821458#comment-17821458
 ] 

ASF GitHub Bot commented on MRESOLVER-499:
--

gnodet commented on PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#issuecomment-1967926123

   > just saying in case you don't want to reinvent the wheel. You can 
server/client unixsocket already done in Jetty 
https://github.com/jetty/jetty.project/tree/jetty-10.0.x/jetty-unixsocket
   
   The whole idea was to have a minimal set of dependencies so that it could 
easily be turned into a native executable... 




> IPC Named Locks
> ---
>
> Key: MRESOLVER-499
> URL: https://issues.apache.org/jira/browse/MRESOLVER-499
> Project: Maven Resolver
>  Issue Type: New Feature
>  Components: Resolver
>Reporter: Tamas Cservenak
>Assignee: Tamas Cservenak
>Priority: Major
> Fix For: 2.0.0, 2.0.0-alpha-9
>
>
> Create IPC named locks implementation. Depends on MRESOLVER-421.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MRESOLVER-499] IPC Named locks [maven-resolver]

2024-02-27 Thread via GitHub


gnodet commented on PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#issuecomment-1967926123

   > just saying in case you don't want to reinvent the wheel. You can 
server/client unixsocket already done in Jetty 
https://github.com/jetty/jetty.project/tree/jetty-10.0.x/jetty-unixsocket
   
   The whole idea was to have a minimal set of dependencies so that it could 
easily be turned into a native executable... 


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



[jira] [Commented] (MRESOLVER-499) IPC Named Locks

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MRESOLVER-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821457#comment-17821457
 ] 

ASF GitHub Bot commented on MRESOLVER-499:
--

gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505151672


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/SocketFamily.java:
##
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.nio.channels.ServerSocketChannel;
+
+/**
+ * Socket factory.
+ *
+ * @since 2.0.0
+ */
+public enum SocketFamily {
+inet;
+
+public ServerSocketChannel openServerSocket() throws IOException {
+switch (this) {
+case inet:
+return ServerSocketChannel.open().bind(new 
InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
+default:
+throw new IllegalStateException();
+}
+}
+
+public static SocketAddress fromString(String str) {
+if (str.startsWith("inet:")) {

Review Comment:
   Maybe adding the UDS support and the unit test would help: 
https://github.com/apache/maven-mvnd/blob/0.7.1/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java





> IPC Named Locks
> ---
>
> Key: MRESOLVER-499
> URL: https://issues.apache.org/jira/browse/MRESOLVER-499
> Project: Maven Resolver
>  Issue Type: New Feature
>  Components: Resolver
>Reporter: Tamas Cservenak
>Assignee: Tamas Cservenak
>Priority: Major
> Fix For: 2.0.0, 2.0.0-alpha-9
>
>
> Create IPC named locks implementation. Depends on MRESOLVER-421.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MRESOLVER-499] IPC Named locks [maven-resolver]

2024-02-27 Thread via GitHub


gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505151672


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/SocketFamily.java:
##
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.nio.channels.ServerSocketChannel;
+
+/**
+ * Socket factory.
+ *
+ * @since 2.0.0
+ */
+public enum SocketFamily {
+inet;
+
+public ServerSocketChannel openServerSocket() throws IOException {
+switch (this) {
+case inet:
+return ServerSocketChannel.open().bind(new 
InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
+default:
+throw new IllegalStateException();
+}
+}
+
+public static SocketAddress fromString(String str) {
+if (str.startsWith("inet:")) {

Review Comment:
   Maybe adding the UDS support and the unit test would help: 
https://github.com/apache/maven-mvnd/blob/0.7.1/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java



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



[jira] [Commented] (MRESOLVER-499) IPC Named Locks

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MRESOLVER-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821456#comment-17821456
 ] 

ASF GitHub Bot commented on MRESOLVER-499:
--

gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505148875


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/SocketFamily.java:
##
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.nio.channels.ServerSocketChannel;
+
+/**
+ * Socket factory.
+ *
+ * @since 2.0.0
+ */
+public enum SocketFamily {
+inet;
+
+public ServerSocketChannel openServerSocket() throws IOException {
+switch (this) {
+case inet:
+return ServerSocketChannel.open().bind(new 
InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
+default:
+throw new IllegalStateException();
+}
+}
+
+public static SocketAddress fromString(String str) {
+if (str.startsWith("inet:")) {

Review Comment:
   Because UDS was supported in the original version:
   
https://github.com/apache/maven-mvnd/blob/0.7.1/common/src/main/java/org/mvndaemon/mvnd/common/SocketFamily.java





> IPC Named Locks
> ---
>
> Key: MRESOLVER-499
> URL: https://issues.apache.org/jira/browse/MRESOLVER-499
> Project: Maven Resolver
>  Issue Type: New Feature
>  Components: Resolver
>Reporter: Tamas Cservenak
>Assignee: Tamas Cservenak
>Priority: Major
> Fix For: 2.0.0, 2.0.0-alpha-9
>
>
> Create IPC named locks implementation. Depends on MRESOLVER-421.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MRESOLVER-499] IPC Named locks [maven-resolver]

2024-02-27 Thread via GitHub


gnodet commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1505148875


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/SocketFamily.java:
##
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+import java.nio.channels.ServerSocketChannel;
+
+/**
+ * Socket factory.
+ *
+ * @since 2.0.0
+ */
+public enum SocketFamily {
+inet;
+
+public ServerSocketChannel openServerSocket() throws IOException {
+switch (this) {
+case inet:
+return ServerSocketChannel.open().bind(new 
InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
+default:
+throw new IllegalStateException();
+}
+}
+
+public static SocketAddress fromString(String str) {
+if (str.startsWith("inet:")) {

Review Comment:
   Because UDS was supported in the original version:
   
https://github.com/apache/maven-mvnd/blob/0.7.1/common/src/main/java/org/mvndaemon/mvnd/common/SocketFamily.java



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



[jira] [Commented] (MJAR-289) Support toolchain

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MJAR-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821451#comment-17821451
 ] 

ASF GitHub Bot commented on MJAR-289:
-

hboutemy opened a new pull request, #71:
URL: https://github.com/apache/maven-jar-plugin/pull/71

   https://issues.apache.org/jira/browse/MJAR-289




> Support toolchain
> -
>
> Key: MJAR-289
> URL: https://issues.apache.org/jira/browse/MJAR-289
> Project: Maven JAR Plugin
>  Issue Type: Improvement
>Reporter: b. ohnsorg
>Priority: Major
>
> # Configure a toolchain to use a more recent JDK, e.g. 17
>  # run mvn clean install with a different (older) JDK, e.g. 11
>  # maven-jar-plugin bails out with exit code other than 0 from jar command
>  
> It seems very likely (see MJAR-62) that this plugin doesn't support 
> toolchains at all. Since packaging as JAR is a basic operation this has to 
> work out of the box, when using toolchains.
>  
> Instead current version of maven-jar-plugin runs a jar command that does not 
> create a JAR. Since compilation takes place based on toolchain class files 
> are of format version 61. This is incompatible with the jar command from a 
> JDK 11.
>  
> {code:java}
> […]
> [INFO] --- maven-compiler-plugin:3.9.0:testCompile (default-testCompile) @ 
> jpianotrain-core ---
> [INFO] Toolchain in maven-compiler-plugin: JDK[/opt/jdk-17.0.2/]
> […]
> [INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ 
> jpianotrain-core ---
> [INFO] Toolchain in maven-surefire-plugin: JDK[/opt/jdk-17.0.2/]
> […]
> [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ jpianotrain-core ---
> [INFO] Building jar: 
> /home/onkobu/svn/jpianotrain/trunk/jpianotrain-core/target/jpianotrain-core-0.0.4-SNAPSHOT.jar
> java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor 
> version 61.0
>     at 
> java.base/jdk.internal.module.ModuleInfo.invalidModuleDescriptor(ModuleInfo.java:1091)
>     at java.base/jdk.internal.module.ModuleInfo.doRead(ModuleInfo.java:195)
>     at java.base/jdk.internal.module.ModuleInfo.read(ModuleInfo.java:147)
>     at 
> java.base/java.lang.module.ModuleDescriptor.read(ModuleDescriptor.java:2553)
>     at 
> jdk.jartool/sun.tools.jar.Main.addExtendedModuleAttributes(Main.java:2084)
>     at jdk.jartool/sun.tools.jar.Main.update(Main.java:1018)
>     at jdk.jartool/sun.tools.jar.Main.run(Main.java:366)
>     at jdk.jartool/sun.tools.jar.JarToolProvider.run(JarToolProvider.java:37)
>     at java.base/java.util.spi.ToolProvider.run(ToolProvider.java:137)
>     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method)
>     at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>     at 
> org.codehaus.plexus.archiver.jar.JarToolModularJarArchiver.postCreateArchive(JarToolModularJarArchiver.java:114)
>     at 
> org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:1066)
>     at 
> org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:676)
>     at 
> org.apache.maven.plugins.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:276)
>     at 
> org.apache.maven.plugins.jar.AbstractJarMojo.execute(AbstractJarMojo.java:307)
>     at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137){code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MNG-8061) Upgrade Maven runtime requirement to Java 17

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-8061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821432#comment-17821432
 ] 

ASF GitHub Bot commented on MNG-8061:
-

bmarwell opened a new pull request, #1430:
URL: https://github.com/apache/maven/pull/1430

   ## **⚠️  This PR requires a vote**
   
   Please do not merge unless the vote has passed.
   The vote shall only be on the used Java version, not on the properties 
modified (they may change).
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
- [X] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG-8061) 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.
- [X] Each commit in the pull request should have a meaningful subject line 
and body.
- [X] Format the pull request title like `[MNG-XXX] SUMMARY`,
  where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA 
issue.
- [X] Also format the first line of the commit message like `[MNG-XXX] 
SUMMARY`.
  Best practice is to use the JIRA issue title in both the pull request 
title and in the first line of the commit message.
- [X] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
  be performed on your pull request automatically.
- [X] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) 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](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
- [X] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
- [X] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   




> Upgrade Maven runtime requirement to Java 17
> 
>
> Key: MNG-8061
> URL: https://issues.apache.org/jira/browse/MNG-8061
> Project: Maven
>  Issue Type: Task
>  Components: API, Core, POM
>Reporter: Benjamin Marwell
>Priority: Major
>  Labels: NeedsReleaseNote, pull-request-available
>
> Update Maven and its plugins to Java 17 by replacing maven.compiler.* with 
> maven.compiler.release and setting the language level to 17.
> This issue and its PR need a vote



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] [MNG-8061] Maven: Require Java 17 [maven]

2024-02-27 Thread via GitHub


bmarwell opened a new pull request, #1430:
URL: https://github.com/apache/maven/pull/1430

   ## **⚠️  This PR requires a vote**
   
   Please do not merge unless the vote has passed.
   The vote shall only be on the used Java version, not on the properties 
modified (they may change).
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
- [X] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG-8061) 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.
- [X] Each commit in the pull request should have a meaningful subject line 
and body.
- [X] Format the pull request title like `[MNG-XXX] SUMMARY`,
  where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA 
issue.
- [X] Also format the first line of the commit message like `[MNG-XXX] 
SUMMARY`.
  Best practice is to use the JIRA issue title in both the pull request 
title and in the first line of the commit message.
- [X] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
  be performed on your pull request automatically.
- [X] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) 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](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
- [X] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
- [X] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
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: [PR] [MNG-8061] Maven: Require Java 17 [maven-parent]

2024-02-27 Thread via GitHub


bmarwell commented on PR #165:
URL: https://github.com/apache/maven-parent/pull/165#issuecomment-1967616066

   Will redo this on maven-core first.


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



[PR] [MNG-8061] Maven: Require Java 17 [maven-parent]

2024-02-27 Thread via GitHub


bmarwell opened a new pull request, #165:
URL: https://github.com/apache/maven-parent/pull/165

   ## **⚠️  This PR requires a vote**
   
   Please do not merge unless the vote has passed.
   The vote shall only be on the used Java version, not on the properties 
modified (they may change).


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



[jira] [Created] (MRELEASE-1142) Release plugin corrupts pom.xml content

2024-02-27 Thread Sebastian T (Jira)
Sebastian T created MRELEASE-1142:
-

 Summary: Release plugin corrupts pom.xml content
 Key: MRELEASE-1142
 URL: https://issues.apache.org/jira/browse/MRELEASE-1142
 Project: Maven Release Plugin
  Issue Type: Bug
  Components: perform, prepare
Affects Versions: 3.0.1
 Environment: Maven 3.9.6
Reporter: Sebastian T


Since we migrated to the 3.x version of the release plugin, the prepare/perform 
goals

A) add arbitrary spaces and new lines to the pom:
 # prepare release: 
[https://github.com/sebthom/jstuff/commit/f6155d2c0947bae7a9547cef4de3cfd31b7b29ff#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8]
 # prepare for next development iteration: 
[https://github.com/sebthom/jstuff/commit/b18b3a4baddbecf8d43ebea1414acd4d822b8d0f#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8]

 

B) remove white spaces from CDATA content which should be left untouched:
 # prepare release: 
[https://github.com/vegardit/vegardit-maven-parent/commit/8819c97f0597561a4a77f52b0a9e270566dbd4bc#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8L255-L258]
 # prepare for next development iteration: 
[https://github.com/vegardit/vegardit-maven-parent/commit/cf93747410459613fddc26e9fc1c7a6ad1df2b8a#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8L255-L257]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (MNG-8061) Upgrade Maven runtime requirement to Java 17

2024-02-27 Thread Benjamin Marwell (Jira)
Benjamin Marwell created MNG-8061:
-

 Summary: Upgrade Maven runtime requirement to Java 17
 Key: MNG-8061
 URL: https://issues.apache.org/jira/browse/MNG-8061
 Project: Maven
  Issue Type: Task
  Components: API, Core, POM
Reporter: Benjamin Marwell


Update Maven and its plugins to Java 17 by replacing maven.compiler.* with 
maven.compiler.release and setting the language level to 17.

This issue and its PR need a vote



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[PR] Concurrent lifecycle for Maven 4 [maven]

2024-02-27 Thread via GitHub


gnodet opened a new pull request, #1429:
URL: https://github.com/apache/maven/pull/1429

   - **SPI fixes**
   - **Lifecycle API / SPI (wip)**
   - **Add a TODO to implement**
   - **wip**
   - **Improve api a bit**
   - **Use SessionData to store ProjectIndex**
   - **Make LifecycleStarter pluggable**
   - **Fix concurrent cache access**
   - **New concurrent lifecycle and builder**
   - **Use new lifecycle by default**
   - **Make deploy run after install (even though it should not be necessary)**
   - **Split creator / executor**
   - **Add per-mojo output buffering**
   - **Single threaded build for the site...**
   - **wip**
   - **Dynamic plan to cope with plugins being defined in the reactor**
   


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



[PR] Missing annotations on api [maven]

2024-02-27 Thread via GitHub


gnodet opened a new pull request, #1428:
URL: https://github.com/apache/maven/pull/1428

   (no comment)


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



[PR] Add a SpiService marker interface [maven]

2024-02-27 Thread via GitHub


gnodet opened a new pull request, #1427:
URL: https://github.com/apache/maven/pull/1427

   (no comment)


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



[PR] Extract JLine support into its own module [maven]

2024-02-27 Thread via GitHub


gnodet opened a new pull request, #1426:
URL: https://github.com/apache/maven/pull/1426

   (no comment)


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



[PR] Fix concurrent cache access [maven]

2024-02-27 Thread via GitHub


gnodet opened a new pull request, #1425:
URL: https://github.com/apache/maven/pull/1425

   (no comment)


-- 
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: [PR] Automatic discovery of JDK toolchains [maven-toolchains-plugin]

2024-02-27 Thread via GitHub


rmannibucau commented on PR #14:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/14#issuecomment-1966964218

   Personally i use JAVA${major}_HOME and wire it in pom in executable or jvm 
properties today.
   
   But what I dont like in this pr is that it adds complexity to the complexity 
of toolchain whereas if you totally drop toolchain everything is simple.
   
   Dont take it as a -1 but more as not something to promote nor recommend to 
end users IMHO.


-- 
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: [PR] Automatic discovery of JDK toolchains [maven-toolchains-plugin]

2024-02-27 Thread via GitHub


gnodet commented on PR #14:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/14#issuecomment-1966918747

   > > > Wouldn't it be great if `settings.xml` could also be made optional by 
usage of env vars as well?
   > > 
   > > 
   > > Settings are already interpolated so we can use env vars already, I'm 
using it locally with the following:
   > > ```
   > > 
   > >   central
   > >   central
   > >   ${env.MAVEN_CENTRAL}
   > > 
   > > ```
   > > 
   > > 
   > > 
   > >   
   > > 
   > > 
   > >   
   > > 
   > > 
   > > 
   > >   
   > > so that I can point to a mirror on my LAN when available.
   > > Toolchains are also interpolated and env vars seems to be supported too 
fwiw.
   > > So it's not really settings being optional, but it's easy to setup a 
project's settings.xml or toolchains.xml that just use env variables, wouldn't 
that work ?
   > 
   > The point is to have a standard method by which Maven can detect specific 
env vars for this without having to explicitly write a `settings.xml` or 
`toolchains.xml`, as it is an inconvenience to both generate and maintain these 
files.
   
   Let's put the settings.xml aside for this PR.  This PR provides a 
`ToolchainDiscover` component which can be used to discover toolchains instead 
of having to write the `toolchains.xml`.  It's just missing a [few lines of 
code](https://github.com/apache/maven-toolchains-plugin/pull/14/files#diff-a3c373bf8f7bf3b7edb54c35d0078d25d90c3f59a9fd4bc8ffa8f8076cfa3e02R288-R330)
 to add a discovery mechanism based on environment variables.  What is the most 
used syntax to define those ? I can easily add it.  @rmannibucau  @norrisjeremy 


-- 
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: [PR] update parent pom to 41 [maven-toolchains-plugin]

2024-02-27 Thread via GitHub


elharo commented on PR #19:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/19#issuecomment-1966906986

   55 is Java 11, I think


-- 
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: [PR] update parent pom to 41 [maven-toolchains-plugin]

2024-02-27 Thread via GitHub


gnodet commented on PR #19:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/19#issuecomment-1966863217

   > Nope. something seems off with the CI config:
   > 
   > Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
default of goal com.diffplug.spotless:spotless-maven-plugin:2.40.0:check 
failed: Unable to load the mojo 'check' in the plugin 
'com.diffplug.spotless:spotless-maven-plugin:2.40.0' due to an API 
incompatibility: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: 
com/diffplug/spotless/maven/SpotlessCheckMojo has been compiled by a more 
recent version of the Java Runtime (class file version 55.0), this version of 
the Java Runtime only recognizes class file versions up to 52.0
   
   I think this requires JDK 17 at build time and should target JDK 8 at 
runtime.


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



[jira] [Commented] (MNG-5726) Update OS Activation To Allow Wildcards In OS Version

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-5726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821301#comment-17821301
 ] 

ASF GitHub Bot commented on MNG-5726:
-

kwin commented on PR #1421:
URL: https://github.com/apache/maven/pull/1421#issuecomment-1966820871

   @gnodet Is there general support for matching globs built into Java (apart 
from Files NIO)? I haven't found anything and quick googling revealed 
https://stackoverflow.com/questions/1247772/is-there-an-equivalent-of-java-util-regex-for-glob-type-patterns.
 So I would say, regex is good enough for now.




> Update OS Activation To Allow Wildcards In OS Version
> -
>
> Key: MNG-5726
> URL: https://issues.apache.org/jira/browse/MNG-5726
> Project: Maven
>  Issue Type: New Feature
>  Components: Profiles
>Affects Versions: 3.1.1, 3.2.3
> Environment: RHEL/CentOs
>Reporter: Andy Lehane
>Assignee: Konrad Windszus
>Priority: Minor
> Attachments: maven-os-version-patch-3.2.3.zip
>
>
> I'm attempting to use maven to build a legacy project that requires different 
> dependecies based on the operating system version, i.e:
>  - version 1.0 of "a platform specific library" for Red Hat Linux 5 
>  - version 1.1 of "a platform specific library" for Red Hat Linux 6
>  - version 1.4a of "a platform specific library" for Windows and
>  - version 1.3b of (a platform specific library" for Solaris.
> I can configure my pom file to get activate specific profiles for RHEL, Win 
> and Solaris but cannot distinguish between Red Hat 5 and 6 unless I use the 
> full version string, which is of the form "2.6.32-504.1.3.el6.x86_64".
> As this Linux version will change whenever patch updates are installed, this 
> will make maintaining the pom/project akward.
> To solve this, it would be good to be able to specify wildcard's in the os 
> version tag. I have taken a look at the range checking (for example, as 
> applied to the JdkVersion), but don't think this method would be sufficient, 
> as the specific part of the Red Hat version number we require is buried over 
> half way into the version string (i.e. "el6" of the version 
> "2.6.32-504.1.3.el6.x86_64").
> It would be nice to be able to have something like:
> {code}
> 
>   linux-rhel5
> 
>   false
>   
> unix
> Linux
> *el5*
>   
> 
> 
> .
> {code}
> I've taken a look at the OperatingSystemProfileActivator code and have 
> created a patch that will use ^ to signify that the text is a regular 
> expression, for example:
> {code}
> ^.*(el5).*
> {code}
> I've also kept the ! notation, so the following can also be used:
> {code}
> !^.*(el5).*
> {code}
> The patch added contains a unit test for the OperatingSystemProfileActivator 
> in the maven-model-builder project (warning: it's a nasty test but I couldn't 
> find a nicer way of being able to reliably manuplate the OS Version).
> I've also patch the OperatingSystemProfileActivator class in the maven-compat 
> project but have not been able to write a unit test for that class.
> Can this updated be considered for implementation/inclusion please?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MNG-5726] Support regular expression matching in profile activation for [maven]

2024-02-27 Thread via GitHub


kwin commented on PR #1421:
URL: https://github.com/apache/maven/pull/1421#issuecomment-1966820871

   @gnodet Is there general support for matching globs built into Java (apart 
from Files NIO)? I haven't found anything and quick googling revealed 
https://stackoverflow.com/questions/1247772/is-there-an-equivalent-of-java-util-regex-for-glob-type-patterns.
 So I would say, regex is good enough for now.


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



[jira] [Commented] (MNG-5726) Update OS Activation To Allow Wildcards In OS Version

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MNG-5726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821297#comment-17821297
 ] 

ASF GitHub Bot commented on MNG-5726:
-

gnodet commented on PR #1421:
URL: https://github.com/apache/maven/pull/1421#issuecomment-1966811473

   Would it make sense to also support the easier `glob:` syntax then ?




> Update OS Activation To Allow Wildcards In OS Version
> -
>
> Key: MNG-5726
> URL: https://issues.apache.org/jira/browse/MNG-5726
> Project: Maven
>  Issue Type: New Feature
>  Components: Profiles
>Affects Versions: 3.1.1, 3.2.3
> Environment: RHEL/CentOs
>Reporter: Andy Lehane
>Assignee: Konrad Windszus
>Priority: Minor
> Attachments: maven-os-version-patch-3.2.3.zip
>
>
> I'm attempting to use maven to build a legacy project that requires different 
> dependecies based on the operating system version, i.e:
>  - version 1.0 of "a platform specific library" for Red Hat Linux 5 
>  - version 1.1 of "a platform specific library" for Red Hat Linux 6
>  - version 1.4a of "a platform specific library" for Windows and
>  - version 1.3b of (a platform specific library" for Solaris.
> I can configure my pom file to get activate specific profiles for RHEL, Win 
> and Solaris but cannot distinguish between Red Hat 5 and 6 unless I use the 
> full version string, which is of the form "2.6.32-504.1.3.el6.x86_64".
> As this Linux version will change whenever patch updates are installed, this 
> will make maintaining the pom/project akward.
> To solve this, it would be good to be able to specify wildcard's in the os 
> version tag. I have taken a look at the range checking (for example, as 
> applied to the JdkVersion), but don't think this method would be sufficient, 
> as the specific part of the Red Hat version number we require is buried over 
> half way into the version string (i.e. "el6" of the version 
> "2.6.32-504.1.3.el6.x86_64").
> It would be nice to be able to have something like:
> {code}
> 
>   linux-rhel5
> 
>   false
>   
> unix
> Linux
> *el5*
>   
> 
> 
> .
> {code}
> I've taken a look at the OperatingSystemProfileActivator code and have 
> created a patch that will use ^ to signify that the text is a regular 
> expression, for example:
> {code}
> ^.*(el5).*
> {code}
> I've also kept the ! notation, so the following can also be used:
> {code}
> !^.*(el5).*
> {code}
> The patch added contains a unit test for the OperatingSystemProfileActivator 
> in the maven-model-builder project (warning: it's a nasty test but I couldn't 
> find a nicer way of being able to reliably manuplate the OS Version).
> I've also patch the OperatingSystemProfileActivator class in the maven-compat 
> project but have not been able to write a unit test for that class.
> Can this updated be considered for implementation/inclusion please?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MNG-5726] Support regular expression matching in profile activation for [maven]

2024-02-27 Thread via GitHub


gnodet commented on PR #1421:
URL: https://github.com/apache/maven/pull/1421#issuecomment-1966811473

   Would it make sense to also support the easier `glob:` syntax then ?


-- 
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: [PR] update parent pom to 41 [maven-toolchains-plugin]

2024-02-27 Thread via GitHub


elharo commented on PR #19:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/19#issuecomment-1966723262

   Nope. something seems off with the CI config:
   
   Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
default of goal com.diffplug.spotless:spotless-maven-plugin:2.40.0:check 
failed: Unable to load the mojo 'check' in the plugin 
'com.diffplug.spotless:spotless-maven-plugin:2.40.0' due to an API 
incompatibility: 
org.codehaus.plexus.component.repository.exception.ComponentLookupException: 
com/diffplug/spotless/maven/SpotlessCheckMojo has been compiled by a more 
recent version of the Java Runtime (class file version 55.0), this version of 
the Java Runtime only recognizes class file versions up to 52.0
   


-- 
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: [PR] Automatic discovery of JDK toolchains [maven-toolchains-plugin]

2024-02-27 Thread via GitHub


elharo commented on code in PR #14:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/14#discussion_r1504330055


##
src/main/java/org/apache/maven/plugins/toolchain/jdk/ToolchainDiscoverer.java:
##
@@ -0,0 +1,332 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.plugins.toolchain.jdk;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.toolchain.model.PersistedToolchains;
+import org.apache.maven.toolchain.model.ToolchainModel;
+import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Reader;
+import org.apache.maven.toolchain.model.io.xpp3.MavenToolchainsXpp3Writer;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Implementation of ToolchainDiscoverer service
+ */
+public class ToolchainDiscoverer {
+
+private static final String DISCOVERED_TOOLCHAINS_CACHE_XML = 
".m2/discovered-toolchains-cache.xml";
+
+private final Log log;
+
+private Map cache;
+private boolean cacheModified;
+
+public ToolchainDiscoverer(Log log) {
+this.log = log;
+}
+
+/**
+ * Build the model for the current JDK toolchain
+ */
+public ToolchainModel getCurrentJdkToolchain() {
+Path currentJdkHome = 
getCanonicalPath(Paths.get(System.getProperty("java.home")));
+if (!Files.exists(currentJdkHome.resolve("bin/javac"))
+&& !Files.exists(currentJdkHome.resolve("bin/javac.exe"))) {
+// in case the current JVM is not a JDK
+return null;
+}
+
+ToolchainModel model = new ToolchainModel();
+model.setType("jdk");
+Stream.of("java.version", "java.runtime.name", "java.runtime.version", 
"java.vendor", "java.vendor.version")
+.forEach(k -> {
+String v = System.getProperty(k);
+if (v != null) {
+model.addProvide(k.substring(5), v);
+}
+});
+model.addProvide("current", "true");
+Xpp3Dom config = new Xpp3Dom("configuration");
+Xpp3Dom jdkHome = new Xpp3Dom("jdkHome");
+jdkHome.setValue(currentJdkHome.toString());
+config.addChild(jdkHome);
+model.setConfiguration(config);
+return model;
+}
+
+/**
+ * Returns a PersistedToolchains object containing a list of discovered 
toolchains,
+ * never null.
+ */
+public PersistedToolchains discoverToolchains() {
+try {
+Set jdks = findJdks();
+log.info("Found " + jdks.size() + " possible jdks: " + jdks);
+cacheModified = false;
+readCache();
+Path currentJdkHome = 
getCanonicalPath(Paths.get(System.getProperty("java.home")));
+List tcs = jdks.parallelStream()
+.map(s -> getToolchainModel(currentJdkHome, s))
+.filter(Objects::nonNull)
+.sorted(getToolchainModelComparator())
+.collect(Collectors.toList());
+if (this.cacheModified) {
+writeCache();
+}
+PersistedToolchains ps = new PersistedToolchains();
+ps.setToolchains(tcs);
+return ps;
+} catch (Exception e) {
+if (log.isDebugEnabled()) {
+log.warn("Error discovering toolchains: " + e, e);
+} else {
+log.warn("Error discovering toolchains (enable debug level for 
more information): " + e);
+}
+return new PersistedTool

[jira] [Commented] (MSHARED-1330) Incremental builds fail on filtered read-only resources

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MSHARED-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821265#comment-17821265
 ] 

ASF GitHub Bot commented on MSHARED-1330:
-

elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504326995


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setRwPermissions(File file) throws IOException {

Review Comment:
   setReadWritePermissions (I initially read this as setRawPermissions)



##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   nvm, the relevant part was hidden by Github's code review folding





> Incremental builds fail on filtered read-only resources  
> -
>
> Key: MSHARED-1330
> URL: https://issues.apache.org/jira/browse/MSHARED-1330
> Project: Maven Shared Components
>  Issue Type: Bug
>  Components: maven-filtering
>Reporter: G.Vaysman
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
> Attachments: create-license.zip
>
>
> Under certain SCM's, such as Perforce, files under ./src are read-only. With 
> the latest maven-resources-plugin (3.3.1) which has maven-filtering 3.3.1 as 
> a dependency, filtered resources end up as read-only in ./target. Since 
> filtered resources are always updated in target, this fails with exception 
> below. This worked in maven-resources-plugin 2.7, but seems to break, at 
> least, starting from maven-resources-plugin 3.0.0. Additionally note, that 
> deprecating certain maven-filtering methods (copyFile, etc) that take the 
> Boolean _overwrite_ has broken the maven-resource-plugin contract for the 
> resources:resources (see 
> [https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html).]
> I am attaching a very simple project that demonstrates it. When unzipping, 
> make sure src/main/resources/license.txt is read-only. Execute mvn install 
> twice (without "clean") . It fails on both Windows and Linux.  
> Further, a kind of semi-independent issue is the following: if a module 
> contains multiple resources, some to be filtered and others not, a typical 
> Maven pattern is (abridged):
> {{   }}
> {{      }}
> {{        true}}
> {{         ...   }}
> {{      }}
> {{      }}
> {{        false}}
> {{         ...  }}
> {{      }}
> {{    }}
> This causes both filtered and unfiltered resources go through 
> maven-filtering, and it breaks incremental builds on unfiltered resources as 
> well.
> Error:
>  {{Caused by: java.io.FileNotFoundException: 
> D:\tmp\create-license\target\classes\license.txt (Access is denied)}}
> {{    at java.io.RandomAccessFile.open0 (Native Method)}}
> {{    at java.io.RandomAccessFile.open (RandomAccessFile.java:346)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:260)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:215)}}
> {{    at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:348)}}
> {{    at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:104)}}
> {{    at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:268)}}
> {{    at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:343)}}
> {{    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)}}
> {{    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210) }}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MSHARED-1330] Always overwrite files [maven-filtering]

2024-02-27 Thread via GitHub


elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504326995


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setRwPermissions(File file) throws IOException {

Review Comment:
   setReadWritePermissions (I initially read this as setRawPermissions)



##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   nvm, the relevant part was hidden by Github's code review folding



-- 
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: [PR] [MRESOLVER-499] IPC Named locks [maven-resolver]

2024-02-27 Thread via GitHub


cstamas commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1504317933


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcClient.java:
##
@@ -0,0 +1,417 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.*;
+import java.net.SocketAddress;
+import java.nio.channels.ByteChannel;
+import java.nio.channels.Channels;
+import java.nio.channels.FileLock;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Random;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_ACQUIRE;
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_CLOSE;
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_CONTEXT;
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_STOP;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_ACQUIRE;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_CLOSE;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_CONTEXT;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_STOP;
+
+/**
+ * Client side implementation.
+ * The client instance is bound to a given maven repository.
+ *
+ * @since 2.0.0
+ */
+public class IpcClient {
+
+static final boolean IS_WINDOWS =
+
System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win");
+
+volatile boolean initialized;
+Path lockPath;
+Path logPath;
+Path syncPath;
+SocketChannel socket;
+DataOutputStream output;
+DataInputStream input;
+Thread receiver;
+AtomicInteger requestId = new AtomicInteger();
+Map>> responses = new 
ConcurrentHashMap<>();
+
+IpcClient(Path lockPath, Path logPath, Path syncPath) {
+this.lockPath = lockPath;
+this.logPath = logPath;
+this.syncPath = syncPath;
+}
+
+void ensureInitialized() throws IOException {
+if (!initialized) {
+synchronized (this) {
+if (!initialized) {
+socket = createClient();
+ByteChannel wrapper = new ByteChannelWrapper(socket);
+input = new 
DataInputStream(Channels.newInputStream(wrapper));
+output = new 
DataOutputStream(Channels.newOutputStream(wrapper));
+receiver = new Thread(this::receive);
+receiver.setDaemon(true);
+receiver.start();
+initialized = true;
+}
+}
+}
+}
+
+SocketChannel createClient() throws IOException {
+String familyProp = System.getProperty(IpcServer.SYSTEM_PROP_FAMILY, 
IpcServer.DEFAULT_FAMILY);
+SocketFamily family = familyProp != null ? 
SocketFamily.valueOf(familyProp) : SocketFamily.inet;
+
+Path lockPath = this.lockPath.toAbsolutePath().normalize();
+Path lockFile =
+lockPath.resolve(".maven-resolver-ipc-lock-" + 
family.name().toLowerCase());
+if (!Files.isRegularFile(lockFile)) {
+if (!Files.isDirectory(lockFile.getParent())) {
+Files.createDirectories(lockFile.getParent());
+}
+}
+
+try (RandomAccessFile raf = new RandomAccessFile(lockFile.toFile(), 
"rw")) {
+try (FileLock lock = raf.getChannel().lock()) {
+String line = raf.readLine();
+if (line != null) {
+try {
+SocketAddress address = SocketFamily.fromString(line);
+return SocketChannel.open(address);
+} catch (IOException e) {
+// ignore
+}
+}
+
+ServerSocketChannel ss 

[jira] [Commented] (MRESOLVER-499) IPC Named Locks

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MRESOLVER-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821261#comment-17821261
 ] 

ASF GitHub Bot commented on MRESOLVER-499:
--

cstamas commented on code in PR #435:
URL: https://github.com/apache/maven-resolver/pull/435#discussion_r1504317933


##
maven-resolver-named-locks-ipc/src/main/java/org/eclipse/aether/named/ipc/IpcClient.java:
##
@@ -0,0 +1,417 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.aether.named.ipc;
+
+import java.io.*;
+import java.net.SocketAddress;
+import java.nio.channels.ByteChannel;
+import java.nio.channels.Channels;
+import java.nio.channels.FileLock;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Random;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_ACQUIRE;
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_CLOSE;
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_CONTEXT;
+import static org.eclipse.aether.named.ipc.IpcMessages.REQUEST_STOP;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_ACQUIRE;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_CLOSE;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_CONTEXT;
+import static org.eclipse.aether.named.ipc.IpcMessages.RESPONSE_STOP;
+
+/**
+ * Client side implementation.
+ * The client instance is bound to a given maven repository.
+ *
+ * @since 2.0.0
+ */
+public class IpcClient {
+
+static final boolean IS_WINDOWS =
+
System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win");
+
+volatile boolean initialized;
+Path lockPath;
+Path logPath;
+Path syncPath;
+SocketChannel socket;
+DataOutputStream output;
+DataInputStream input;
+Thread receiver;
+AtomicInteger requestId = new AtomicInteger();
+Map>> responses = new 
ConcurrentHashMap<>();
+
+IpcClient(Path lockPath, Path logPath, Path syncPath) {
+this.lockPath = lockPath;
+this.logPath = logPath;
+this.syncPath = syncPath;
+}
+
+void ensureInitialized() throws IOException {
+if (!initialized) {
+synchronized (this) {
+if (!initialized) {
+socket = createClient();
+ByteChannel wrapper = new ByteChannelWrapper(socket);
+input = new 
DataInputStream(Channels.newInputStream(wrapper));
+output = new 
DataOutputStream(Channels.newOutputStream(wrapper));
+receiver = new Thread(this::receive);
+receiver.setDaemon(true);
+receiver.start();
+initialized = true;
+}
+}
+}
+}
+
+SocketChannel createClient() throws IOException {
+String familyProp = System.getProperty(IpcServer.SYSTEM_PROP_FAMILY, 
IpcServer.DEFAULT_FAMILY);
+SocketFamily family = familyProp != null ? 
SocketFamily.valueOf(familyProp) : SocketFamily.inet;
+
+Path lockPath = this.lockPath.toAbsolutePath().normalize();
+Path lockFile =
+lockPath.resolve(".maven-resolver-ipc-lock-" + 
family.name().toLowerCase());
+if (!Files.isRegularFile(lockFile)) {
+if (!Files.isDirectory(lockFile.getParent())) {
+Files.createDirectories(lockFile.getParent());
+}
+}
+
+try (RandomAccessFile raf = new RandomAccessFile(lockFile.toFile(), 
"rw")) {
+try (FileLock lock = raf.getChannel().lock()) {
+String line = raf.readLine();
+if (line != null) {
+try {
+SocketAddress addr

[jira] [Commented] (MSHARED-1330) Incremental builds fail on filtered read-only resources

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MSHARED-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821255#comment-17821255
 ] 

ASF GitHub Bot commented on MSHARED-1330:
-

gnodet commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504303426


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   > copyFilePermissions might belong in the public copyFile method above then. 
As is, that's not necessarily called.
   
   Not sure I understand your objection.  Are you implying that `private 
static` static methods should always be inlined ?  The only way the method 
would not be called is when an exception occurs afaik.





> Incremental builds fail on filtered read-only resources  
> -
>
> Key: MSHARED-1330
> URL: https://issues.apache.org/jira/browse/MSHARED-1330
> Project: Maven Shared Components
>  Issue Type: Bug
>  Components: maven-filtering
>Reporter: G.Vaysman
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
> Attachments: create-license.zip
>
>
> Under certain SCM's, such as Perforce, files under ./src are read-only. With 
> the latest maven-resources-plugin (3.3.1) which has maven-filtering 3.3.1 as 
> a dependency, filtered resources end up as read-only in ./target. Since 
> filtered resources are always updated in target, this fails with exception 
> below. This worked in maven-resources-plugin 2.7, but seems to break, at 
> least, starting from maven-resources-plugin 3.0.0. Additionally note, that 
> deprecating certain maven-filtering methods (copyFile, etc) that take the 
> Boolean _overwrite_ has broken the maven-resource-plugin contract for the 
> resources:resources (see 
> [https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html).]
> I am attaching a very simple project that demonstrates it. When unzipping, 
> make sure src/main/resources/license.txt is read-only. Execute mvn install 
> twice (without "clean") . It fails on both Windows and Linux.  
> Further, a kind of semi-independent issue is the following: if a module 
> contains multiple resources, some to be filtered and others not, a typical 
> Maven pattern is (abridged):
> {{   }}
> {{      }}
> {{        true}}
> {{         ...   }}
> {{      }}
> {{      }}
> {{        false}}
> {{         ...  }}
> {{      }}
> {{    }}
> This causes both filtered and unfiltered resources go through 
> maven-filtering, and it breaks incremental builds on unfiltered resources as 
> well.
> Error:
>  {{Caused by: java.io.FileNotFoundException: 
> D:\tmp\create-license\target\classes\license.txt (Access is denied)}}
> {{    at java.io.RandomAccessFile.open0 (Native Method)}}
> {{    at java.io.RandomAccessFile.open (RandomAccessFile.java:346)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:260)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:215)}}
> {{    at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:348)}}
> {{    at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:104)}}
> {{    at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:268)}}
> {{    at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:343)}}
> {{    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)}}
> {{    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210) }}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MSHARED-1330] Always overwrite files [maven-filtering]

2024-02-27 Thread via GitHub


gnodet commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504303426


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   > copyFilePermissions might belong in the public copyFile method above then. 
As is, that's not necessarily called.
   
   Not sure I understand your objection.  Are you implying that `private 
static` static methods should always be inlined ?  The only way the method 
would not be called is when an exception occurs afaik.



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



[jira] [Commented] (MSHARED-1330) Incremental builds fail on filtered read-only resources

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MSHARED-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821254#comment-17821254
 ] 

ASF GitHub Bot commented on MSHARED-1330:
-

gnodet commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504303426


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   > copyFilePermissions might belong in the public copyFile method above then. 
As is, that's not necessarily called.
   
   Not sure I understand your objection.  Are you implying that `private 
static` static methods should always be inlined ?





> Incremental builds fail on filtered read-only resources  
> -
>
> Key: MSHARED-1330
> URL: https://issues.apache.org/jira/browse/MSHARED-1330
> Project: Maven Shared Components
>  Issue Type: Bug
>  Components: maven-filtering
>Reporter: G.Vaysman
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
> Attachments: create-license.zip
>
>
> Under certain SCM's, such as Perforce, files under ./src are read-only. With 
> the latest maven-resources-plugin (3.3.1) which has maven-filtering 3.3.1 as 
> a dependency, filtered resources end up as read-only in ./target. Since 
> filtered resources are always updated in target, this fails with exception 
> below. This worked in maven-resources-plugin 2.7, but seems to break, at 
> least, starting from maven-resources-plugin 3.0.0. Additionally note, that 
> deprecating certain maven-filtering methods (copyFile, etc) that take the 
> Boolean _overwrite_ has broken the maven-resource-plugin contract for the 
> resources:resources (see 
> [https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html).]
> I am attaching a very simple project that demonstrates it. When unzipping, 
> make sure src/main/resources/license.txt is read-only. Execute mvn install 
> twice (without "clean") . It fails on both Windows and Linux.  
> Further, a kind of semi-independent issue is the following: if a module 
> contains multiple resources, some to be filtered and others not, a typical 
> Maven pattern is (abridged):
> {{   }}
> {{      }}
> {{        true}}
> {{         ...   }}
> {{      }}
> {{      }}
> {{        false}}
> {{         ...  }}
> {{      }}
> {{    }}
> This causes both filtered and unfiltered resources go through 
> maven-filtering, and it breaks incremental builds on unfiltered resources as 
> well.
> Error:
>  {{Caused by: java.io.FileNotFoundException: 
> D:\tmp\create-license\target\classes\license.txt (Access is denied)}}
> {{    at java.io.RandomAccessFile.open0 (Native Method)}}
> {{    at java.io.RandomAccessFile.open (RandomAccessFile.java:346)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:260)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:215)}}
> {{    at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:348)}}
> {{    at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:104)}}
> {{    at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:268)}}
> {{    at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:343)}}
> {{    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)}}
> {{    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210) }}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MSHARED-1330] Always overwrite files [maven-filtering]

2024-02-27 Thread via GitHub


gnodet commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504303426


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   > copyFilePermissions might belong in the public copyFile method above then. 
As is, that's not necessarily called.
   
   Not sure I understand your objection.  Are you implying that `private 
static` static methods should always be inlined ?



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



[jira] [Commented] (MSHARED-1330) Incremental builds fail on filtered read-only resources

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MSHARED-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821249#comment-17821249
 ] 

ASF GitHub Bot commented on MSHARED-1330:
-

elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504286180


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   copyFilePermissions might belong in the public copyFile method above then. 
As is, that's not necessarily called. 





> Incremental builds fail on filtered read-only resources  
> -
>
> Key: MSHARED-1330
> URL: https://issues.apache.org/jira/browse/MSHARED-1330
> Project: Maven Shared Components
>  Issue Type: Bug
>  Components: maven-filtering
>Reporter: G.Vaysman
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
> Attachments: create-license.zip
>
>
> Under certain SCM's, such as Perforce, files under ./src are read-only. With 
> the latest maven-resources-plugin (3.3.1) which has maven-filtering 3.3.1 as 
> a dependency, filtered resources end up as read-only in ./target. Since 
> filtered resources are always updated in target, this fails with exception 
> below. This worked in maven-resources-plugin 2.7, but seems to break, at 
> least, starting from maven-resources-plugin 3.0.0. Additionally note, that 
> deprecating certain maven-filtering methods (copyFile, etc) that take the 
> Boolean _overwrite_ has broken the maven-resource-plugin contract for the 
> resources:resources (see 
> [https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html).]
> I am attaching a very simple project that demonstrates it. When unzipping, 
> make sure src/main/resources/license.txt is read-only. Execute mvn install 
> twice (without "clean") . It fails on both Windows and Linux.  
> Further, a kind of semi-independent issue is the following: if a module 
> contains multiple resources, some to be filtered and others not, a typical 
> Maven pattern is (abridged):
> {{   }}
> {{      }}
> {{        true}}
> {{         ...   }}
> {{      }}
> {{      }}
> {{        false}}
> {{         ...  }}
> {{      }}
> {{    }}
> This causes both filtered and unfiltered resources go through 
> maven-filtering, and it breaks incremental builds on unfiltered resources as 
> well.
> Error:
>  {{Caused by: java.io.FileNotFoundException: 
> D:\tmp\create-license\target\classes\license.txt (Access is denied)}}
> {{    at java.io.RandomAccessFile.open0 (Native Method)}}
> {{    at java.io.RandomAccessFile.open (RandomAccessFile.java:346)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:260)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:215)}}
> {{    at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:348)}}
> {{    at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:104)}}
> {{    at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:268)}}
> {{    at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:343)}}
> {{    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)}}
> {{    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210) }}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MSHARED-1330] Always overwrite files [maven-filtering]

2024-02-27 Thread via GitHub


elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504286180


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   copyFilePermissions might belong in the public copyFile method above then. 
As is, that's not necessarily called. 



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



[jira] [Commented] (MSHARED-1330) Incremental builds fail on filtered read-only resources

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MSHARED-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821238#comment-17821238
 ] 

ASF GitHub Bot commented on MSHARED-1330:
-

gnodet commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504230487


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   It's not.  The permissions from the source file are copied, see 
https://github.com/apache/maven-filtering/blob/ac09a5bc42e7fe812b93106537372441a8cbd6b4/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java#L333
   That's why I did not bother initially with the exec flag.





> Incremental builds fail on filtered read-only resources  
> -
>
> Key: MSHARED-1330
> URL: https://issues.apache.org/jira/browse/MSHARED-1330
> Project: Maven Shared Components
>  Issue Type: Bug
>  Components: maven-filtering
>Reporter: G.Vaysman
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
> Attachments: create-license.zip
>
>
> Under certain SCM's, such as Perforce, files under ./src are read-only. With 
> the latest maven-resources-plugin (3.3.1) which has maven-filtering 3.3.1 as 
> a dependency, filtered resources end up as read-only in ./target. Since 
> filtered resources are always updated in target, this fails with exception 
> below. This worked in maven-resources-plugin 2.7, but seems to break, at 
> least, starting from maven-resources-plugin 3.0.0. Additionally note, that 
> deprecating certain maven-filtering methods (copyFile, etc) that take the 
> Boolean _overwrite_ has broken the maven-resource-plugin contract for the 
> resources:resources (see 
> [https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html).]
> I am attaching a very simple project that demonstrates it. When unzipping, 
> make sure src/main/resources/license.txt is read-only. Execute mvn install 
> twice (without "clean") . It fails on both Windows and Linux.  
> Further, a kind of semi-independent issue is the following: if a module 
> contains multiple resources, some to be filtered and others not, a typical 
> Maven pattern is (abridged):
> {{   }}
> {{      }}
> {{        true}}
> {{         ...   }}
> {{      }}
> {{      }}
> {{        false}}
> {{         ...  }}
> {{      }}
> {{    }}
> This causes both filtered and unfiltered resources go through 
> maven-filtering, and it breaks incremental builds on unfiltered resources as 
> well.
> Error:
>  {{Caused by: java.io.FileNotFoundException: 
> D:\tmp\create-license\target\classes\license.txt (Access is denied)}}
> {{    at java.io.RandomAccessFile.open0 (Native Method)}}
> {{    at java.io.RandomAccessFile.open (RandomAccessFile.java:346)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:260)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:215)}}
> {{    at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:348)}}
> {{    at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:104)}}
> {{    at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:268)}}
> {{    at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:343)}}
> {{    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)}}
> {{    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210) }}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] [MSHARED-1330] Always overwrite files [maven-filtering]

2024-02-27 Thread via GitHub


gnodet commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504230487


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   It's not.  The permissions from the source file are copied, see 
https://github.com/apache/maven-filtering/blob/ac09a5bc42e7fe812b93106537372441a8cbd6b4/src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java#L333
   That's why I did not bother initially with the exec flag.



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



[jira] [Commented] (MSHARED-1330) Incremental builds fail on filtered read-only resources

2024-02-27 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MSHARED-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821210#comment-17821210
 ] 

ASF GitHub Bot commented on MSHARED-1330:
-

elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504163149


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   I think the copied file is now world readable and writable when everything 
completes. That might leave arbitrary world writable files sitting around in 
the file system, which feels risky. Can this work without world or even group 
permissions? And/or can the file be set back to owner only after the copy 
finishes?
   
   



##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {

Review Comment:
   makeWriteable as it no longer sets all permissions





> Incremental builds fail on filtered read-only resources  
> -
>
> Key: MSHARED-1330
> URL: https://issues.apache.org/jira/browse/MSHARED-1330
> Project: Maven Shared Components
>  Issue Type: Bug
>  Components: maven-filtering
>Reporter: G.Vaysman
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
> Attachments: create-license.zip
>
>
> Under certain SCM's, such as Perforce, files under ./src are read-only. With 
> the latest maven-resources-plugin (3.3.1) which has maven-filtering 3.3.1 as 
> a dependency, filtered resources end up as read-only in ./target. Since 
> filtered resources are always updated in target, this fails with exception 
> below. This worked in maven-resources-plugin 2.7, but seems to break, at 
> least, starting from maven-resources-plugin 3.0.0. Additionally note, that 
> deprecating certain maven-filtering methods (copyFile, etc) that take the 
> Boolean _overwrite_ has broken the maven-resource-plugin contract for the 
> resources:resources (see 
> [https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html).]
> I am attaching a very simple project that demonstrates it. When unzipping, 
> make sure src/main/resources/license.txt is read-only. Execute mvn install 
> twice (without "clean") . It fails on both Windows and Linux.  
> Further, a kind of semi-independent issue is the following: if a module 
> contains multiple resources, some to be filtered and others not, a typical 
> Maven pattern is (abridged):
> {{   }}
> {{      }}
> {{        true}}
> {{         ...   }}
> {{      }}
> {{      }}
> {{        false}}
> {{         ...  }}
> {{      }}
> {{    }}
> This causes both filtered and unfiltered resources go through 
> maven-filtering, and it breaks incremental builds on unfiltered resources as 
> well.
> Error:
>  {{Caused by: java.io.FileNotFoundException: 
> D:\tmp\create-license\target\classes\license.txt (Access is denied)}}
> {{    at java.io.RandomAccessFile.open0 (Native Method)}}
> {{    at java.io.RandomAccessFile.open (RandomAccessFile.java:346)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:260)}}
> {{    at java.io.RandomAccessFile. (RandomAccessFile.java:215)}}
> {{    at org.apache.maven.shared.filtering.FilteringUtils.copyFile 
> (FilteringUtils.java:348)}}
> {{    at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile 
> (DefaultMavenFileFilter.java:104)}}
> {{    at 
> org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources
>  (DefaultMavenResourcesFiltering.java:268)}}
> {{    at org.apache.maven.plugins.resources.ResourcesMojo.execute 
> (ResourcesMojo.java:343)}}
> {{    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)}}
> {{    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java

Re: [PR] [MSHARED-1330] Always overwrite files [maven-filtering]

2024-02-27 Thread via GitHub


elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504163149


##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {
+if (file.exists()) {
+try {
+Files.setPosixFilePermissions(
+file.toPath(),
+EnumSet.of(
+PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   I think the copied file is now world readable and writable when everything 
completes. That might leave arbitrary world writable files sitting around in 
the file system, which feels risky. Can this work without world or even group 
permissions? And/or can the file be set back to owner only after the copy 
finishes?
   
   



##
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
 }
 }
 
+@SuppressWarnings("ResultOfMethodCallIgnored")
+private static void setAllPermissions(File file) throws IOException {

Review Comment:
   makeWriteable as it no longer sets all permissions



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



[jira] [Assigned] (DOXIA-730) Update Asciidoctor Doxia Modules in doxia-site

2024-02-27 Thread Michael Osipov (Jira)


 [ 
https://issues.apache.org/jira/browse/DOXIA-730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov reassigned DOXIA-730:


Assignee: Sylwester Lachiewicz

> Update Asciidoctor Doxia Modules in doxia-site
> --
>
> Key: DOXIA-730
> URL: https://issues.apache.org/jira/browse/DOXIA-730
> Project: Maven Doxia
>  Issue Type: Improvement
>Reporter: Abel Salgado Romero
>Assignee: Sylwester Lachiewicz
>Priority: Major
> Fix For: 2.0.0, 2.0.0-M10
>
>
> In v3.0.0, we renamed the current module and created a new one.
> I am working on a PR to update the page 
> https://maven.apache.org/doxia/references/index.html



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] Bump org.apache.jackrabbit:jackrabbit-webdav from 2.14.4 to 2.21.24 [maven-wagon]

2024-02-27 Thread via GitHub


dependabot[bot] closed pull request #103: Bump 
org.apache.jackrabbit:jackrabbit-webdav from 2.14.4 to 2.21.24
URL: https://github.com/apache/maven-wagon/pull/103


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



[PR] Bump org.apache.jackrabbit:jackrabbit-webdav from 2.14.4 to 2.21.25 [maven-wagon]

2024-02-27 Thread via GitHub


dependabot[bot] opened a new pull request, #104:
URL: https://github.com/apache/maven-wagon/pull/104

   Bumps 
[org.apache.jackrabbit:jackrabbit-webdav](https://github.com/apache/jackrabbit) 
from 2.14.4 to 2.21.25.
   
   Changelog
   Sourced from https://github.com/apache/jackrabbit/blob/trunk/RELEASE-NOTES.txt";>org.apache.jackrabbit:jackrabbit-webdav's
 changelog.
   
   Changes in Jackrabbit 2.21.25
   Bug
   [JCR-5024] - webapp: un-deprecate BootstrapConfig.getJndiConfig 
and RepositoryAccessServlet.getRepositoryByJNDI
   
   Task
   [JCR-5025] - standalone: deprecate remote repository support (RMI 
and JNDI)
   [JCR-5029] - update aws java sdk version to 1.12.659
   
   For more detailed information about all the changes in this and other
   Jackrabbit releases, please see the Jackrabbit issue tracker at
   https://issues.apache.org/jira/browse/JCR
   
   Release Contents
   This release consists of a single source archive packaged as a zip file.
   The archive can be unpacked with the jar tool from your JDK installation.
   See the README.txt file for instructions on how to build this release.
   The source archive is accompanied by an SHA512 checksum and a
   PGP signature that you can use to verify the authenticity of your
   download. The public key used for the PGP signature can be found at
   https://www.apache.org/dist/jackrabbit/KEYS";>https://www.apache.org/dist/jackrabbit/KEYS.
   About Apache Jackrabbit
   Apache Jackrabbit is a fully conforming implementation of the Content
   Repository for Java Technology API (JCR). A content repository is a
   hierarchical content store with support for structured and unstructured
   content, full text search, versioning, transactions, observation, and
   more.
   For more information, visit http://jackrabbit.apache.org/";>http://jackrabbit.apache.org/
   About The Apache Software Foundation
   Established in 1999, The Apache Software Foundation provides 
organizational,
   legal, and financial support for more than 140 freely-available,
   collaboratively-developed Open Source projects. The pragmatic Apache License
   enables individual and commercial users to easily deploy Apache software;
   the Foundation's intellectual property framework limits the legal exposure
   of its 3,800+ contributors.
   
   
   ... (truncated)
   
   
   Commits
   
   https://github.com/apache/jackrabbit/commit/3245f8e98ba50a5311d3ad00ca7a478959233df2";>3245f8e
 [maven-release-plugin] prepare release jackrabbit-2.21.25
   https://github.com/apache/jackrabbit/commit/75f354ea66d3ba96ffac9684a670d6789c05b1f7";>75f354e
 JCR-5031: Release Jackrabbit 2.21.25 - Candidate Release Notes
   https://github.com/apache/jackrabbit/commit/1422d92b1467073e9c68f605f2e8bae530ec3326";>1422d92
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/jackrabbit/commit/d30d499f2bea07955caec7a5a9a434265437228b";>d30d499
 [maven-release-plugin] prepare release jackrabbit-2.21.24
   https://github.com/apache/jackrabbit/commit/7a075db1225a6e3143b9334ee32cfbf7cc74c82b";>7a075db
 JCR-5029: update aws java sdk version to 1.12.659 (https://redirect.github.com/apache/jackrabbit/issues/164";>#164)
   https://github.com/apache/jackrabbit/commit/3baf3b6a96b4ef9b4994f575777d501ab7506747";>3baf3b6
 JCR-5025: standalone: deprecate remote repository support (RMI and JNDI)
   https://github.com/apache/jackrabbit/commit/8159e73e6cf423dc4aef1ebb0e64d52901b1707f";>8159e73
 JCR-5024: webapp: un-deprecate RepositoryAccessServlet.getRepositoryByJNDI 
(#...
   https://github.com/apache/jackrabbit/commit/5bce7e2cf5095ba85790b3773fb29ca6e8560762";>5bce7e2
 JCR-5024: webapp: un-deprecate BootstrapConfig.getJndiConfig (https://redirect.github.com/apache/jackrabbit/issues/159";>#159)
   https://github.com/apache/jackrabbit/commit/866035bee64319f3545b54c5cc7fbd3e8be77cdf";>866035b
 [maven-release-plugin] prepare for next development iteration
   https://github.com/apache/jackrabbit/commit/71121aca964a00602bd51e3570f7102bfc5c540d";>71121ac
 [maven-release-plugin] prepare release jackrabbit-2.21.23
   Additional commits viewable in https://github.com/apache/jackrabbit/compare/jackrabbit-2.14.4...jackrabbit-2.21.25";>compare
 view
   
   
   
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.jackrabbit:jackrabbit-webdav&package-manager=maven&previous-version=2.14.4&new-version=2.21.25)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `

Re: [PR] Bump org.apache.jackrabbit:jackrabbit-webdav from 2.14.4 to 2.21.24 [maven-wagon]

2024-02-27 Thread via GitHub


dependabot[bot] commented on PR #103:
URL: https://github.com/apache/maven-wagon/pull/103#issuecomment-1966042896

   Superseded by #104.


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