Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 2.14.0 #848

Closed
Artur- opened this issue Dec 14, 2022 · 37 comments
Closed

Regression in 2.14.0 #848

Artur- opened this issue Dec 14, 2022 · 37 comments
Labels
Milestone

Comments

@Artur-
Copy link

Artur- commented Dec 14, 2022

git clone https://github.com/vaadin/flow.git
cd flow
mvn versions:set -DnewVersion=1.2.3

Expected outcome:
All modules are set to version 1.2.3, like with 2.13.0

Actual outcome:

[ERROR] 
java.nio.file.NoSuchFileException: /.../flow/flow-tests/test-npm-only-features/test-npm-bytecode-scanning/pom.xml
    at sun.nio.fs.UnixException.translateToIOException (UnixException.java:92)
    at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:106)
    at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:111)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel (UnixFileSystemProvider.java:219)
    at java.nio.file.Files.newByteChannel (Files.java:380)
    at java.nio.file.Files.newByteChannel (Files.java:432)
    at java.nio.file.spi.FileSystemProvider.newInputStream (FileSystemProvider.java:422)
    at java.nio.file.Files.newInputStream (Files.java:160)
    at org.codehaus.plexus.util.xml.XmlReader.<init> (XmlReader.java:129)
    at org.codehaus.plexus.util.xml.XmlStreamReader.<init> (XmlStreamReader.java:67)
    at org.codehaus.plexus.util.ReaderFactory.newXmlReader (ReaderFactory.java:122)
    at org.codehaus.mojo.versions.api.PomHelper.readXmlFile (PomHelper.java:1498)
    at org.codehaus.mojo.versions.AbstractVersionsUpdaterMojo.process (AbstractVersionsUpdaterMojo.java:326)
    at org.codehaus.mojo.versions.SetMojo.execute (SetMojo.java:381)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)

and the version in the following modules is not updated:

flow-tests/test-ccdm-flow-navigation/pom-production.xml
flow-tests/test-ccdm/pom-production.xml
flow-tests/test-custom-frontend-directory/test-themes-custom-frontend-directory/pom-generatedTsDir.xml
flow-tests/test-frontend/test-npm/pom-production.xml
flow-tests/test-frontend/test-pnpm/pom-production.xml
flow-tests/test-frontend/vite-context-path/pom-production.xml
flow-tests/test-frontend/vite-embedded/pom-production.xml
flow-tests/test-frontend/vite-pwa-custom-offline-path/pom-production.xml
flow-tests/test-frontend/vite-pwa-disabled-offline/pom-production.xml
flow-tests/test-npm-only-features/test-npm-bytecode-scanning/pom-devmode.xml
flow-tests/test-npm-only-features/test-npm-bytecode-scanning/pom-prod-fallback.xml
flow-tests/test-npm-only-features/test-npm-bytecode-scanning/pom-production.xml
flow-tests/test-pwa-disabled-offline/pom-production.xml
flow-tests/test-pwa/pom-production.xml
@jarmoniuk
Copy link
Contributor

Gotcha. Sorry about that. I'll look into it.

@pzygielo
Copy link
Contributor

pzygielo commented Dec 14, 2022

I observe similar - version is not set in modules with parent not in ..

  • for modules with <parent>... <relativePath>../..</relativePath>

@pzygielo
Copy link
Contributor

Sorry to hijack this issue, but perhaps it's related.
For my case: 96deb8e is the first bad commit.

@pzygielo
Copy link
Contributor

I suppose it has something to do with the assumptions

if (moduleFile.isDirectory() && new File(moduleFile, "pom.xml").isFile()) {

File parentFile = new File(parentDir, "pom.xml");

that pom.xml is the right file name...

@marthinmc
Copy link

I have the same problem when I do mvn versions:set, please keep us informed

java.nio.file.NoSuchFileException: /home/jenkins/agent/workspace/curve-connector-test_release_0.2/dtos
13:05:59 at sun.nio.fs.UnixException.translateToIOException (UnixException.java:86)

@ghost
Copy link

ghost commented Dec 14, 2022

Also have this issue

@vanroda
Copy link

vanroda commented Dec 14, 2022

Possible workarounds:

  1. fixate plugin version in parent pom
    <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> <version>2.13.0</version> </plugin>

OR

  1. add version to the set cmd
    mvn -q -f pom.xml org.codehaus.mojo:versions-maven-plugin:2.13.0:set

@marthinmc
Copy link

Possible workarounds:

  1. fixate plugin version in parent pom
    <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> <version>2.13.0</version> </plugin>
  2. add version to the set cmd
    mvn -q -f pom.xml org.codehaus.mojo:versions-maven-plugin:2.13.0:set

it works for me! thanks. I didn't have to add it in the parent pom

jarmoniuk added a commit to jarmoniuk/versions-maven-plugin that referenced this issue Dec 14, 2022
@jarmoniuk
Copy link
Contributor

jarmoniuk commented Dec 14, 2022

@pzygielo could you please share some details about your case? Alternatively, could you try your test case against my branch? Thanks

The old assumption about the "pom.xml" file in module directories dates back to the very beginning of the Set mojo. I wonder how (if) it worked in 2.13.0 (the mojo simply skipped files it couldn't resolve). Anyway, the original case as well a simplified case (it-set-issue-848) do work fine with the branch.

And the solution is simple -- since we already have the path, why not use it? :)

Everyone -- until this is released, please use

mvn org.codehaus.mojo:versions-maven-plugin:2.13.0

to get around the problem. Sorry about the inconvenience.

@pzygielo
Copy link
Contributor

could you try your test case against my branch? Thanks

2.15.0-SNAPSHOT - built from 60cda6a, works fine 🎉


could you please share some details about your case?

Here it is extracted to minimum:

.
├── docs
│   └── issue
│       └── pom.xml
└── pom.xml

with top-level having

    <modules>
        <module>docs/issue</module>
    </modules>

and module with

    <parent>
        ...
        <relativePath>../..</relativePath>
    </parent>

Badya added a commit to JetBrains/kotlin that referenced this issue Dec 14, 2022
If version not specified explicitly maven-cli downloads the latest
Regression have been introduced in version 2.14.0
mojohaus/versions#848
Badya added a commit to JetBrains/kotlin that referenced this issue Dec 14, 2022
If version not specified explicitly maven-cli downloads the latest
Regression have been introduced in version 2.14.0
mojohaus/versions#848

(cherry picked from commit 9c1a68f)
@fun2sh
Copy link

fun2sh commented Dec 14, 2022

could you try your test case against my branch? Thanks

2.15.0-SNAPSHOT - built from 60cda6a, works fine 🎉

could you please share some details about your case?

Here it is extracted to minimum:

.
├── docs
│   └── issue
│       └── pom.xml
└── pom.xml

with top-level having

    <modules>
        <module>docs/issue</module>
    </modules>

and module with

    <parent>
        ...
        <relativePath>../..</relativePath>
    </parent>

This is exactly what happens. When there is an intermediate parent directory without pom.xml, it fails to version bump that. It starts looking for that module in root of the project.

@ahannani-rms
Copy link

we have the same issue right now plaguing all of our maven builds because versions:set is essentially resulting in a no-op.

@jarmoniuk
Copy link
Contributor

jarmoniuk commented Dec 14, 2022

we have the same issue right now plaguing all of our maven builds because versions:set is essentially resulting in a no-op.

@ahannani-rms as a workaround, please use

mvn org.codehaus.mojo:versions-maven-plugin:2.13.0:set

@rlucero-okta
Copy link

Is it possible to remove 2.14.0 from maven repositories while the fix is still being worked on?

jarmoniuk added a commit to jarmoniuk/versions-maven-plugin that referenced this issue Dec 14, 2022
@akomakom
Copy link

Is it possible to remove 2.14.0 from maven repositories while the fix is still being worked on?

Or push 2.14.1 with 2.13.0 content?

@slawekjaranowski
Copy link
Member

Is it possible to remove 2.14.0 from maven repositories while the fix is still being worked on?

It is not possible: https://central.sonatype.org/faq/can-i-change-a-component/

By the way is good practice to specific plugins versions in project.

@slawekjaranowski
Copy link
Member

I hope we will have a fix soon 😄

jarmoniuk added a commit to jarmoniuk/versions-maven-plugin that referenced this issue Dec 14, 2022
millems added a commit to aws/aws-sdk-java-v2 that referenced this issue Dec 14, 2022
2.14.0 has a bug (mojohaus/versions#848) that broke us. We should be pinning all build tool versions, anyway.
@ghost
Copy link

ghost commented Dec 15, 2022

Yes - I think it's common to run, e.g., man versions:set for ad-hoc tasks; this means that in the absence of any POM configuration latest is pulled.

@donhui
Copy link

donhui commented Dec 15, 2022

Also have this issue

@alexsuter
Copy link

Same issue here! Thanks for acting quick!

@amoghmargoor
Copy link

Thanks for responding quickly with a fix. really appreciate it.

@slawekjaranowski
Copy link
Member

⚠️ Version 2.14.1 released - please retest

@Artur-
Copy link
Author

Artur- commented Dec 15, 2022

I re ran my original test mentioned above using

mvn org.codehaus.mojo:versions-maven-plugin:2.14.1:set -DnewVersion=1.2.4

and it now produces identical results with 2.13 🎉

@qds-x
Copy link

qds-x commented Dec 15, 2022

warning Version 2.14.1 released - please retest

Can confirm this fixes the regression for me.

@pzygielo
Copy link
Contributor

👍

dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this issue Dec 15, 2022
…amatis Zampetakis reviewed by Laszlo Bodor)

Freeze versions-maven-plugin to 2.13.0 to overcome the regression
 of 2.14.0 (mojohaus/versions#848) causing
the failures in the nightly build.

Using a fixed version is a good practice and can also prevent similar
problems in the future.

Closes apache#3860
@vtintillier
Copy link

2.14.1 fixes it, but for some reason 2.14.0 is still used by default if no version is set on the command line...

@qds-x
Copy link

qds-x commented Dec 15, 2022

2.14.1 fixes it, but for some reason 2.14.0 is still used by default if no version is set on the command line...

Yes I noticed the same, assumed it was just delayed propagation or something

@slawekjaranowski
Copy link
Member

Updating of local stored artifact is done once per day in standard way - repositories->updatePolicy
https://maven.apache.org/settings.html#repositories

In order to pressure update use -U options, eg: mvn -U versions:help

@msg7086
Copy link

msg7086 commented Dec 15, 2022

Our project hits the issue since yesterday, now it works flawlessly. Thanks for the quick fix!

kou added a commit to apache/arrow that referenced this issue Dec 15, 2022
This doesn't solve GH-14949 (CI failure) because it's a problem of  MojoHaus Versions Maven Plugin: mojohaus/versions#848

This adds more debug information on test failure.
* Closes: #14949

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
tarak271 pushed a commit to tarak271/hive-1 that referenced this issue Dec 16, 2022
…amatis Zampetakis reviewed by Laszlo Bodor)

Freeze versions-maven-plugin to 2.13.0 to overcome the regression
 of 2.14.0 (mojohaus/versions#848) causing
the failures in the nightly build.

Using a fixed version is a good practice and can also prevent similar
problems in the future.

Closes apache#3860
@joviegas
Copy link

joviegas commented Dec 20, 2022

mvn versions:commit

is failing with 2.14.1

This used to pass with 2.13.0 and also 2.14.0

<html><head></head><body>

[Container] 2022/12/19 21:42:49 Running command mvn versions:commit
--
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-pom/1.12.368/aws-java-sdk-pom-1.12.368.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.amazonaws:aws-java-sdk-kinesisvideowebrtcstorage:1.12.368: Could not find artifact com.amazonaws:aws-java-sdk-pom:pom:1.12.368 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 5, column 11

</body></html>

Also strange thing is this passes when the build is re-tried , it happens only first time

@slawekjaranowski
Copy link
Member

@joviegas please create new issue - with simple project which allow us to reproduce.

@jarmoniuk
Copy link
Contributor

@slawekjaranowski it's not an issue with the plugin -- it's not even been executed.

@jarmoniuk
Copy link
Contributor

jarmoniuk commented Dec 20, 2022

@joviegas when you execute a Maven command, Maven outputs which plugins it has executed and which modules (POM files) it has processed. In your example, Maven itself (not the plugin) had a problem processing the input files - it could not retrieve the parent file of one of the POM files. In any case, it's not an issue with this plugin.

@joviegas
Copy link

joviegas commented Dec 21, 2022

I pinned the maven plugin version to 2.13.0 and this fixed the issue , without any changes in our code/pom.

--- versions-maven-plugin:2.13.0

Note earlier it was picking the latest one that was 2.14.1 , and we started seeing this issue only for this version.

DongWei-4 pushed a commit to DongWei-4/hive that referenced this issue Dec 29, 2022
…amatis Zampetakis reviewed by Laszlo Bodor)

Freeze versions-maven-plugin to 2.13.0 to overcome the regression
 of 2.14.0 (mojohaus/versions#848) causing
the failures in the nightly build.

Using a fixed version is a good practice and can also prevent similar
problems in the future.

Closes apache#3860

(cherry picked from commit 2cf058b)
rkirtir pushed a commit to rkirtir/hive that referenced this issue Jan 9, 2023
…amatis Zampetakis reviewed by Laszlo Bodor)

Freeze versions-maven-plugin to 2.13.0 to overcome the regression
 of 2.14.0 (mojohaus/versions#848) causing
the failures in the nightly build.

Using a fixed version is a good practice and can also prevent similar
problems in the future.

Closes apache#3860
yeahyung pushed a commit to yeahyung/hive that referenced this issue Jul 20, 2023
…amatis Zampetakis reviewed by Laszlo Bodor)

Freeze versions-maven-plugin to 2.13.0 to overcome the regression
 of 2.14.0 (mojohaus/versions#848) causing
the failures in the nightly build.

Using a fixed version is a good practice and can also prevent similar
problems in the future.

Closes apache#3860
tarak271 pushed a commit to tarak271/hive-1 that referenced this issue Dec 19, 2023
…amatis Zampetakis reviewed by Laszlo Bodor)

Freeze versions-maven-plugin to 2.13.0 to overcome the regression
 of 2.14.0 (mojohaus/versions#848) causing
the failures in the nightly build.

Using a fixed version is a good practice and can also prevent similar
problems in the future.

Closes apache#3860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests