elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.93k stars 24.74k forks source link

JDBC driver wrong artifactId #56415

Closed matriv closed 4 years ago

matriv commented 4 years ago

JDBC 7.6.x poms have wrong artifact id, e.g.: https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack-sql-jdbc/7.6.2/x-pack-sql-jdbc-7.6.2.pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.elasticsearch.plugin</groupId>
  <artifactId>jdbc</artifactId>
  <version>7.6.2</version>
  <inceptionYear>2009</inceptionYear>
  <licenses>
    <license>
      <name>Elastic License</name>
      <url>https://raw.githubusercontent.com/elastic/elasticsearch/v7.6.2/licenses/ELASTIC-LICENSE.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Elastic</name>
      <url>http://www.elastic.co</url>
    </developer>
  </developers>
  <dependencies/>
</project>

artifactId is jdbc instead of x-pack-sql-jdbc.

Also, the 7.7.x, 7.8.0 and 8.0.0 shouldn't be there? seems they are missing.

elasticmachine commented 4 years ago

Pinging @elastic/es-ql (:Query Languages/SQL)

elasticmachine commented 4 years ago

Pinging @elastic/es-core-infra (:Core/Infra/Core)

mark-vieira commented 4 years ago

Seems Maven doesn't care that the artifact id is incorrect, it's still able to resolve the dependency. Gradle however fails when validating the POM, so we can workaround this temporarily by telling Gradle this repository contains only artifacts, effectively making it ignore the POM. This is actually fine since these are fatjars, so the POM actually contains no useful metadata. When defining your repository in your build script, do the following:

repositories {
  maven {
    url = 'https://artifacts.elastic.co/maven'
    metadataSources {
      artifact()
    }
  }
}
mark-vieira commented 4 years ago

Ok, this has been fixed now for all branches back to 7.6.

@mgreau is there way to republish broken artifacts on https://artifacts.elastic.co/maven? We have some malformed POMs up there for our JDBC client that can cause users some grief.

matriv commented 4 years ago

I guess it's ok to close this now @mark-vieira ?