[maven] branch MNG-5577 created (now 46b0f82)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven] branch MNG-5577 created (now 46b0f82)

slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MNG-5577
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at 46b0f82  [MNG-5577] Migrate to JSR 300 Annotations - maven-embedder

This branch includes the following new commits:

     new 0cbd7d0  [MNG-5577] Migrate to JSR 300 Annotations - maven-artifact
     new f603896  [MNG-5577] Migrate to JSR 300 Annotations - maven-settings-builder
     new 46b0f82  [MNG-5577] Migrate to JSR 300 Annotations - maven-embedder

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Reply | Threaded
Open this post in threaded view
|

[maven] 01/03: [MNG-5577] Migrate to JSR 300 Annotations - maven-artifact

slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-5577
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 0cbd7d061a603fcd3876622eee073929874b5d1d
Author: Sylwester Lachiewicz <[hidden email]>
AuthorDate: Tue Jan 8 01:43:31 2019 +0100

    [MNG-5577] Migrate to JSR 300 Annotations - maven-artifact
---
 maven-artifact/pom.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index c03162e..8857e80 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -46,10 +46,6 @@ under the License.
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
-      </plugin>
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
         <configuration>

Reply | Threaded
Open this post in threaded view
|

[maven] 02/03: [MNG-5577] Migrate to JSR 300 Annotations - maven-settings-builder

slachiewicz
In reply to this post by slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-5577
in repository https://gitbox.apache.org/repos/asf/maven.git

commit f60389630b278d6e3e4b8ccce1b7a98eb6898bb6
Author: Sylwester Lachiewicz <[hidden email]>
AuthorDate: Fri Jan 11 03:09:45 2019 +0100

    [MNG-5577] Migrate to JSR 300 Annotations - maven-settings-builder
---
 maven-settings-builder/pom.xml                           | 12 ++++++------
 .../maven/settings/building/DefaultSettingsBuilder.java  | 15 +++++++++------
 .../maven/settings/crypto/DefaultSettingsDecrypter.java  | 16 ++++++++++++----
 .../apache/maven/settings/io/DefaultSettingsReader.java  |  7 +++++--
 .../apache/maven/settings/io/DefaultSettingsWriter.java  |  7 +++++--
 .../settings/validation/DefaultSettingsValidator.java    |  7 +++++--
 6 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index 9e3cd8d..9a2eefe 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -54,10 +54,6 @@ under the License.
       <artifactId>plexus-interpolation</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-component-annotations</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-settings</artifactId>
     </dependency>
@@ -65,13 +61,17 @@ under the License.
       <groupId>org.sonatype.plexus</groupId>
       <artifactId>plexus-sec-dispatcher</artifactId>
     </dependency>
+    <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>sisu-maven-plugin</artifactId>
       </plugin>
     </plugins>
   </build>
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java
index 3cdae7d..7692510 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuilder.java
@@ -36,31 +36,34 @@ import org.apache.maven.settings.io.SettingsReader;
 import org.apache.maven.settings.io.SettingsWriter;
 import org.apache.maven.settings.merge.MavenSettingsMerger;
 import org.apache.maven.settings.validation.SettingsValidator;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.interpolation.EnvarBasedValueSource;
 import org.codehaus.plexus.interpolation.InterpolationException;
 import org.codehaus.plexus.interpolation.InterpolationPostProcessor;
 import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
 import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * Builds the effective settings from a user settings file and/or a global settings file.
  *
  * @author Benjamin Bentmann
  */
-@Component( role = SettingsBuilder.class )
+@Named
+@Singleton
 public class DefaultSettingsBuilder
     implements SettingsBuilder
 {
 
-    @Requirement
+    @Inject
     private SettingsReader settingsReader;
 
-    @Requirement
+    @Inject
     private SettingsWriter settingsWriter;
 
-    @Requirement
+    @Inject
     private SettingsValidator settingsValidator;
 
     private MavenSettingsMerger settingsMerger = new MavenSettingsMerger();
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java
index 671a20d..eb974b9 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java
@@ -27,24 +27,32 @@ import org.apache.maven.settings.Server;
 import org.apache.maven.settings.building.DefaultSettingsProblem;
 import org.apache.maven.settings.building.SettingsProblem;
 import org.apache.maven.settings.building.SettingsProblem.Severity;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
 import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * Decrypts passwords in the settings.
  *
  * @author Benjamin Bentmann
  */
-@Component( role = SettingsDecrypter.class )
+@Named
+@Singleton
 public class DefaultSettingsDecrypter
     implements SettingsDecrypter
 {
 
-    @Requirement( hint = "maven" )
     private SecDispatcher securityDispatcher;
 
+    @Inject
+    public DefaultSettingsDecrypter( final @Named( "maven" ) SecDispatcher securityDispatcher )
+    {
+        this.securityDispatcher = securityDispatcher;
+    }
+
     @Override
     public SettingsDecryptionResult decrypt( SettingsDecryptionRequest request )
     {
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsReader.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsReader.java
index fa95613..d5daf16 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsReader.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsReader.java
@@ -28,16 +28,19 @@ import java.util.Objects;
 
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * Handles deserialization of settings from the default textual format.
  *
  * @author Benjamin Bentmann
  */
-@Component( role = SettingsReader.class )
+@Named
+@Singleton
 public class DefaultSettingsReader
     implements SettingsReader
 {
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsWriter.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsWriter.java
index 96af1a3..2467bb6 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsWriter.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/io/DefaultSettingsWriter.java
@@ -29,15 +29,18 @@ import java.util.Objects;
 
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Writer;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.WriterFactory;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * Handles serialization of settings into the default textual format.
  *
  * @author Benjamin Bentmann
  */
-@Component( role = SettingsWriter.class )
+@Named
+@Singleton
 public class DefaultSettingsWriter
     implements SettingsWriter
 {
diff --git a/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java b/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java
index 1e31f50..ff00b84 100644
--- a/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java
+++ b/maven-settings-builder/src/main/java/org/apache/maven/settings/validation/DefaultSettingsValidator.java
@@ -31,13 +31,16 @@ import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.building.SettingsProblem.Severity;
 import org.apache.maven.settings.building.SettingsProblemCollector;
-import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * @author Milos Kleint
  */
-@Component( role = SettingsValidator.class )
+@Named
+@Singleton
 public class DefaultSettingsValidator
     implements SettingsValidator
 {

Reply | Threaded
Open this post in threaded view
|

[maven] 03/03: [MNG-5577] Migrate to JSR 300 Annotations - maven-embedder

slachiewicz
In reply to this post by slachiewicz
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-5577
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 46b0f826a49416073b0b9429eb73d25871666679
Author: Sylwester Lachiewicz <[hidden email]>
AuthorDate: Fri Jan 11 03:19:11 2019 +0100

    [MNG-5577] Migrate to JSR 300 Annotations - maven-embedder
---
 maven-embedder/pom.xml                                    |  8 --------
 .../configuration/SettingsXmlConfigurationProcessor.java  | 15 +++++++++------
 maven-embedder/src/site/apt/logging.apt                   | 15 +++++++++------
 3 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index 33cbabc..7ec7de9 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -100,10 +100,6 @@ under the License.
       <artifactId>org.eclipse.sisu.plexus</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-component-annotations</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.sonatype.plexus</groupId>
       <artifactId>plexus-sec-dispatcher</artifactId>
     </dependency>
@@ -175,10 +171,6 @@ under the License.
         <artifactId>sisu-maven-plugin</artifactId>
       </plugin>
       <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-component-metadata</artifactId>
-      </plugin>
-      <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
         <configuration>
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java b/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
index 2536a22..d32b32b 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java
@@ -43,14 +43,17 @@ import org.apache.maven.settings.building.SettingsBuildingRequest;
 import org.apache.maven.settings.building.SettingsBuildingResult;
 import org.apache.maven.settings.building.SettingsProblem;
 import org.apache.maven.settings.crypto.SettingsDecrypter;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 import org.slf4j.Logger;
 
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
 /**
  * SettingsXmlConfigurationProcessor
  */
-@Component( role = ConfigurationProcessor.class, hint = SettingsXmlConfigurationProcessor.HINT )
+@Named ( SettingsXmlConfigurationProcessor.HINT )
+@Singleton
 public class SettingsXmlConfigurationProcessor
     implements ConfigurationProcessor
 {
@@ -65,13 +68,13 @@ public class SettingsXmlConfigurationProcessor
     public static final File DEFAULT_GLOBAL_SETTINGS_FILE =
         new File( System.getProperty( "maven.conf" ), "settings.xml" );
 
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private SettingsBuilder settingsBuilder;
 
-    @Requirement
+    @Inject
     private SettingsDecrypter settingsDecrypter;
 
     @Override
diff --git a/maven-embedder/src/site/apt/logging.apt b/maven-embedder/src/site/apt/logging.apt
index 800857c..9bf8e3c 100644
--- a/maven-embedder/src/site/apt/logging.apt
+++ b/maven-embedder/src/site/apt/logging.apt
@@ -64,21 +64,24 @@ Maven Logging
 
 * Getting Logger Instance
 
- Plexus Logger and LoggerManager can be injected in Plexus component using Plexus annotations
+ Plexus Logger and LoggerManager can be injected into component using JSR 300 annotations
 
 +------+
 import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
 
-@Component( role = MyComponent.class )
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+@Named
+@Singleton
 public class DefaultMyComponent
     implements MyComponent
 {
-    @Requirement
+    @Inject
     private Logger logger;
 
-    @Requirement
+    @Inject
     private LoggerManager loggerManager;
 }
 +------+