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 2021/09/23 09:14:57 UTC

[GitHub] [maven] cstamas opened a new pull request #549: Convert maven-core components XML to Providers

cstamas opened a new pull request #549:
URL: https://github.com/apache/maven/pull/549


   This change get's rid of component.xml in maven-core
   
   Issue: ?


-- 
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] slachiewicz commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
slachiewicz commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714637231



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       with Guava it will be easier to backport it to 3.x line. Thx @cstamas for so quick solution :)




-- 
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] cstamas commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714628709



##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )

Review comment:
       Well, yes, everything that was present in `maven-core/src/main/resources/META-INF/plexus/components.xml` is here, as the XML file is removed...




-- 
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] michael-o commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714626360



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       Can we use Java Collections API here instead of Guava?

##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )

Review comment:
       The dreaded pseudo security...




-- 
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] cstamas commented on pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on pull request #549:
URL: https://github.com/apache/maven/pull/549#issuecomment-927101221


   @gnodet actually, am "preempting" your approval here as your remark for change (and Michael remark "is 1:1 convert of XML") was unequivocal... am merging this keep us going forward, but please chime in here one you get to 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-unsubscribe@maven.apache.org

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



[GitHub] [maven] cstamas commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714642599



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       Agreed, this is not for 3.8.x (well, unsure why to spend time back-porting it there).
   
   For lists, yes, but what about maps? IMO, using pure Java is okay, but will be more bloated... anyway, what is the guava status in maven core? (as I searched codebase on master and did not find many uses of it).... so after this I think yes, we should omit use of Guava...




-- 
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] cstamas commented on a change in pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r716023044



##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )
+    {
+        this.secDispatcher = new DefaultSecDispatcher(
+            new DefaultPlexusCipher(),

Review comment:
       Fixed




-- 
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] cstamas commented on a change in pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r716020043



##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )
+    {
+        this.secDispatcher = new DefaultSecDispatcher(
+            new DefaultPlexusCipher(),

Review comment:
       @gnodet after a night, I think you are right. This above is not 1:1 of that in XML (for example would not allow replacing implementation of PlexusCipher). Fixing




-- 
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] michael-o edited a comment on pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o edited a comment on pull request #549:
URL: https://github.com/apache/maven/pull/549#issuecomment-927251012


   This merge was neither rebased nor cleaned up. Proper tracking is impossible now. Please avoid this next 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-unsubscribe@maven.apache.org

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



[GitHub] [maven] michael-o commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714640325



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       I don't think this should be on 3.8.x, at most 3.9.x. `Arrays.asList()` and `Collections.unmodifiableList()` should do it, no?




-- 
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] michael-o commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714669849



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       @cstamas Correct, limit the use, at best be a transitive dep.




-- 
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] cstamas merged pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas merged pull request #549:
URL: https://github.com/apache/maven/pull/549


   


-- 
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] michael-o commented on a change in pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r716007008



##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )
+    {
+        this.secDispatcher = new DefaultSecDispatcher(
+            new DefaultPlexusCipher(),

Review comment:
       If this corresponds 1:1 to the XML, then leave it as-is. Improvements to with another 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-unsubscribe@maven.apache.org

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



[GitHub] [maven] cstamas commented on pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on pull request #549:
URL: https://github.com/apache/maven/pull/549#issuecomment-926074700


   > please also remove plexus-component-metadata from maven-core
   
   Will do in next PR, once all related ones are merged


-- 
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] cstamas commented on a change in pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r715085617



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       done




-- 
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] cstamas commented on pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on pull request #549:
URL: https://github.com/apache/maven/pull/549#issuecomment-927097469


   @gnodet pls review again (one last commit)


-- 
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] slachiewicz commented on pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
slachiewicz commented on pull request #549:
URL: https://github.com/apache/maven/pull/549#issuecomment-925679926


   please also remove plexus-component-metadata from maven-core


-- 
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] gnodet commented on a change in pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
gnodet commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r715416493



##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )
+    {
+        this.secDispatcher = new DefaultSecDispatcher(
+            new DefaultPlexusCipher(),

Review comment:
       I think the `PlexusCipher` should be injected by the container.




-- 
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] cstamas commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714624646



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject

Review comment:
       To kill off annoying IDE warning :wink: but otherwise is not needed but it's presence is harmless.




-- 
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] slachiewicz commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
slachiewicz commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714658808



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       backport to have more "Plexus free" Maven core so if in few years someone will open discussion about the minimal supported version we will have a cleaner situation. Ofc there is still maven-compat with its own challenges. 




-- 
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] cstamas commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714630601



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject
+  public CleanLifecycleProvider()
+  {
+    this.lifecycle = new Lifecycle(
+        "clean",
+        ImmutableList.of(
+            "pre-clean",
+            "clean",
+            "post-clean"
+        ),
+        ImmutableMap.of(

Review comment:
       Does Java 8 has something so simple as that above? Am fine with whatever here, this PR was just done quickly to make @slachiewicz send rockets :smile: 




-- 
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] michael-o commented on pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #549:
URL: https://github.com/apache/maven/pull/549#issuecomment-927251012


   This merge was neither rebased nor cleaned up. I proper tracking is impossible now. Please avoid this next 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-unsubscribe@maven.apache.org

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



[GitHub] [maven] cstamas commented on a change in pull request #549: [MNG-7263] Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r715440839



##########
File path: maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/MavenSecDispatcherProvider.java
##########
@@ -0,0 +1,56 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * 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 java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.sonatype.plexus.components.cipher.DefaultPlexusCipher;
+import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+
+@Named( "maven" )
+@Singleton
+public final class MavenSecDispatcherProvider
+    implements Provider<SecDispatcher>
+{
+    private final SecDispatcher secDispatcher;
+
+    @Inject
+    public MavenSecDispatcherProvider( final Map<String, PasswordDecryptor> decryptors )
+    {
+        this.secDispatcher = new DefaultSecDispatcher(
+            new DefaultPlexusCipher(),

Review comment:
       Possible, but irrelevant IMO. As DefaultPlexusCipher is stateless anyway, and reason why Maven does this rename of SecDiscpatcher (uses component name "maven" instead of "default") is really to distance itself from any interference from those using default (singleton) secDispatcher component. I just felt this is more safer, but I agree. If you see this as a show stopper will change 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-unsubscribe@maven.apache.org

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



[GitHub] [maven] michael-o commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714623803



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject

Review comment:
       why do you need inject on a no-arg ctor?




-- 
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] michael-o commented on a change in pull request #549: Convert maven-core components XML to Providers

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #549:
URL: https://github.com/apache/maven/pull/549#discussion_r714629192



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/providers/CleanLifecycleProvider.java
##########
@@ -0,0 +1,61 @@
+package org.apache.maven.lifecycle.providers;
+
+/*
+ * 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.apache.maven.lifecycle.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+@Named( "clean" )
+@Singleton
+public final class CleanLifecycleProvider
+    implements Provider<Lifecycle>
+{
+  private final Lifecycle lifecycle;
+
+  @Inject

Review comment:
       Ok.




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