[jira] [Commented] (MGPG-113) Upgrading from 3.1.0 to 3.2.1 with no other changes causes "gpg:sign-and-deploy-file" failed: 401 Unauthorized

2024-03-22 Thread Greg Knox (Jira)


[ 
https://issues.apache.org/jira/browse/MGPG-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17830016#comment-17830016
 ] 

Greg Knox commented on MGPG-113:


+1 on this ticket.

I encountered the same error deploying to maven central when using a 
{{  gpg:sign-and-deploy-file}} 
goal from the cmdline, which ended up using 
maven-gpg-plugin:3.2.1:sign-and-deploy-file.

I was able to downgrade to an earlier version of the plugin by specifying 
{{  org.apache.maven.plugins:maven-gpg-plugin:3.1.0:sign-and-deploy-file}}  
as the goal, then the file deployed successfully.

 

Error logs:

{{C:\Users\knoxg>c:/java/prog/apache-maven-3.8.4/bin/mvn -B --settings 
c:/users/knoxg/.m2/settings-randomnoun.xml 
-Durl=[https://oss.sonatype.org/service/local/staging/deploy/maven2/] 
-DrepositoryId=sonatype-nexus-staging 
-DpomFile=c:/transfer/common-public-1.0.22.pom 
-Dfile=c:/transfer/common-public-1.0.22-sources.jar -Dclassifier=sources 
-Dpackaging=jar gpg:sign-and-deploy-file
[INFO] Scanning for projects...
[INFO]
[INFO] --< org.apache.maven:standalone-pom >---
[INFO] Building Maven Stub Project (No POM) 1
[INFO] [ pom ]-
[INFO]
[INFO] --- maven-gpg-plugin:3.2.0:sign-and-deploy-file (default-cli) @ 
standalone-pom ---
[INFO] Signer 'gpg' is signing 2 files
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22-sources.jar]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22.pom]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22-sources.jar.asc]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22.pom.asc]
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time:  4.671 s
[INFO] Finished at: 2024-03-15T08:36:55+10:00
[INFO] 
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-gpg-plugin:3.2.0:sign-and-deploy-file 
(default-cli) on project standalone-pom: Error deploying attached artifacts 
[com.randomnoun.common:common-public:jar:sources:1.0.22, 
com.randomnoun.common:common-public:pom:1.0.22, 
com.randomnoun.common:common-public:jar.asc:sources:1.0.22, 
com.randomnoun.common:common-public:pom.asc:1.0.22]: Failed to deploy 
artifacts: Could not transfer artifact 
com.randomnoun.common:common-public:jar:sources:1.0.22 from/to 
sonatype-nexus-staging 
([https://oss.sonatype.org/service/local/staging/deploy/maven2/]): 
authentication failed for 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22-sources.jar],
 status: 401 Unauthorized -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
[http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException]}}

 

and with -X enabled I got this stacktrace:

 

{{[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22-sources.jar]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22.pom]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22-sources.jar.asc]
[INFO] Uploading to sonatype-nexus-staging: 
[https://oss.sonatype.org/service/local/staging/deploy/maven2/com/randomnoun/common/common-public/1.0.22/common-public-1.0.22.pom.asc]
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time:  5.210 s
[INFO] Finished at: 2024-03-16T08:09:44+10:00
[INFO] 
[ERROR] Failed to execute goal 

Re: [PR] [MDEP-317] - add mojo to analyze invalid exclusions [maven-dependency-plugin]

2024-03-22 Thread via GitHub


vbreivik commented on code in PR #362:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/362#discussion_r1536429662


##
src/test/java/org/apache/maven/plugins/dependency/exclusion/AnalyzeExclusionsMojoTest.java:
##
@@ -0,0 +1,365 @@
+/*
+ * 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.dependency.exclusion;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Exclusion;
+import org.apache.maven.plugin.LegacySupport;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.dependency.AbstractDependencyMojoTestCase;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingResult;
+
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Sets.newHashSet;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatCode;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyBoolean;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public class AnalyzeExclusionsMojoTest extends AbstractDependencyMojoTestCase {
+
+AnalyzeExclusionsMojo mojo;
+MavenProject project;
+private TestLog testLog;
+
+@Override
+public void setUp() throws Exception {
+super.setUp("analyze-exclusions", true, false);
+File testPom = new File(getBasedir(), 
"target/test-classes/unit/analyze-exclusions/plugin-config.xml");
+mojo = (AnalyzeExclusionsMojo) lookupMojo("analyze-exclusions", 
testPom);
+assertNotNull(mojo);
+project = (MavenProject) getVariableValueFromObject(mojo, "project");
+MavenSession session = newMavenSession(project);
+setVariableValueToObject(mojo, "session", session);
+
+LegacySupport legacySupport = lookup(LegacySupport.class);
+legacySupport.setSession(session);
+installLocalRepository(legacySupport);
+
+testLog = new TestLog();
+mojo.setLog(testLog);
+}
+
+public void test_shall_throw_exception_when_fail_on_warning() throws 
Exception {

Review Comment:
   Changed to camelCase



-- 
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] [MDEP-317] - add mojo to analyze invalid exclusions [maven-dependency-plugin]

2024-03-22 Thread via GitHub


vbreivik commented on code in PR #362:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/362#discussion_r1536429153


##
src/test/java/org/apache/maven/plugins/dependency/exclusion/AnalyzeExclusionsMojoTest.java:
##
@@ -0,0 +1,365 @@
+/*
+ * 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.dependency.exclusion;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Exclusion;
+import org.apache.maven.plugin.LegacySupport;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.dependency.AbstractDependencyMojoTestCase;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingResult;
+
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Sets.newHashSet;

Review Comment:
   Ok, changed. Readability is a bit worse - can be improved when bumping to 9+



-- 
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] [MDEP-317] - add mojo to analyze invalid exclusions [maven-dependency-plugin]

2024-03-22 Thread via GitHub


vbreivik commented on code in PR #362:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/362#discussion_r1536428229


##
src/it/projects/analyze-invalid-exclude/pom.xml:
##
@@ -0,0 +1,95 @@
+
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  4.0.0
+
+  org.apache.maven.its.dependency
+  test
+  1.0-SNAPSHOT
+
+  Test
+  
+Test dependency:analyze-exclusion
+  
+
+  
+UTF-8
+  
+
+  
+
+  org.apache.maven
+  maven-project
+  2.0.6

Review Comment:
   Was copy and paste from some other test in that folder. Bumped to more 
recent versions



-- 
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] [MDEP-317] - add mojo to analyze invalid exclusions [maven-dependency-plugin]

2024-03-22 Thread via GitHub


vbreivik commented on code in PR #362:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/362#discussion_r1536212500


##
src/main/java/org/apache/maven/plugins/dependency/exclusion/Coordinates.java:
##
@@ -0,0 +1,101 @@
+/*
+ * 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.dependency.exclusion;
+
+import java.lang.reflect.Proxy;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
+import java.util.Objects;
+import java.util.function.Predicate;
+
+/**
+ * Simple "record" to hold the coordinates of the dependency which is excluded.
+ * 
+ * When dealing with exclusions the version is not important. Only groupId and 
artifactId is used.
+ * 
+ */
+class Coordinates {
+private final String groupId;
+private final String artifactId;
+
+private Coordinates(String groupId, String artifactId) {
+this.groupId = groupId;
+this.artifactId = artifactId;
+}
+
+public static Coordinates coordinates(String groupId, String artifactId) {
+return new Coordinates(groupId, artifactId);
+}
+
+public String getGroupId() {
+return groupId;
+}
+
+public String getArtifactId() {
+return artifactId;
+}
+
+Predicate getExclusionPattern() {
+PathMatcher groupId = FileSystems.getDefault().getPathMatcher("glob:" 
+ getGroupId());
+PathMatcher artifactId = 
FileSystems.getDefault().getPathMatcher("glob:" + getArtifactId());
+Predicate predGroupId = a -> 
groupId.matches(createPathProxy(a.getGroupId()));
+Predicate predArtifactId = a -> 
artifactId.matches(createPathProxy(a.getArtifactId()));
+
+return predGroupId.and(predArtifactId);
+}
+
+/**
+ * In order to reuse the glob matcher from the filesystem, we need
+ * to create Path instances.  Those are only used with the toString method.
+ * This hack works because the only system-dependent thing is the path
+ * separator which should not be part of the groupId or artifactId.
+ */

Review Comment:
   That entire segment is actually copied from maven-core 
[ExclusionArtifactFilter.java](https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionArtifactFilter.java#L60)
   So when this plugin upgrades, this can swapped out to use that filter. 



-- 
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] [Updated] (MDEP-810) dependency: tree doesn't show list of dependencies of specific project

2024-03-22 Thread Slawomir Jaranowski (Jira)


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

Slawomir Jaranowski updated MDEP-810:
-
Fix Version/s: waiting-for-feedback

> dependency: tree doesn't show list of dependencies of specific project
> --
>
> Key: MDEP-810
> URL: https://issues.apache.org/jira/browse/MDEP-810
> Project: Maven Dependency Plugin
>  Issue Type: New Feature
>  Components: tree
>Reporter: RAVI KANT SHARMA
>Priority: Major
> Fix For: waiting-for-feedback
>
>
> Suppose, I have two project in my organization XYZ i.e. myproject1, 
> myproject2. Below is the project structure :
> *myproject1 (com.xyz.myproject1)*
>   - com.xyz.myproject1.service1 (3PP used, lets say a.jar)
>   - com.xyz.myproject1.service2 (3PP used, lets say b.jar)
>   - com.xyz.myproject1.service3 (3PP used, lets say a.jar)
> *myproject2 (com.xyz.myproject2)*
>   - com.xyz.myproject2.service1 (3PP used, lets say e.jar)
>   - com.xyz.myproject2.service2 (3PP used, lets say c.jar)
>   - com.xyz.myproject2.service3 (3PP used, lets say d.jar)
> There should be a feature to filter list of dependencies for 
> com.xyz.myproject1.



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


[jira] [Commented] (MDEP-721) Document verbose option

2024-03-22 Thread Slawomir Jaranowski (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829987#comment-17829987
 ] 

Slawomir Jaranowski commented on MDEP-721:
--

Maybe this one should be reverted and updated: 
https://github.com/apache/maven-dependency-plugin/commit/6adc71cceb0cc8bfc05d0b6d1ff72652d7e39f33

> Document verbose option
> ---
>
> Key: MDEP-721
> URL: https://issues.apache.org/jira/browse/MDEP-721
> Project: Maven Dependency Plugin
>  Issue Type: Improvement
>  Components: tree
>Affects Versions: 3.1.3
>Reporter: Elliotte Rusty Harold
>Priority: Major
>  Labels: intern
> Fix For: waiting-for-feedback
>
>
> MDEP-671
> https://issues.apache.org/jira/browse/MDEP-644



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


[jira] [Commented] (MJAR-62) Build-Jdk in Manifest.mf does not reflect which compiler version actually compiled the classes in the jar

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MJAR-62:


elharo commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1536163772


##
src/main/java/org/apache/maven/plugins/jar/ToolchainsJdkSpecification.java:
##
@@ -0,0 +1,99 @@
+/*
+ * 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.jar;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * Component provided JDK specification based on toolchains.
+ */
+@Named
+@Singleton
+class ToolchainsJdkSpecification {
+
+private static class UncheckedCommandLineException extends 
RuntimeException {
+UncheckedCommandLineException(CommandLineException e) {
+super(e);
+}
+}
+
+private final Map cache = new HashMap<>();
+
+public synchronized Optional getJDKSpecification(Toolchain 
toolchain) {
+Optional javacPath = getJavacPath(toolchain);
+return javacPath.map(path -> cache.computeIfAbsent(path, 
this::getSpecForPath));
+}
+
+private Optional getJavacPath(Toolchain toolchain) {
+return 
Optional.ofNullable(toolchain.findTool("javac")).map(Paths::get).map(this::getCanonicalPath);
+}
+
+private Path getCanonicalPath(Path path) {
+try {
+return path.toRealPath();
+} catch (IOException e) {
+if (path.getParent() != null) {
+return 
getCanonicalPath(path.getParent()).resolve(path.getFileName());
+} else {
+throw new UncheckedIOException(e);
+}
+}
+}
+
+private String getSpecForPath(Path path) {
+try {
+Commandline cl = new Commandline(path.toString());
+cl.createArg().setValue("-version");
+CommandLineUtils.StringStreamConsumer out = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.StringStreamConsumer err = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.executeCommandLine(cl, out, err);
+String version = out.getOutput().trim();
+if (version.isEmpty()) {
+version = err.getOutput().trim();
+}
+if (version.startsWith("javac ")) {
+version = version.substring(6);
+if (version.startsWith("1.")) {
+version = version.substring(0, 3);
+} else {
+version = version.substring(0, 2);
+}
+return version;
+} else {
+return null;
+}
+} catch (CommandLineException e) {
+throw new UncheckedCommandLineException(e);

Review Comment:
   Since you're already returning null in line 93, it might make sense to 
return null here as well. 



##
src/main/java/org/apache/maven/plugins/jar/ToolchainsJdkSpecification.java:
##
@@ -0,0 +1,99 @@
+/*
+ * 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
+ * 

Re: [PR] [MJAR-62] Set Build-Jdk according to used toolchain [maven-jar-plugin]

2024-03-22 Thread via GitHub


elharo commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1536163772


##
src/main/java/org/apache/maven/plugins/jar/ToolchainsJdkSpecification.java:
##
@@ -0,0 +1,99 @@
+/*
+ * 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.jar;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * Component provided JDK specification based on toolchains.
+ */
+@Named
+@Singleton
+class ToolchainsJdkSpecification {
+
+private static class UncheckedCommandLineException extends 
RuntimeException {
+UncheckedCommandLineException(CommandLineException e) {
+super(e);
+}
+}
+
+private final Map cache = new HashMap<>();
+
+public synchronized Optional getJDKSpecification(Toolchain 
toolchain) {
+Optional javacPath = getJavacPath(toolchain);
+return javacPath.map(path -> cache.computeIfAbsent(path, 
this::getSpecForPath));
+}
+
+private Optional getJavacPath(Toolchain toolchain) {
+return 
Optional.ofNullable(toolchain.findTool("javac")).map(Paths::get).map(this::getCanonicalPath);
+}
+
+private Path getCanonicalPath(Path path) {
+try {
+return path.toRealPath();
+} catch (IOException e) {
+if (path.getParent() != null) {
+return 
getCanonicalPath(path.getParent()).resolve(path.getFileName());
+} else {
+throw new UncheckedIOException(e);
+}
+}
+}
+
+private String getSpecForPath(Path path) {
+try {
+Commandline cl = new Commandline(path.toString());
+cl.createArg().setValue("-version");
+CommandLineUtils.StringStreamConsumer out = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.StringStreamConsumer err = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.executeCommandLine(cl, out, err);
+String version = out.getOutput().trim();
+if (version.isEmpty()) {
+version = err.getOutput().trim();
+}
+if (version.startsWith("javac ")) {
+version = version.substring(6);
+if (version.startsWith("1.")) {
+version = version.substring(0, 3);
+} else {
+version = version.substring(0, 2);
+}
+return version;
+} else {
+return null;
+}
+} catch (CommandLineException e) {
+throw new UncheckedCommandLineException(e);

Review Comment:
   Since you're already returning null in line 93, it might make sense to 
return null here as well. 



##
src/main/java/org/apache/maven/plugins/jar/ToolchainsJdkSpecification.java:
##
@@ -0,0 +1,99 @@
+/*
+ * 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.jar;
+
+import javax.inject.Named;
+import 

[jira] [Commented] (MENFORCER-500) New rule: Maven coordinates must match pattern

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MENFORCER-500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829979#comment-17829979
 ] 

ASF GitHub Bot commented on MENFORCER-500:
--

kwin opened a new pull request, #309:
URL: https://github.com/apache/maven-enforcer/pull/309

   patterns
   
   Optionally allows to enforce the module directory name being equal to the 
module's artifactId.
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MENFORCER) filed 
  for the change (usually before you start working on it).  Trivial 
changes like typos do not 
  require a JIRA issue.  Your pull request should address just this 
issue, without 
  pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[MENFORCER-XXX] - Fixes bug in 
ApproximateQuantiles`,
  where you replace `MENFORCER-XXX` with the appropriate JIRA issue. 
Best practice
  is to use the JIRA issue title in the pull request title and in the 
first line of the 
  commit message.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will 
  be performed on your pull request automatically.
- [ ] You have run the integration tests successfully (`mvn -Prun-its clean 
verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](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.
   
- [ ] 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)
   
- [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   




> New rule: Maven coordinates must match pattern
> --
>
> Key: MENFORCER-500
> URL: https://issues.apache.org/jira/browse/MENFORCER-500
> Project: Maven Enforcer Plugin
>  Issue Type: Improvement
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
>Priority: Major
>
> Sometimes it is crucial that the {{groupId}} and/or the {{artifactId}} match 
> a certain pattern (e.g. because it is reserved namespace prefix for deploying 
> to Maven Central). It would be beneficial to enforce that with a standard 
> rule.
> The pattern should be a configurable regex pattern (independently for 
> {{artifactId}} and {{groupId}})



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


[PR] [MENFORCER-500] New rule to enforce that Maven coordinates match given [maven-enforcer]

2024-03-22 Thread via GitHub


kwin opened a new pull request, #309:
URL: https://github.com/apache/maven-enforcer/pull/309

   patterns
   
   Optionally allows to enforce the module directory name being equal to the 
module's artifactId.
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MENFORCER) filed 
  for the change (usually before you start working on it).  Trivial 
changes like typos do not 
  require a JIRA issue.  Your pull request should address just this 
issue, without 
  pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[MENFORCER-XXX] - Fixes bug in 
ApproximateQuantiles`,
  where you replace `MENFORCER-XXX` with the appropriate JIRA issue. 
Best practice
  is to use the JIRA issue title in the pull request title and in the 
first line of the 
  commit message.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will 
  be performed on your pull request automatically.
- [ ] You have run the integration tests successfully (`mvn -Prun-its clean 
verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](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.
   
- [ ] 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)
   
- [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   


-- 
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] [MDEP-317] - add mojo to analyze invalid exclusions [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on code in PR #362:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/362#discussion_r1536078311


##
src/it/projects/analyze-invalid-exclude/pom.xml:
##
@@ -0,0 +1,95 @@
+
+
+
+http://maven.apache.org/POM/4.0.0;
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  4.0.0
+
+  org.apache.maven.its.dependency
+  test
+  1.0-SNAPSHOT
+
+  Test
+  
+Test dependency:analyze-exclusion
+  
+
+  
+UTF-8
+  
+
+  
+
+  org.apache.maven
+  maven-project
+  2.0.6

Review Comment:
   even in test please use more actual versions



##
src/test/java/org/apache/maven/plugins/dependency/exclusion/AnalyzeExclusionsMojoTest.java:
##
@@ -0,0 +1,365 @@
+/*
+ * 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.dependency.exclusion;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Exclusion;
+import org.apache.maven.plugin.LegacySupport;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.dependency.AbstractDependencyMojoTestCase;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingResult;
+
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Sets.newHashSet;

Review Comment:
   Please don't use guava, technically it is available by transitive 
dependencies



##
src/main/java/org/apache/maven/plugins/dependency/exclusion/Coordinates.java:
##
@@ -0,0 +1,101 @@
+/*
+ * 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.dependency.exclusion;
+
+import java.lang.reflect.Proxy;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
+import java.util.Objects;
+import java.util.function.Predicate;
+
+/**
+ * Simple "record" to hold the coordinates of the dependency which is excluded.
+ * 
+ * When dealing with exclusions the version is not important. Only groupId and 
artifactId is used.
+ * 
+ */
+class Coordinates {
+private final String groupId;
+private final String artifactId;
+
+private Coordinates(String groupId, String artifactId) {
+this.groupId = groupId;
+this.artifactId = artifactId;
+}
+
+public static Coordinates coordinates(String groupId, String artifactId) {
+return new Coordinates(groupId, artifactId);
+}
+
+public String getGroupId() {
+return groupId;
+}
+
+public String getArtifactId() {
+return artifactId;
+}
+
+Predicate getExclusionPattern() {
+PathMatcher groupId = FileSystems.getDefault().getPathMatcher("glob:" 
+ getGroupId());
+PathMatcher artifactId = 
FileSystems.getDefault().getPathMatcher("glob:" + getArtifactId());
+Predicate predGroupId = a -> 
groupId.matches(createPathProxy(a.getGroupId()));
+Predicate predArtifactId = a -> 

[jira] [Commented] (MDEP-648) list-repositories should point to the file that repository is specified in

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829972#comment-17829972
 ] 

ASF GitHub Bot commented on MDEP-648:
-

slawekjaranowski closed pull request #50: [MDEP-648] Add location of listed 
repository.
URL: https://github.com/apache/maven-dependency-plugin/pull/50




> list-repositories should point to the file that repository is specified in
> --
>
> Key: MDEP-648
> URL: https://issues.apache.org/jira/browse/MDEP-648
> Project: Maven Dependency Plugin
>  Issue Type: Improvement
>  Components: list-repositories
>Affects Versions: 3.1.1
>Reporter: Evgeny Bovykin
>Priority: Major
>
> When I run mvn dependency:list-repositories I'd like to see in which file 
> each repository is specified.
> My use case: I'd like to change all repositories from using http to using 
> https for security reasons. When repository is specified in my pom.xml it's 
> pretty easy to find and fix. But if it's specified in some plugin I'm using I 
> have to go on full adventure trying to find it.
> It would be much easier if list-repositories just printed "Repository 
> [http://...|http://.../] at plugin maven-some-plugin" or "Repository 
> [http://...|http://.../] at some/pom.xml"



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


[jira] [Commented] (MDEP-648) list-repositories should point to the file that repository is specified in

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829971#comment-17829971
 ] 

ASF GitHub Bot commented on MDEP-648:
-

slawekjaranowski commented on PR #50:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/50#issuecomment-2015740234

   @pmoerenhout thanks also for efforts on it ... we should not use 
maven-artifact-transfer at all
   It should be reimplemented with using direct resolver API like I did in 
https://github.com/apache/maven-dependency-plugin/pull/301
   
   So I close it now.




> list-repositories should point to the file that repository is specified in
> --
>
> Key: MDEP-648
> URL: https://issues.apache.org/jira/browse/MDEP-648
> Project: Maven Dependency Plugin
>  Issue Type: Improvement
>  Components: list-repositories
>Affects Versions: 3.1.1
>Reporter: Evgeny Bovykin
>Priority: Major
>
> When I run mvn dependency:list-repositories I'd like to see in which file 
> each repository is specified.
> My use case: I'd like to change all repositories from using http to using 
> https for security reasons. When repository is specified in my pom.xml it's 
> pretty easy to find and fix. But if it's specified in some plugin I'm using I 
> have to go on full adventure trying to find it.
> It would be much easier if list-repositories just printed "Repository 
> [http://...|http://.../] at plugin maven-some-plugin" or "Repository 
> [http://...|http://.../] at some/pom.xml"



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


Re: [PR] [MDEP-648] Add location of listed repository. [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski closed pull request #50: [MDEP-648] Add location of listed 
repository.
URL: https://github.com/apache/maven-dependency-plugin/pull/50


-- 
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] [MDEP-648] Add location of listed repository. [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on PR #50:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/50#issuecomment-2015740234

   @pmoerenhout thanks also for efforts on it ... we should not use 
maven-artifact-transfer at all
   It should be reimplemented with using direct resolver API like I did in 
https://github.com/apache/maven-dependency-plugin/pull/301
   
   So I close it 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] (MDEP-894) Use @Component instead of @Parameter for session/project

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829968#comment-17829968
 ] 

ASF GitHub Bot commented on MDEP-894:
-

slawekjaranowski merged PR #360:
URL: https://github.com/apache/maven-dependency-plugin/pull/360




> Use @Component instead of @Parameter for session/project
> 
>
> Key: MDEP-894
> URL: https://issues.apache.org/jira/browse/MDEP-894
> Project: Maven Dependency Plugin
>  Issue Type: Improvement
>Affects Versions: 3.6.1
>Reporter: Karl Heinz Marbaise
>Assignee: Karl Heinz Marbaise
>Priority: Minor
> Fix For: 3.6.2
>
>




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


Re: [PR] [MDEP-894] Use `@Component` only - fix tests [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski merged PR #360:
URL: https://github.com/apache/maven-dependency-plugin/pull/360


-- 
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-8081) default profile activation should consider available system and user properties

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MNG-8081:
-

mbenson commented on PR #1446:
URL: https://github.com/apache/maven/pull/1446#issuecomment-2015691625

   Here is the version that enhances `DefaultModelBuilder`. Can anyone offer 
ideas on the likely shape of unit tests for this approach?




> default profile activation should consider available system and user 
> properties
> ---
>
> Key: MNG-8081
> URL: https://issues.apache.org/jira/browse/MNG-8081
> Project: Maven
>  Issue Type: Improvement
>  Components: Profiles
>Affects Versions: 3.9.6, 4.0.0
>Reporter: Matthew Jason Benson
>Priority: Minor
>
> As discussed in my open PR, my use case is to compare between environment 
> variables e.g.:
> {code:java}
> 
>   
> env.FOO
> ${env.BAR}
>   
> {code}
> Limiting the interpolation to user/system properties means that there is no 
> mindf*ck resulting from profile activation order, etc., and keeps this 
> request nonthreatening.



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


Re: [PR] [MNG-8081] interpolate available properties during default profile selection (Maven 4.x) [maven]

2024-03-22 Thread via GitHub


mbenson commented on PR #1446:
URL: https://github.com/apache/maven/pull/1446#issuecomment-2015691625

   Here is the version that enhances `DefaultModelBuilder`. Can anyone offer 
ideas on the likely shape of unit tests for this approach?


-- 
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] (MDEP-894) Use @Component instead of @Parameter for session/project

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829961#comment-17829961
 ] 

ASF GitHub Bot commented on MDEP-894:
-

slawekjaranowski commented on PR #360:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/360#issuecomment-2015687301

   rebased and use latest released versions of m-plugin-tools




> Use @Component instead of @Parameter for session/project
> 
>
> Key: MDEP-894
> URL: https://issues.apache.org/jira/browse/MDEP-894
> Project: Maven Dependency Plugin
>  Issue Type: Improvement
>Affects Versions: 3.6.1
>Reporter: Karl Heinz Marbaise
>Assignee: Karl Heinz Marbaise
>Priority: Minor
> Fix For: 3.6.2
>
>




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


Re: [PR] MDEP-894 Use `@Component` only [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on PR #360:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/360#issuecomment-2015687301

   rebased and use latest released versions of m-plugin-tools


-- 
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] (MDEP-425) dependency:list-repositories ignores pluginRepository (only lists repository)

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829951#comment-17829951
 ] 

ASF GitHub Bot commented on MDEP-425:
-

slawekjaranowski commented on PR #51:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/51#issuecomment-2015646839

   @pmoerenhout and other thanks for efforts ... we should not use 
maven-artifact-transfer at all 
   It should be reimplemented with using direct resolver API like I did in #301
   
   So I close it now.




> dependency:list-repositories ignores pluginRepository (only lists repository)
> -
>
> Key: MDEP-425
> URL: https://issues.apache.org/jira/browse/MDEP-425
> Project: Maven Dependency Plugin
>  Issue Type: Bug
>  Components: list-repositories
>Reporter: Michael Vorburger
>Priority: Major
>
> http://maven.apache.org/plugins/maven-dependency-plugin/list-repositories-mojo.html
>  can be very useful! But unless we've missed something, it seems to only 
> gather & list all  but doesn't know about / ignores 
> any  ?
> What I'm suggesting is more that something like 'mvn 
> org.apache.maven.plugins:maven-dependency-plugin:2.8:list-repositories' also 
> lists plugin repositories (with an indication of which is a plugin vs. a 
> dependency plug-in?) than a new list-plugin-repositories goal (just because I 
> think in practice one would typically want to see both).



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


[jira] [Commented] (MDEP-425) dependency:list-repositories ignores pluginRepository (only lists repository)

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829952#comment-17829952
 ] 

ASF GitHub Bot commented on MDEP-425:
-

slawekjaranowski closed pull request #51: [MDEP-425] List plugin repositories 
via maven-artifact-transfer.
URL: https://github.com/apache/maven-dependency-plugin/pull/51




> dependency:list-repositories ignores pluginRepository (only lists repository)
> -
>
> Key: MDEP-425
> URL: https://issues.apache.org/jira/browse/MDEP-425
> Project: Maven Dependency Plugin
>  Issue Type: Bug
>  Components: list-repositories
>Reporter: Michael Vorburger
>Priority: Major
>
> http://maven.apache.org/plugins/maven-dependency-plugin/list-repositories-mojo.html
>  can be very useful! But unless we've missed something, it seems to only 
> gather & list all  but doesn't know about / ignores 
> any  ?
> What I'm suggesting is more that something like 'mvn 
> org.apache.maven.plugins:maven-dependency-plugin:2.8:list-repositories' also 
> lists plugin repositories (with an indication of which is a plugin vs. a 
> dependency plug-in?) than a new list-plugin-repositories goal (just because I 
> think in practice one would typically want to see both).



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


Re: [PR] [MDEP-425] List plugin repositories via maven-artifact-transfer. [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski closed pull request #51: [MDEP-425] List plugin repositories 
via maven-artifact-transfer.
URL: https://github.com/apache/maven-dependency-plugin/pull/51


-- 
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] [MDEP-425] List plugin repositories via maven-artifact-transfer. [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on PR #51:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/51#issuecomment-2015646839

   @pmoerenhout and other thanks for efforts ... we should not use 
maven-artifact-transfer at all 
   It should be reimplemented with using direct resolver API like I did in #301
   
   So I close it 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



Re: [PR] Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 [maven-dependency-plugin]

2024-03-22 Thread via GitHub


dependabot[bot] closed pull request #351: Bump org.codehaus.plexus:plexus-utils 
from 3.5.1 to 4.0.0
URL: https://github.com/apache/maven-dependency-plugin/pull/351


-- 
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] Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 [maven-dependency-plugin]

2024-03-22 Thread via GitHub


dependabot[bot] commented on PR #351:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/351#issuecomment-2015637734

   Looks like org.codehaus.plexus:plexus-utils is up-to-date now, so this is no 
longer needed.


-- 
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] Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on PR #351:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/351#issuecomment-2015635855

   @dependabot rebase


-- 
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] Use default configuration for GitHub Actions [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski merged PR #368:
URL: https://github.com/apache/maven-dependency-plugin/pull/368


-- 
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] [Updated] (MGPG-113) Upgrading from 3.1.0 to 3.2.1 with no other changes causes "gpg:sign-and-deploy-file" failed: 401 Unauthorized

2024-03-22 Thread Tamas Cservenak (Jira)


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

Tamas Cservenak updated MGPG-113:
-
Fix Version/s: 3.2.2

> Upgrading from 3.1.0 to 3.2.1 with no other changes causes 
> "gpg:sign-and-deploy-file" failed: 401 Unauthorized
> --
>
> Key: MGPG-113
> URL: https://issues.apache.org/jira/browse/MGPG-113
> Project: Maven GPG Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.1
> Environment: ubuntu-22.04 (Ubuntu 22.04 LTS) image
>Reporter: Tim Tim
>Priority: Major
> Fix For: 3.2.2
>
>
> After upgrading to Maven GPG plugin from 3.1.0 to 3.2.0/3.2.1, the deploy 
> command "{*}gpg:sign-and-deploy-file{*} " failed with the message "Failed to 
> execute goal 
> org.apache.maven.plugins:maven-gpg-plugin:{*}3.2.1:{*}sign-and-deploy-file : 
> 401 Unauthorized"
>  
> NOTE: *3.1.0* and below version of *gpg:sign-and-deploy-file* works well for 
> below CLI
>  
> Deploy CLI with plugin *gpg:sign-and-deploy-file*
> ```
> mvn -B -Dmaven.wagon.http.retryHandler.count=3 -DretryFailedDeploymentCount=3 
> \
> -s utils/settings.xml gpg:sign-and-deploy-file -Dgpg.passphrase=xxx \
> -Durl=[*https://oss.sonatype.org/service/local/staging/deploy/maven2*|https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Foss.sonatype.org%2Fservice%2Flocal%2Fstaging%2Fdeploy%2Fmaven2=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478125085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=Rlst6EEorq8QFEyvFrypYO5KOOw1Qrtr5hJigYlaxKg%3D=0]
>  -DrepositoryId=ossrh \
> -DgrouId=com.nvidia -DartifactId=test -Dversion=0.1.0 -Dfile=test.jar
> ```
>  
>  
> SONATYPE_USR/PSW defined as env, utils/settings.xml as below
> ```
> http://maven.apache.org/SETTINGS/1.1.0 
> http://maven.apache.org/xsd/settings-1.1.0.xsd|https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmaven.apache.org%2FSETTINGS%2F1.1.0%2520http%3A%2Fmaven.apache.org%2Fxsd%2Fsettings-1.1.0.xsd=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478130933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=AwpWIvI2UECpcvWcFD16CHlYCEjRPYgyXuHW07LbQ7M%3D=0]
>  
> xmlns=[http://maven.apache.org/SETTINGS/1.1.0|https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmaven.apache.org%2FSETTINGS%2F1.1.0=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478137093%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=5985h8YTeXELVjevO0BRSih2SMD8NQeAJnbiBmSEjMI%3D=0]
>   
> xmlns:xsi=[http://www.w3.org/2001/XMLSchema-instance|https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478142757%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=o0V%2Flpv4yqHaYZPv4etTINHsQIzU09ZQAV2vBDjvz%2BE%3D=0]>
>     
>     
>     ossrh
>     ${env.SONATYPE_USR}
>     ${env.SONATYPE_PSW}
>     
>    
> .. 
> ```
>  
> Error Logs
>  
> ```
> *20:03:52* + mvn -B -Dmaven.wagon.http.retryHandler.count=3 
> -DretryFailedDeploymentCount=3 -s utils/settings.xml 
> -Durl=[https://oss.sonatype.org/service/local/staging/deploy/maven2] 
> -DrepositoryId=ossrh 
> org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file 
> -Dgpg.executable=nvsec_sign -DgroupId=com.nvidia -DartifactId=test 
> -Dversion=0.1.0 -Dfile=test.jar *20:03:52* [INFO] Scanning for projects... 
> *20:04:15  [INFO] Uploading to ossrh: 
> [https://oss.sonatype.org/service/local/staging/deploy/maven2/com/nvidia/test/0.1.0/test-0.1.0.jar*]
>  
> *20:04:15  [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file 
> (default-cli) on project standalone-pom: Error deploying attached artifacts 
> [com.nvidia:test:jar:0.1.0, com.nvidia:test:pom:0.1.0, 
> com.nvidia:test:jar.asc:0.1.0, com.nvidia:test:pom.asc:0.1.0]: Failed to 
> deploy artifacts: Could not transfer artifact com.nvidia:test:jar:0.1.0 
> from/to ossrh 
> ([https://oss.sonatype.org/service/local/staging/deploy/maven2):] Transfer 
> failed for 
> [https://oss.sonatype.org/service/local/staging/deploy/maven2/com/nvidia/test/0.1.0/test-0.1.0.jar]
>  401 Unauthorized -> [Help 1]*
>  
>  
> ```



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


[PR] Add option: `maven.build.cache.forceRenew` [maven-build-cache-extension]

2024-03-22 Thread via GitHub


zorglube opened a new pull request, #137:
URL: https://github.com/apache/maven-build-cache-extension/pull/137

   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
- [ ] Make sure there is a [MBUILDCACHE JIRA 
issue](https://issues.apache.org/jira/browse/MBUILDCACHE) filed 
  for the change (usually before you start working on it).  Trivial 
changes like typos do not 
  require a JIRA issue.  Your pull request should address just this 
issue, without 
  pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[MBUILDCACHE-XXX] - Fixes bug in 
ApproximateQuantiles`,
  where you replace `MBUILDCACHE-XXX` with the appropriate JIRA issue. 
Best practice
  is to use the JIRA issue title in the pull request title and in the 
first line of the 
  commit message.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will 
  be performed on your pull request automatically.
- [ ] You have run the [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.
   
- [ ] 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)
   
- [ ] 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



[jira] [Created] (MNG-8084) Make the v4 api usable outside the Maven runtime

2024-03-22 Thread Guillaume Nodet (Jira)
Guillaume Nodet created MNG-8084:


 Summary: Make the v4 api usable outside the Maven runtime
 Key: MNG-8084
 URL: https://issues.apache.org/jira/browse/MNG-8084
 Project: Maven
  Issue Type: New Feature
Reporter: Guillaume Nodet






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


[jira] [Commented] (MJAR-62) Build-Jdk in Manifest.mf does not reflect which compiler version actually compiled the classes in the jar

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MJAR-62:


slawekjaranowski commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1535834916


##
src/test/java/org/apache/maven/plugins/jar/ToolchainsJdkVersionTest.java:
##
@@ -0,0 +1,88 @@
+/*
+ * 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.jar;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Locale;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class ToolchainsJdkVersionTest {
+
+@Mock
+private Toolchain toolchain;
+
+private final ToolchainsJdkSpecification toolchainsJdkSpecification = new 
ToolchainsJdkSpecification();
+
+@Test
+void shouldReturnCorrectSpec() {
+
+Path javaCPath = getJavaCPath();

Review Comment:
   You are right I missed in unit test - fixed also





> Build-Jdk in Manifest.mf does not reflect which compiler version actually 
> compiled the classes in the jar
> -
>
> Key: MJAR-62
> URL: https://issues.apache.org/jira/browse/MJAR-62
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Reporter: Stefan Magnus Landrø
>Assignee: Slawomir Jaranowski
>Priority: Major
> Fix For: 3.4.0
>
> Attachments: example-app.zip
>
>
> Manifest.mf does not reflect the version of the compiler that built the jar, 
> but defaults to the version that maven runs under:  Build-Jdk: 
> ${java.version}.
> I believe this makes users uncertain of which compiler was actually used to 
> build the classes.



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


Re: [PR] [MJAR-62] Set Build-Jdk according to used toolchain [maven-jar-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1535834916


##
src/test/java/org/apache/maven/plugins/jar/ToolchainsJdkVersionTest.java:
##
@@ -0,0 +1,88 @@
+/*
+ * 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.jar;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Locale;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class ToolchainsJdkVersionTest {
+
+@Mock
+private Toolchain toolchain;
+
+private final ToolchainsJdkSpecification toolchainsJdkSpecification = new 
ToolchainsJdkSpecification();
+
+@Test
+void shouldReturnCorrectSpec() {
+
+Path javaCPath = getJavaCPath();

Review Comment:
   You are right I missed in unit test - fixed also



-- 
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] Remove Java 5 references and clean up [maven-toolchains-plugin]

2024-03-22 Thread via GitHub


gnodet commented on code in PR #24:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/24#discussion_r1535820318


##
src/site/apt/toolchains/custom.apt:
##
@@ -25,22 +25,22 @@
 
 Custom Toolchains
 
-  You can create your own custom toolchains with plugins using them.
+  You can create your own custom toolchains for plugins to use.

Review Comment:
   maybe `You can create your own custom toolchains to use with standard 
plugins (such as maven-compiler-plugin) or custom plugins` ?



-- 
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] Complete Packaging in v4 api [maven]

2024-03-22 Thread via GitHub


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

   (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] Remove Java 5 references and clean up [maven-toolchains-plugin]

2024-03-22 Thread via GitHub


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


##
src/site/apt/toolchains/custom.apt:
##
@@ -25,22 +25,22 @@
 
 Custom Toolchains
 
-  You can create your own custom toolchains with plugins using them.
+  You can create your own custom toolchains for plugins to use.

Review Comment:
   The old sentence is not OK. It is grammatically weird, and definitely 
ambiguous. There are at least two readings of it. I think the current sentence 
is accurate, but perhaps I misread the original. If so, please suggest 
alternate language.



-- 
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] Remove Java 5 references and clean up [maven-toolchains-plugin]

2024-03-22 Thread via GitHub


gnodet commented on code in PR #24:
URL: 
https://github.com/apache/maven-toolchains-plugin/pull/24#discussion_r1535562667


##
src/site/apt/toolchains/custom.apt:
##
@@ -25,22 +25,22 @@
 
 Custom Toolchains
 
-  You can create your own custom toolchains with plugins using them.
+  You can create your own custom toolchains for plugins to use.

Review Comment:
   @elharo I'm thinking about release a new version of this plugin. Do you want 
to remove that line and merge the PR ?



-- 
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] [Updated] (MGPG-113) Upgrading from 3.1.0 to 3.2.1 with no other changes causes "gpg:sign-and-deploy-file" failed: 401 Unauthorized

2024-03-22 Thread Tim Tim (Jira)


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

Tim Tim updated MGPG-113:
-
Summary: Upgrading from 3.1.0 to 3.2.1 with no other changes causes 
"gpg:sign-and-deploy-file" failed: 401 Unauthorized  (was: Upgrading from 3.1.0 
to 3.2.1 with no other changes causes "gpg:sign-and-deploy-file failed: 401 
Unauthorized)

> Upgrading from 3.1.0 to 3.2.1 with no other changes causes 
> "gpg:sign-and-deploy-file" failed: 401 Unauthorized
> --
>
> Key: MGPG-113
> URL: https://issues.apache.org/jira/browse/MGPG-113
> Project: Maven GPG Plugin
>  Issue Type: Bug
>Affects Versions: 3.2.1
> Environment: ubuntu-22.04 (Ubuntu 22.04 LTS) image
>Reporter: Tim Tim
>Priority: Major
>
> After upgrading to Maven GPG plugin from 3.1.0 to 3.2.0/3.2.1, the deploy 
> command "{*}gpg:sign-and-deploy-file{*} " failed with the message "Failed to 
> execute goal 
> org.apache.maven.plugins:maven-gpg-plugin:{*}3.2.1:{*}sign-and-deploy-file : 
> 401 Unauthorized"
>  
> NOTE: *3.1.0* and below version of *gpg:sign-and-deploy-file* works well for 
> below CLI
>  
> Deploy CLI with plugin *gpg:sign-and-deploy-file*
> ```
> mvn -B -Dmaven.wagon.http.retryHandler.count=3 -DretryFailedDeploymentCount=3 
> \
> -s utils/settings.xml gpg:sign-and-deploy-file -Dgpg.passphrase=xxx \
> -Durl=[*https://oss.sonatype.org/service/local/staging/deploy/maven2*|https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Foss.sonatype.org%2Fservice%2Flocal%2Fstaging%2Fdeploy%2Fmaven2=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478125085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=Rlst6EEorq8QFEyvFrypYO5KOOw1Qrtr5hJigYlaxKg%3D=0]
>  -DrepositoryId=ossrh \
> -DgrouId=com.nvidia -DartifactId=test -Dversion=0.1.0 -Dfile=test.jar
> ```
>  
>  
> SONATYPE_USR/PSW defined as env, utils/settings.xml as below
> ```
> http://maven.apache.org/SETTINGS/1.1.0 
> http://maven.apache.org/xsd/settings-1.1.0.xsd|https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmaven.apache.org%2FSETTINGS%2F1.1.0%2520http%3A%2Fmaven.apache.org%2Fxsd%2Fsettings-1.1.0.xsd=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478130933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=AwpWIvI2UECpcvWcFD16CHlYCEjRPYgyXuHW07LbQ7M%3D=0]
>  
> xmlns=[http://maven.apache.org/SETTINGS/1.1.0|https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmaven.apache.org%2FSETTINGS%2F1.1.0=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478137093%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=5985h8YTeXELVjevO0BRSih2SMD8NQeAJnbiBmSEjMI%3D=0]
>   
> xmlns:xsi=[http://www.w3.org/2001/XMLSchema-instance|https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance=05%7C02%7Ctiml%40nvidia.com%7C5e0d0557577441c1496308dc45d023b3%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638462007478142757%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=o0V%2Flpv4yqHaYZPv4etTINHsQIzU09ZQAV2vBDjvz%2BE%3D=0]>
>     
>     
>     ossrh
>     ${env.SONATYPE_USR}
>     ${env.SONATYPE_PSW}
>     
>    
> .. 
> ```
>  
> Error Logs
>  
> ```
> *20:03:52* + mvn -B -Dmaven.wagon.http.retryHandler.count=3 
> -DretryFailedDeploymentCount=3 -s utils/settings.xml 
> -Durl=[https://oss.sonatype.org/service/local/staging/deploy/maven2] 
> -DrepositoryId=ossrh 
> org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file 
> -Dgpg.executable=nvsec_sign -DgroupId=com.nvidia -DartifactId=test 
> -Dversion=0.1.0 -Dfile=test.jar *20:03:52* [INFO] Scanning for projects... 
> *20:04:15  [INFO] Uploading to ossrh: 
> [https://oss.sonatype.org/service/local/staging/deploy/maven2/com/nvidia/test/0.1.0/test-0.1.0.jar*]
>  
> *20:04:15  [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-gpg-plugin:3.2.1:sign-and-deploy-file 
> (default-cli) on project standalone-pom: Error deploying attached artifacts 
> [com.nvidia:test:jar:0.1.0, com.nvidia:test:pom:0.1.0, 
> com.nvidia:test:jar.asc:0.1.0, com.nvidia:test:pom.asc:0.1.0]: Failed to 
> deploy artifacts: Could not transfer artifact com.nvidia:test:jar:0.1.0 
> from/to ossrh 
> ([https://oss.sonatype.org/service/local/staging/deploy/maven2):] Transfer 
> failed for 
> 

[jira] [Closed] (MNG-8083) Inconsitency with effective POM

2024-03-22 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet closed MNG-8083.

Resolution: Not A Problem

The {{fastinstall}} profile is actually a fake profile handled by 
https://central.sonatype.com/artifact/org.l2x6.cq/cq-alias-fastinstall-quickly-extension

> Inconsitency with effective POM
> ---
>
> Key: MNG-8083
> URL: https://issues.apache.org/jira/browse/MNG-8083
> Project: Maven
>  Issue Type: Bug
>Affects Versions: 4.0.0-alpha-13
>Reporter: Guillaume Nodet
>Priority: Major
> Fix For: 4.0.0-alpha-14
>
>
> When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
> same and profiles are not applied correctly.
> Running {{mvn -Pfastinstall}} does skip tests with Maven 3.9.6, but does not 
> with Maven 4.0.0-alpha-13.
> {{mvn -Pfastinstall -f core/camel-util}} will execute tests when running on 
> 4.0.x, but should not.



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


[jira] [Updated] (MNG-8083) Inconsitency with effective POM

2024-03-22 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet updated MNG-8083:
-
Description: 
When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
same and profiles are not applied correctly.

Running {{mvn -Pfastinstall}} does skip tests with Maven 3.9.6, but does not 
with Maven 4.0.0-alpha-13.


{{mvn -Pfastinstall -f core/camel-util}} will execute tests when running on 
4.0.x, but should not.

  was:
When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
same and profiles are not applied correctly.

Running `mvn -Pfastinstall` does skip tests with Maven 3.9.6, but does not with 
Maven 4.0.0-alpha-13.


`mvn -Pfastinstall -f core/camel-util` will execute tests when running on 
4.0.x, but should not.


> Inconsitency with effective POM
> ---
>
> Key: MNG-8083
> URL: https://issues.apache.org/jira/browse/MNG-8083
> Project: Maven
>  Issue Type: Bug
>Affects Versions: 4.0.0-alpha-13
>Reporter: Guillaume Nodet
>Priority: Major
> Fix For: 4.0.0-alpha-14
>
>
> When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
> same and profiles are not applied correctly.
> Running {{mvn -Pfastinstall}} does skip tests with Maven 3.9.6, but does not 
> with Maven 4.0.0-alpha-13.
> {{mvn -Pfastinstall -f core/camel-util}} will execute tests when running on 
> 4.0.x, but should not.



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


[jira] [Updated] (MNG-8083) Inconsitency with effective POM

2024-03-22 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet updated MNG-8083:
-
Description: 
When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
same and profiles are not applied correctly.

Running `mvn -Pfastinstall` does skip tests with Maven 3.9.6, but does not with 
Maven 4.0.0-alpha-13.


`mvn -Pfastinstall -f core/camel-util` will execute tests when running on 
4.0.x, but should not.

  was:
When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
same and profiles are not applied correctly.

Running `mvn -Pfastinstall` does skip tests with Maven 3.9.6, but does not with 
Maven 4.0.0-alpha-13.


> Inconsitency with effective POM
> ---
>
> Key: MNG-8083
> URL: https://issues.apache.org/jira/browse/MNG-8083
> Project: Maven
>  Issue Type: Bug
>Affects Versions: 4.0.0-alpha-13
>Reporter: Guillaume Nodet
>Priority: Major
> Fix For: 4.0.0-alpha-14
>
>
> When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
> same and profiles are not applied correctly.
> Running `mvn -Pfastinstall` does skip tests with Maven 3.9.6, but does not 
> with Maven 4.0.0-alpha-13.
> `mvn -Pfastinstall -f core/camel-util` will execute tests when running on 
> 4.0.x, but should not.



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


Re: [PR] [MNG-8081] interpolate available properties during default profile selection (Maven 4.x) [maven]

2024-03-22 Thread via GitHub


mbenson commented on PR #1446:
URL: https://github.com/apache/maven/pull/1446#issuecomment-2014937249

   That is possible, sure. I'll take a look in a bit.


-- 
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-8081) default profile activation should consider available system and user properties

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MNG-8081:
-

mbenson commented on PR #1446:
URL: https://github.com/apache/maven/pull/1446#issuecomment-2014937249

   That is possible, sure. I'll take a look in a bit.




> default profile activation should consider available system and user 
> properties
> ---
>
> Key: MNG-8081
> URL: https://issues.apache.org/jira/browse/MNG-8081
> Project: Maven
>  Issue Type: Improvement
>  Components: Profiles
>Affects Versions: 3.9.6, 4.0.0
>Reporter: Matthew Jason Benson
>Priority: Minor
>
> As discussed in my open PR, my use case is to compare between environment 
> variables e.g.:
> {code:java}
> 
>   
> env.FOO
> ${env.BAR}
>   
> {code}
> Limiting the interpolation to user/system properties means that there is no 
> mindf*ck resulting from profile activation order, etc., and keeps this 
> request nonthreatening.



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


[jira] [Updated] (MNG-8083) Inconsitency with effective POM

2024-03-22 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet updated MNG-8083:
-
Fix Version/s: 4.0.0-alpha-14

> Inconsitency with effective POM
> ---
>
> Key: MNG-8083
> URL: https://issues.apache.org/jira/browse/MNG-8083
> Project: Maven
>  Issue Type: Bug
>Affects Versions: 4.0.0-alpha-13
>Reporter: Guillaume Nodet
>Priority: Major
> Fix For: 4.0.0-alpha-14
>
>
> When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
> same and profiles are not applied correctly.
> Running `mvn -Pfastinstall` does skip tests with Maven 3.9.6, but does not 
> with Maven 4.0.0-alpha-13.



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


[jira] [Created] (MNG-8083) Inconsitency with effective POM

2024-03-22 Thread Guillaume Nodet (Jira)
Guillaume Nodet created MNG-8083:


 Summary: Inconsitency with effective POM
 Key: MNG-8083
 URL: https://issues.apache.org/jira/browse/MNG-8083
 Project: Maven
  Issue Type: Bug
Affects Versions: 4.0.0-alpha-13
Reporter: Guillaume Nodet


When building Apache Camel with 4.0.0-alpha-13, the effective POM is not the 
same and profiles are not applied correctly.

Running `mvn -Pfastinstall` does skip tests with Maven 3.9.6, but does not with 
Maven 4.0.0-alpha-13.



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


[jira] [Commented] (MJAR-62) Build-Jdk in Manifest.mf does not reflect which compiler version actually compiled the classes in the jar

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MJAR-62:


elharo commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1535452791


##
src/test/java/org/apache/maven/plugins/jar/ToolchainsJdkVersionTest.java:
##
@@ -0,0 +1,88 @@
+/*
+ * 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.jar;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Locale;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class ToolchainsJdkVersionTest {
+
+@Mock
+private Toolchain toolchain;
+
+private final ToolchainsJdkSpecification toolchainsJdkSpecification = new 
ToolchainsJdkSpecification();
+
+@Test
+void shouldReturnCorrectSpec() {
+
+Path javaCPath = getJavaCPath();

Review Comment:
   do you need to push? I still see javaCPath





> Build-Jdk in Manifest.mf does not reflect which compiler version actually 
> compiled the classes in the jar
> -
>
> Key: MJAR-62
> URL: https://issues.apache.org/jira/browse/MJAR-62
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Reporter: Stefan Magnus Landrø
>Assignee: Slawomir Jaranowski
>Priority: Major
> Fix For: 3.4.0
>
> Attachments: example-app.zip
>
>
> Manifest.mf does not reflect the version of the compiler that built the jar, 
> but defaults to the version that maven runs under:  Build-Jdk: 
> ${java.version}.
> I believe this makes users uncertain of which compiler was actually used to 
> build the classes.



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


Re: [PR] [MJAR-62] Set Build-Jdk according to used toolchain [maven-jar-plugin]

2024-03-22 Thread via GitHub


elharo commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1535452791


##
src/test/java/org/apache/maven/plugins/jar/ToolchainsJdkVersionTest.java:
##
@@ -0,0 +1,88 @@
+/*
+ * 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.jar;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Locale;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class ToolchainsJdkVersionTest {
+
+@Mock
+private Toolchain toolchain;
+
+private final ToolchainsJdkSpecification toolchainsJdkSpecification = new 
ToolchainsJdkSpecification();
+
+@Test
+void shouldReturnCorrectSpec() {
+
+Path javaCPath = getJavaCPath();

Review Comment:
   do you need to push? I still see javaCPath



-- 
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 pmdVersion from 6.55.0 to 7.0.0 [maven-pmd-plugin]

2024-03-22 Thread via GitHub


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

   Bumps `pmdVersion` from 6.55.0 to 7.0.0.
   Updates `net.sourceforge.pmd:pmd-core` from 6.55.0 to 7.0.0
   
   Release notes
   Sourced from https://github.com/pmd/pmd/releases;>net.sourceforge.pmd:pmd-core's 
releases.
   
   PMD 7.0.0 (22-March-2024)
   22-March-2024 - 7.0.0
    After a long time, we're excited to bring you now the next major 
version of PMD! 
   Since this is a big release, we provide here only a concise version of 
the release notes. We prepared a separate
   page with the full https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_release_notes_pmd7.html;>Detailed
 Release Notes for PMD 7.0.0.
   欄 Many thanks to all users and contributors who were testing the release 
candidates and
   provided feedback and/or PRs!
   ✨ PMD 7...
   
   ...has a new logo
   ...analyzes Java 21 and Java 22 projects with even better type 
resolution and symbol table support
   ...analyzes Kotlin and Swift
   ...analyzes Apex with a new parser
   ...finds duplicated code in Coco, Julia, TypeScript
   ...ships 11 new rules and tons of improvements for existing rules
   ...provides a new CLI interface with progress bar
   ...supports Antlr based languages
   ...and many more enhancements
   
    Note: Since PMD 7 is a major release, it is not a drop-in replacement 
for PMD 6.55.0.
   A detailed documentation of required changes are available in the https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_userdocs_migrating_to_pmd7.html;>Migration
 Guide for PMD 7.
   
   Table Of Contents
   
   https://github.com/pmd/pmd/blob/HEAD/#changes-since-700-rc4;>Changes 
since 7.0.0-rc4
   
   https://github.com/pmd/pmd/blob/HEAD/#new-and-noteworthy;>New 
and Noteworthy
   
   https://github.com/pmd/pmd/blob/HEAD/#maven-pmd-plugin-compatibility-with-pmd-7;>Maven
 PMD Plugin compatibility with PMD 7
   https://github.com/pmd/pmd/blob/HEAD/#java-22-support;>Java 22 
Support
   https://github.com/pmd/pmd/blob/HEAD/#swift-support;>Swift 
Support
   Groovy Support 
(https://github.com/pmd/pmd/blob/HEAD/CPD)
   https://github.com/pmd/pmd/blob/HEAD/#updated-pmd-designer;>Updated PMD 
Designer
   https://github.com/pmd/pmd/blob/HEAD/#apex-support-replaced-jorje-with-fully-open-source-front-end;>Apex
 Support: Replaced Jorje with fully open source front-end
   https://github.com/pmd/pmd/blob/HEAD/#changed-visualforce;>Changed: 
Visualforce
   https://github.com/pmd/pmd/blob/HEAD/#changed-html-support;>Changed: HTML 
support
   https://github.com/pmd/pmd/blob/HEAD/#changed-kotlin-support;>Changed: 
Kotlin support
   Changed: Velocity 
Template Language (https://github.com/pmd/pmd/blob/HEAD/VTL)
   
   
   https://github.com/pmd/pmd/blob/HEAD/#rule-changes;>Rule 
Changes
   
   
   
   
   
   ... (truncated)
   
   
   Commits
   
   https://github.com/pmd/pmd/commit/7979570d39909195e173de05450fb1acf8b3eec5;>7979570
 [doc] Create empty class so that javadoc jar is created
   https://github.com/pmd/pmd/commit/0541ab8591a91cdb1b3da447992c13d9b1104b4b;>0541ab8
 Revert [release] prepare for next development iteration
   https://github.com/pmd/pmd/commit/27620724dcf48160f9ea91b9a02a6186400a38cd;>2762072
 [release] prepare for next development iteration
   https://github.com/pmd/pmd/commit/8704b85ffeb58d9e1c402610bfcfc5cca2f64aac;>8704b85
 [ci] Fix build.sh
   https://github.com/pmd/pmd/commit/2e91f316f47d20b35f762a163fc6e6253d44cd34;>2e91f31
 Revert [release] prepare for next development iteration
   https://github.com/pmd/pmd/commit/0c7c0386363e41cf3d639a46352e2e875be0710a;>0c7c038
 [release] prepare for next development iteration
   https://github.com/pmd/pmd/commit/ccb123f1ff07afa050531c75474928304af6ad7c;>ccb123f
 [release] prepare release pmd_releases/7.0.0
   https://github.com/pmd/pmd/commit/32ef9d748827063efb3ff6515a569c8aa9b3ec99;>32ef9d7
 Prepare pmd release 7.0.0
   https://github.com/pmd/pmd/commit/097f45c2945a7224c7fcd213de8c3dd3d2b6d4fa;>097f45c
 [ci] Push to pmd.github.io only after the release
   https://github.com/pmd/pmd/commit/e57d26b31a47ca655a0a2b75aff53e270128daae;>e57d26b
 Add test for https://redirect.github.com/pmd/pmd/issues/1688;>#1688
   Additional commits viewable in https://github.com/pmd/pmd/compare/pmd_releases/6.55.0...pmd_releases/7.0.0;>compare
 view
   
   
   
   
   Updates `net.sourceforge.pmd:pmd-java` from 6.55.0 to 7.0.0
   
   Release notes
   Sourced from https://github.com/pmd/pmd/releases;>net.sourceforge.pmd:pmd-java's 
releases.
   
   PMD 7.0.0 (22-March-2024)
   22-March-2024 - 7.0.0
    After a long time, we're excited to bring you now the next major 
version of PMD! 
   Since this is a big release, we provide here only a concise version of 
the release notes. We prepared a separate
   page with the full https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_release_notes_pmd7.html;>Detailed
 Release Notes for PMD 7.0.0.
   欄 Many thanks to all users and contributors who were testing the 

[PR] The raw model is not supported to be profile activated [maven]

2024-03-22 Thread via GitHub


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

   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG) filed
  for the change (usually before you start working on it).  Trivial 
changes like typos do not
  require a JIRA issue. Your pull request should address just this 
issue, without
  pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[MNG-XXX] SUMMARY`,
  where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA 
issue.
- [ ] 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.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
  be performed on your pull request automatically.
- [ ] You have run the [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.
   
- [ ] 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)
   
- [ ] 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] Fix typos in metadata documentation [maven-site]

2024-03-22 Thread via GitHub


CrazyHZM merged PR #505:
URL: https://github.com/apache/maven-site/pull/505


-- 
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-8081) default profile activation should consider available system and user properties

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MNG-8081:
-

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

   > From email thread:
   > 
   > Guillaume Nodet [gno...@apache.org](mailto:gno...@apache.org) wrote:
   > 
   > > I thought you were referring to having a small language in the
   > > property activation...
   > 
   > I hadn't noted the discussion when it took place before, but fwiw I also 
lean in the direction that an embedded language might be going too far. At the 
same time EL, as in the extension you mentioned, seems a fine choice, but feels 
fine to leave that as an extension.
   > 
   > Matt
   
   @mbenson  I just spotted that the model builder performs some interpolation 
for file base activation in 
https://github.com/apache/maven/blob/5029cc238ce5ce03b0fb431a278889f8b788c0a7/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L896-L943
   Would it make sense to move this code in this block to interpolate ?  It 
seems more intuitive that the two interpolations would actually be performed at 
the same time...




> default profile activation should consider available system and user 
> properties
> ---
>
> Key: MNG-8081
> URL: https://issues.apache.org/jira/browse/MNG-8081
> Project: Maven
>  Issue Type: Improvement
>  Components: Profiles
>Affects Versions: 3.9.6, 4.0.0
>Reporter: Matthew Jason Benson
>Priority: Minor
>
> As discussed in my open PR, my use case is to compare between environment 
> variables e.g.:
> {code:java}
> 
>   
> env.FOO
> ${env.BAR}
>   
> {code}
> Limiting the interpolation to user/system properties means that there is no 
> mindf*ck resulting from profile activation order, etc., and keeps this 
> request nonthreatening.



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


Re: [PR] [MNG-8081] interpolate available properties during default profile selection (Maven 4.x) [maven]

2024-03-22 Thread via GitHub


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

   > From email thread:
   > 
   > Guillaume Nodet [gno...@apache.org](mailto:gno...@apache.org) wrote:
   > 
   > > I thought you were referring to having a small language in the
   > > property activation...
   > 
   > I hadn't noted the discussion when it took place before, but fwiw I also 
lean in the direction that an embedded language might be going too far. At the 
same time EL, as in the extension you mentioned, seems a fine choice, but feels 
fine to leave that as an extension.
   > 
   > Matt
   
   @mbenson  I just spotted that the model builder performs some interpolation 
for file base activation in 
https://github.com/apache/maven/blob/5029cc238ce5ce03b0fb431a278889f8b788c0a7/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L896-L943
   Would it make sense to move this code in this block to interpolate ?  It 
seems more intuitive that the two interpolations would actually be performed at 
the same time...


-- 
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] (MPMD-379) Support PMD 7.0.0

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MPMD-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829818#comment-17829818
 ] 

ASF GitHub Bot commented on MPMD-379:
-

mkolesnikov commented on code in PR #144:
URL: https://github.com/apache/maven-pmd-plugin/pull/144#discussion_r1535384167


##
src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java:
##
@@ -190,7 +189,7 @@ private PmdResult run() throws MavenReportException {
 configuration.setRuleSets(request.getRulesets());
 
configuration.setMinimumPriority(RulePriority.valueOf(request.getMinimumPriority()));
 if (request.getBenchmarkOutputLocation() != null) {
-configuration.setBenchmark(true);
+TimeTracker.startGlobalTracking();

Review Comment:
   I copied it from `PmdCli.java`  the --benchmark option is still there.





> Support PMD 7.0.0
> -
>
> Key: MPMD-379
> URL: https://issues.apache.org/jira/browse/MPMD-379
> Project: Maven PMD Plugin
>  Issue Type: Improvement
>  Components: CPD, PMD
>Reporter: Andreas Dangel
>Assignee: Andreas Dangel
>Priority: Major
>
> Add support for the new major version of PMD.
> This has some non-backward compatible changes. Upgrading m-pmd-p to PMD 7 
> most likely means, that only PMD 7 will be supported onwards (no backwards 
> compatibility supported).
> wip branch: [https://github.com/apache/maven-pmd-plugin/compare/master...pmd7]
>  
> A snapshot version that is compatible with the current 7.0.0 release 
> candidates is available here as version {*}3.21.1-pmd-7-SNAPSHOT{*}:
> {code:java}
> 
> apache.snapshots
> Apache Snapshot Repository
> https://repository.apache.org/snapshots
> 
> false
> 
> 
> true
> 
>  {code}



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


Re: [PR] [MPMD-379] PMD 7.0.0 support [maven-pmd-plugin]

2024-03-22 Thread via GitHub


mkolesnikov commented on code in PR #144:
URL: https://github.com/apache/maven-pmd-plugin/pull/144#discussion_r1535384167


##
src/main/java/org/apache/maven/plugins/pmd/exec/PmdExecutor.java:
##
@@ -190,7 +189,7 @@ private PmdResult run() throws MavenReportException {
 configuration.setRuleSets(request.getRulesets());
 
configuration.setMinimumPriority(RulePriority.valueOf(request.getMinimumPriority()));
 if (request.getBenchmarkOutputLocation() != null) {
-configuration.setBenchmark(true);
+TimeTracker.startGlobalTracking();

Review Comment:
   I copied it from `PmdCli.java`  the --benchmark option is still there.



-- 
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-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MJAR-289:
-

slawekjaranowski commented on PR #71:
URL: https://github.com/apache/maven-jar-plugin/pull/71#issuecomment-2014601426

   I think that it not resolve MJAR-289, it resolve only one case described in 
MJAR-62
   For MJAR-289 we need a changes in plexus-archiver
   
   So I have created #73 based on it




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


Re: [PR] [MJAR-289] add toolchains support [maven-jar-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on PR #71:
URL: https://github.com/apache/maven-jar-plugin/pull/71#issuecomment-2014601426

   I think that it not resolve MJAR-289, it resolve only one case described in 
MJAR-62
   For MJAR-289 we need a changes in plexus-archiver
   
   So I have created #73 based on it


-- 
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-62) Build-Jdk in Manifest.mf does not reflect which compiler version actually compiled the classes in the jar

2024-03-22 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot commented on MJAR-62:


slawekjaranowski commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1535215589


##
src/main/java/org/apache/maven/plugins/jar/ToolchainsJdkSpecification.java:
##
@@ -0,0 +1,93 @@
+/*
+ * 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.jar;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * Component provided JDK specification based on toolchains.
+ */
+@Named
+@Singleton
+class ToolchainsJdkSpecification {
+
+private final Map cache = new HashMap<>();
+
+public synchronized Optional getJDKSpecification(Toolchain 
toolchain) {
+Optional javaCPath = getJavaCPath(toolchain);
+return javaCPath.map(path -> cache.computeIfAbsent(path, 
this::getSpecForPath));
+}
+
+private Optional getJavaCPath(Toolchain toolchain) {
+return 
Optional.ofNullable(toolchain.findTool("javac")).map(Paths::get).map(this::getCanonicalPath);
+}
+
+private Path getCanonicalPath(Path path) {
+try {
+return path.toRealPath();
+} catch (IOException e) {
+if (path.getParent() != null) {
+return 
getCanonicalPath(path.getParent()).resolve(path.getFileName());
+} else {
+throw new UncheckedIOException(e);
+}
+}
+}
+
+private String getSpecForPath(Path path) {
+try {
+Commandline cl = new Commandline(path.toString());
+cl.createArg().setValue("-version");
+CommandLineUtils.StringStreamConsumer out = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.StringStreamConsumer err = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.executeCommandLine(cl, out, err);
+String version = out.getOutput().trim();
+if (version.isEmpty()) {
+version = err.getOutput().trim();
+}
+if (version.startsWith("javac ")) {
+version = version.substring(6);
+if (version.startsWith("1.")) {
+version = version.substring(0, 3);
+} else {
+version = version.substring(0, 2);
+}
+return version;
+} else {
+return null;
+}
+} catch (CommandLineException e) {
+throw new RuntimeException(e);

Review Comment:
   introduce own class for unchecked exception
   it is used in: `Map.computeIfAbsent` instead of it I need to check map item 
and add new item ... code will be more complicated





> Build-Jdk in Manifest.mf does not reflect which compiler version actually 
> compiled the classes in the jar
> -
>
> Key: MJAR-62
> URL: https://issues.apache.org/jira/browse/MJAR-62
> Project: Maven JAR Plugin
>  Issue Type: Bug
>Reporter: Stefan Magnus Landrø
>Assignee: Slawomir Jaranowski
>Priority: Major
> Fix For: 3.4.0
>
> Attachments: example-app.zip
>
>
> Manifest.mf does not reflect the version of the compiler that built the jar, 
> but defaults to the version that maven runs under:  Build-Jdk: 
> ${java.version}.
> I believe this makes users uncertain of which compiler was actually used to 
> build the classes.



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


Re: [PR] [MJAR-62] Set Build-Jdk according to used toolchain [maven-jar-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on code in PR #73:
URL: https://github.com/apache/maven-jar-plugin/pull/73#discussion_r1535215589


##
src/main/java/org/apache/maven/plugins/jar/ToolchainsJdkSpecification.java:
##
@@ -0,0 +1,93 @@
+/*
+ * 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.jar;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.maven.toolchain.Toolchain;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+
+/**
+ * Component provided JDK specification based on toolchains.
+ */
+@Named
+@Singleton
+class ToolchainsJdkSpecification {
+
+private final Map cache = new HashMap<>();
+
+public synchronized Optional getJDKSpecification(Toolchain 
toolchain) {
+Optional javaCPath = getJavaCPath(toolchain);
+return javaCPath.map(path -> cache.computeIfAbsent(path, 
this::getSpecForPath));
+}
+
+private Optional getJavaCPath(Toolchain toolchain) {
+return 
Optional.ofNullable(toolchain.findTool("javac")).map(Paths::get).map(this::getCanonicalPath);
+}
+
+private Path getCanonicalPath(Path path) {
+try {
+return path.toRealPath();
+} catch (IOException e) {
+if (path.getParent() != null) {
+return 
getCanonicalPath(path.getParent()).resolve(path.getFileName());
+} else {
+throw new UncheckedIOException(e);
+}
+}
+}
+
+private String getSpecForPath(Path path) {
+try {
+Commandline cl = new Commandline(path.toString());
+cl.createArg().setValue("-version");
+CommandLineUtils.StringStreamConsumer out = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.StringStreamConsumer err = new 
CommandLineUtils.StringStreamConsumer();
+CommandLineUtils.executeCommandLine(cl, out, err);
+String version = out.getOutput().trim();
+if (version.isEmpty()) {
+version = err.getOutput().trim();
+}
+if (version.startsWith("javac ")) {
+version = version.substring(6);
+if (version.startsWith("1.")) {
+version = version.substring(0, 3);
+} else {
+version = version.substring(0, 2);
+}
+return version;
+} else {
+return null;
+}
+} catch (CommandLineException e) {
+throw new RuntimeException(e);

Review Comment:
   introduce own class for unchecked exception
   it is used in: `Map.computeIfAbsent` instead of it I need to check map item 
and add new item ... code will be more complicated



-- 
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] JDK 20 to 21 [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski closed pull request #346: JDK 20 to 21
URL: https://github.com/apache/maven-dependency-plugin/pull/346


-- 
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] JDK 20 to 21 [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski commented on PR #346:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/346#issuecomment-2014559253

   suppressed by #368


-- 
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] [Closed] (MDEP-912) Use version for plexus-utils/plexus-xml from parent

2024-03-22 Thread Slawomir Jaranowski (Jira)


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

Slawomir Jaranowski closed MDEP-912.

Resolution: Fixed

> Use version for plexus-utils/plexus-xml  from parent
> 
>
> Key: MDEP-912
> URL: https://issues.apache.org/jira/browse/MDEP-912
> Project: Maven Dependency Plugin
>  Issue Type: Task
>Reporter: Slawomir Jaranowski
>Assignee: Slawomir Jaranowski
>Priority: Major
> Fix For: 3.6.2
>
>




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


[jira] [Commented] (MDEP-912) Use version for plexus-utils/plexus-xml from parent

2024-03-22 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/MDEP-912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17829767#comment-17829767
 ] 

ASF GitHub Bot commented on MDEP-912:
-

slawekjaranowski merged PR #367:
URL: https://github.com/apache/maven-dependency-plugin/pull/367




> Use version for plexus-utils/plexus-xml  from parent
> 
>
> Key: MDEP-912
> URL: https://issues.apache.org/jira/browse/MDEP-912
> Project: Maven Dependency Plugin
>  Issue Type: Task
>Reporter: Slawomir Jaranowski
>Assignee: Slawomir Jaranowski
>Priority: Major
> Fix For: 3.6.2
>
>




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


Re: [PR] [MDEP-912] Use version for plexus-utils/plexus-xml from parent [maven-dependency-plugin]

2024-03-22 Thread via GitHub


slawekjaranowski merged PR #367:
URL: https://github.com/apache/maven-dependency-plugin/pull/367


-- 
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] [Closed] (MPLUGIN-514) switch dependency schema from png + imagemap to svg, and update

2024-03-22 Thread Herve Boutemy (Jira)


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

Herve Boutemy closed MPLUGIN-514.
-
Resolution: Fixed

> switch dependency schema from png + imagemap to svg, and update
> ---
>
> Key: MPLUGIN-514
> URL: https://issues.apache.org/jira/browse/MPLUGIN-514
> Project: Maven Plugin Tools
>  Issue Type: Improvement
>Affects Versions: 3.11.0
>Reporter: Herve Boutemy
>Assignee: Herve Boutemy
>Priority: Major
> Fix For: 3.12.0
>
>
> makes updates much easier: hyperlink can be added to source .odf file
> then export to svg (select all then limit export to selection) in root 
> directory
> then run ./prepare-svg.sh
> requires install of svgo to rework the svg exported by LibreOffice: 
> https://svgo.dev/
> result published to 
> https://maven.apache.org/plugin-tools-archives/plugin-tools-LATEST/
> vs initial png 
> https://maven.apache.org/plugin-tools-archives/plugin-tools-3.11.0/
> also updating for part changes: introduction of maven-plugin-report-plugin, 
> removal of javadoc doclet, deprecation of script



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


Re: [PR] switch from png+imagemap to svg [maven-plugin-tools]

2024-03-22 Thread via GitHub


hboutemy merged PR #271:
URL: https://github.com/apache/maven-plugin-tools/pull/271


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