Uploaded image for project: 'Maven Resolver'
  1. Maven Resolver
  2. MRESOLVER-90

HTML content in POM: Maven should validate content before storing in local repo

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.0
    • 1.7.0
    • None
    • both with maven 3.6.0 in CMD or in Eclipse 4.9.0

    Description

      For some odd reasons somethimes errors just happen and a maven repo delivers an HTML error or login page for a request of a POM or JAR file. It seems as if the status code is valid then Maven (might be anything under the hood, maybe even ether?) is saving the result without any sanity check or validation.

      Therefore I frequently end up with "POM" or "JAR" files in my local repo that are no XML but HTML nonsens.

       

      Example:

      <!--
         DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
       
          Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
       
          The contents of this file are subject to the terms
          of the Common Development and Distribution License
          (the License). You may not use this file except in
          compliance with the License.
      
          You can obtain a copy of the License at
          https://opensso.dev.java.net/public/CDDLv1.0.html or
          opensso/legal/CDDLv1.0.txt
          See the License for the specific language governing
          permission and limitations under the License.
      
          When distributing Covered Code, include this CDDL
          Header Notice in each file and include the License file
          at opensso/legal/CDDLv1.0.txt.
          If applicable, add the following below the CDDL Header,
          with the fields enclosed by brackets [] replaced by
          your own identifying information:
          "Portions Copyrighted [year] [name of copyright owner]"
      
          $Id: index.html,v 1.2 2008/06/25 05:48:51 qcheng Exp $
      
      -->
      
      
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
      <html>
      <head>
      <title>Please Wait While Redirecting to Login page</title>
      
      <script language="JavaScript"> <!--
      
      function redirectToAuth() {
          var params = getQueryParameters();
          var url = 'UI/Login';
      
          if (params != '') {
              url += params;
          }
          top.location.replace(url);
      }
      
      function getQueryParameters() {
          var loc = '' + location;
          var idx = loc.indexOf('?');
          if (idx != -1) {
              return loc.substring(idx);
          } else {
              return '';
          }
      }
      //-->
      </script>
      </head>
      
      <body bgcolor="#FFFFFF" onLoad="redirectToAuth();">
      </body>
      </html>
      

      I would expect maven to verify the content before officially placing it in the correct location inside the local maven repository on my disc.

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              hohwille Jörg Hohwiller
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: