You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/20 10:22:35 UTC

[GitHub] [maven-scm] cstamas opened a new pull request, #141: [SCM-979] De-Plexus, Java8

cstamas opened a new pull request, #141:
URL: https://github.com/apache/maven-scm/pull/141

   Changes:
   * make project Java8
   * update dependencies accordingly
   * remove any uses of deprecated Plexus APIs
   * replace plexus-container-default with plexus-shim
   
   **still WIP just for preview**
   
   ---
   
   https://issues.apache.org/jira/browse/SCM-979


-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] michael-o commented on a diff in pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #141:
URL: https://github.com/apache/maven-scm/pull/141#discussion_r877996117


##########
maven-scm-api/src/main/java/org/apache/maven/scm/log/Slf4jScmLogger.java:
##########
@@ -0,0 +1,195 @@
+package org.apache.maven.scm.log;
+
+/*
+ * 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.
+ */
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * {@link ScmLogger} backed by Slf4j.
+ *
+ * @since TBD
+ */
+public class Slf4jScmLogger
+    implements ScmLogger
+{
+    private final Logger logger;
+
+    public Slf4jScmLogger()
+    {
+        this( Slf4jScmLogger.class );
+    }
+
+    public Slf4jScmLogger( final Class<?> owner )
+    {
+        this( LoggerFactory.getLogger( owner ) );

Review Comment:
   requirenonNull as well?



##########
pom.xml:
##########
@@ -182,20 +183,52 @@
       <!-- end providers declaration -->
 
       <!-- Plexus -->
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+        <version>1.7.36</version>
+      </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-simple</artifactId>
+        <version>1.7.36</version>
+      </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-container-default</artifactId>
-        <version>1.0-alpha-9</version>
+        <artifactId>plexus-classworlds</artifactId>
+        <version>2.6.0</version>
+      </dependency>
+      <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>org.eclipse.sisu.plexus</artifactId>
+        <version>${sisuVersion}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-component-annotations</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>com.google.inject</groupId>
+        <artifactId>guice</artifactId>
+        <classifier>no_aop</classifier>
+        <version>4.2.3</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
-        <version>3.3.1</version>
+        <version>3.4.2</version>
       </dependency>
       <dependency>
-          <groupId>org.sonatype.plexus</groupId>
-          <artifactId>plexus-sec-dispatcher</artifactId>
-          <version>1.4</version>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-sec-dispatcher</artifactId>
+        <version>2.0</version>

Review Comment:
   Beware, there is some TODO or `Deprecated` which needs to be touched when this is changed. Search the code for: `mng-4384`



-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] asfgit merged pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
asfgit merged PR #141:
URL: https://github.com/apache/maven-scm/pull/141


-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] michael-o commented on a diff in pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #141:
URL: https://github.com/apache/maven-scm/pull/141#discussion_r878738178


##########
maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java:
##########
@@ -30,14 +30,15 @@
 public class ScmLogDispatcher
     implements ScmLogger
 {
-    private List<ScmLogger> listeners = new ArrayList<ScmLogger>();
+    private final List<ScmLogger> listeners = new CopyOnWriteArrayList<>();

Review Comment:
   Why do we need this COW list?



-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] nielsbasjes commented on pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
nielsbasjes commented on PR #141:
URL: https://github.com/apache/maven-scm/pull/141#issuecomment-1132902843

   If you are getting rid of plexus then please also drop the whole testcase part and use the normal junit4 methods. See my comments here : https://github.com/apache/maven-scm/pull/140
   


-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] cstamas commented on a diff in pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #141:
URL: https://github.com/apache/maven-scm/pull/141#discussion_r878005383


##########
pom.xml:
##########
@@ -182,20 +183,52 @@
       <!-- end providers declaration -->
 
       <!-- Plexus -->
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+        <version>1.7.36</version>
+      </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-simple</artifactId>
+        <version>1.7.36</version>
+      </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-container-default</artifactId>
-        <version>1.0-alpha-9</version>
+        <artifactId>plexus-classworlds</artifactId>
+        <version>2.6.0</version>
+      </dependency>
+      <dependency>
+        <groupId>javax.inject</groupId>
+        <artifactId>javax.inject</artifactId>
+        <version>1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>org.eclipse.sisu.plexus</artifactId>
+        <version>${sisuVersion}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-component-annotations</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      <dependency>
+        <groupId>com.google.inject</groupId>
+        <artifactId>guice</artifactId>
+        <classifier>no_aop</classifier>
+        <version>4.2.3</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
-        <version>3.3.1</version>
+        <version>3.4.2</version>
       </dependency>
       <dependency>
-          <groupId>org.sonatype.plexus</groupId>
-          <artifactId>plexus-sec-dispatcher</artifactId>
-          <version>1.4</version>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-sec-dispatcher</artifactId>
+        <version>2.0</version>

Review Comment:
   no change needed, classes and packages remained in sonatype java package.



-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] michael-o commented on a diff in pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #141:
URL: https://github.com/apache/maven-scm/pull/141#discussion_r878740436


##########
maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java:
##########
@@ -44,47 +51,44 @@
 import org.apache.maven.scm.command.unedit.UnEditScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
 import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.log.Slf4jScmLogger;
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.provider.ScmProviderRepository;
 import org.apache.maven.scm.provider.ScmUrlUtils;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.apache.maven.scm.repository.UnknownRepositoryStructure;
+import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
+import static java.util.Objects.requireNonNull;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- *
  */
 public abstract class AbstractScmManager
-    implements ScmManager
+        implements ScmManager
 {
-    private Map<String, ScmProvider> scmProviders = new HashMap<String, ScmProvider>();
+    private final ScmLogger logger = new Slf4jScmLogger( LoggerFactory.getLogger( getClass() ) );
 
-    private ScmLogger logger;
+    private final Map<String, ScmProvider> scmProviders = new ConcurrentHashMap<>();
 
-    private Map<String, String> userProviderTypes = new HashMap<String, String>();
+    private final Map<String, String> userProviderTypes = new ConcurrentHashMap<>();
 

Review Comment:
   Concurrent because this component is a singleton?



-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] michael-o commented on pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #141:
URL: https://github.com/apache/maven-scm/pull/141#issuecomment-1133670333

   > If you are getting rid of plexus then please also drop the whole testcase part and use the normal junit4 methods. See my comments here : #140
   
   This is not underway!


-- 
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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] slawekjaranowski commented on a diff in pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #141:
URL: https://github.com/apache/maven-scm/pull/141#discussion_r878412991


##########
src/site/apt/guide/new_provider.apt:
##########
@@ -83,13 +83,15 @@ How to write a new SCM provider?
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
-        <version>1.7.1</version>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>sisu-maven-plugin</artifactId>
+        <version>${sisuVersion}</version>
         <executions>
           <execution>
+            <id>index-project</id>
             <goals>
-              <goal>generate-metadata</goal>
+              <goal>main-index</goal>
+              <goal>test-index</goal>

Review Comment:
   version and executions is defined in parent pom - not 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-unsubscribe@maven.apache.org

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


[GitHub] [maven-scm] michael-o commented on a diff in pull request #141: [SCM-979] De-Plexus, Java8

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #141:
URL: https://github.com/apache/maven-scm/pull/141#discussion_r878741327


##########
src/site/apt/guide/new_provider.apt:
##########
@@ -83,13 +83,15 @@ How to write a new SCM provider?
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
-        <version>1.7.1</version>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>sisu-maven-plugin</artifactId>
+        <version>${sisuVersion}</version>
         <executions>
           <execution>
+            <id>index-project</id>
             <goals>
-              <goal>generate-metadata</goal>
+              <goal>main-index</goal>
+              <goal>test-index</goal>

Review Comment:
   This is a sample document, not the POM, so I consider this complete and correct.



-- 
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-unsubscribe@maven.apache.org

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