languagetool-org / french-pos-dict

French part-of-speech dictionary
Other
3 stars 2 forks source link

artifact's pom.xml has wrong version description #19

Open miurahr opened 1 month ago

miurahr commented 1 month ago

Published jar bundles pom.xml with a wrong version string ${env.FR_DICT_VERSION}

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.languagetool</groupId>
    <artifactId>french-pos-dict</artifactId>
    <version>${env.FR_DICT_VERSION}</version>
    <url>https://languagetool.org</url>
    <name>French part-of-speech dictionary</name>
    <description>A French part-of-speech (POS) dictionary as a Morfologik binary</description>

Affected version : 0.6 The jar file checked: https://repo1.maven.org/maven2/org/languagetool/french-pos-dict/0.6/ A path in archive: /META-INF/maven/org.languagetool/french-pos-dict/pom.xml

miurahr commented 1 month ago

It may be caused by GitHub actions script

    - name: Update dictionary version in LT pom.xml
      working-directory: ${{ env.FR_DICT_HOME }}
      run: |
        poetry run python "dict_tools/scripts/update_pom.py" \
          --new-version "${{ env.FR_DICT_VERSION }}" \
          --package-name "french-pos-dict"
danielnaber commented 1 month ago

@jaumeortola Any idea what the issue might be?

miurahr commented 1 month ago

When prepare gradle project with configuration like

plugins {
  id 'java'
}

repositories {
  mavenCentral()
}

dependencies {
  implementation 'org.languagetool:language-fr:6.4'
}

and run gradle command like

./gradlew dependencies --scan

then I got command output

runtimeClasspath - Runtime classpath of source set 'main'.
\--- org.languagetool:language-fr:6.4
     +--- org.languagetool:french-pos-dict:0.6 FAILED

and gradle scan report

inconsistent module metadata found. Descriptor: org.languagetool:french-pos-dict:${env.FR_DICT_VERSION} Errors: bad version: expected='0.6' found='${env.FR_DICT_VERSION}'

It cause any downstream project which use gradle as build system got error from french module.

miurahr commented 1 month ago

It was "0.5" in v0.5 release. It become ${env.FR_DICT_VERSION} in v0.6. https://github.com/languagetool-org/french-pos-dict/blob/master/results/java-lt/pom.xml#L8

p-goulart commented 1 month ago

@miurahr obviously something's wrong when resolving the environment variables. I'll have a look and report back soon. I'll follow up on this in the Portuguese repo and propagate the solution to this one once I've got it.

p-goulart commented 1 month ago

The issue is fixed in the GHA workflow (as it is for Portuguese).

As discussed in https://github.com/languagetool-org/portuguese-pos-dict/issues/44, this will affect future releases, but changing the version in the POM of already released artefacts will require extra juggling of Nexus permissions. I'll talk about it with @jaumeortola once he's back.