You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2023/10/06 22:34:43 UTC

[PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

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

   https://issues.apache.org/jira/browse/MNG-7901
   
   ---
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
          for the change (usually before you start working on it).  Trivial changes like typos do not
          require a JIRA issue. Your pull request should address just this issue, without
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line and body.
    - [x] Format the pull request title like `[MNG-XXX] SUMMARY`,
          where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA issue.
    - [x] Also format the first line of the commit message like `[MNG-XXX] SUMMARY`.
          Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
          be performed on your pull request automatically.
    - [x] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352883111


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   So as a target and clean implementation should be:
   -  org.apache.maven.api.services.xml.MetadataXmlFactory - in api/maven-api-core
   - new module api/maven-api-metadata - with model
   
   And then deprecated MetadataXpp3Reader should mention as replacement MetadataXmlFactory
   
   I'm on right way?



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352539838


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   @gnodet is this deprecation actually a redirection to API? Or why are these classes deprecated? Also, how is Maven4 loading up metadata? Also, how is app using maven-repository-model as lib supposed to load metadata?



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352549080


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   The Xpp3 parsers/writers have been deprecated in favour of the Stax ones.  This is unrelated to any v3 / v4 API change. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1350147594


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   You are right, we should point what is replacement in v4.



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352605710


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   Ah, I think you're right.  Those two classes were removed when introducing the v4 api, later brought back to restore compatibility with Maven 3 but in a deprecated state.  So this is definitely a deprecation to switch to the v4 api.  Might be slightly premature though...
   Anyway the layout is the same as for the maven model: the old v3 model for metadata is layered on top of the immutable one for v4.  Maybe the v4 generated model should be moved into the a `api/maven-api-metadata` module ?



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski merged PR #1274:
URL: https://github.com/apache/maven/pull/1274


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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1350119788


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

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

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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1353032315


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   I think so.  Not completely sure about the MetadataXmlFactory as it is only available from inside maven. For outside maven (tooling reading the repositories somehow), we may want to point to the Stax reader too.  I guess both should be mentioned.



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1355192506


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   I added info that `MetadataStaxReader/Writer` should be used instead.
   
   Exposing new `MetadataXmlFactory` I would like to postpone to another issue/PR if really will be 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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1350179172


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   @gnodet - Should we prefer `org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader` for v4 or should be something added in api model.
   
   Now everything is in `maven-repository-metadata` module



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352165098


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   @cstamas, @gnodet 
   This depreciation was not introduced by this PR.
   
   To remember and improvements I've create an issue: 
   https://issues.apache.org/jira/browse/MNG-7903



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352608061


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   Maybe we should not add a technology used by parser in class name. 
   
   When some days we figure out to use SuperFoo Xml parser we next change classes from MetadataStaxReader to MetadataSuperFooReader again?
   
   Maybe name should be like MetadataXmlReader



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352609890


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   The v4 api offers an abstraction for xml parsing/writing when used inside Maven:
     https://github.com/apache/maven/tree/master/api/maven-api-core/src/main/java/org/apache/maven/api/services/xml
     



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352606654


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   this class now delegate work to stax - we need preserve name for compatibility.



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


Re: [PR] [MNG-7901] Use MetadataStaxReader/Writer in MetadataXpp3Reader/Writer [maven]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1274:
URL: https://github.com/apache/maven/pull/1274#discussion_r1352577881


##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   But this pr is about to change reader/writer from xpp to stax? So am confused now 🤔



##########
maven-repository-metadata/src/main/java/org/apache/maven/artifact/repository/metadata/io/xpp3/MetadataXpp3Reader.java:
##########
@@ -26,22 +26,23 @@
 import java.io.Reader;
 
 import org.apache.maven.artifact.repository.metadata.Metadata;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
- * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataXpp3Reader}
+ * Provide public methods from {@link org.apache.maven.artifact.repository.metadata.io.MetadataStaxReader}
  *
  * @deprecated Maven 3 compatability
  */
 @Deprecated

Review Comment:
   But this pr is about to change reader/writer from xpp to stax? So am confused 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-unsubscribe@maven.apache.org

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