versions: Regression in 2.14.0

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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 12
  • Comments: 37 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Fix merged.

Please someone more to also check.

I can release 2.14.1 tomorrow πŸ˜„

⚠️ Version 2.14.1 released - please retest

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

Same issue here! Thanks for acting quick!

I see that not everybody is constraining the plugin version, already 3 Apache projects suffering from the bug.

I hope we will have a fix soon πŸ˜„

could you try your test case against my branch? Thanks

2.15.0-SNAPSHOT - built from 60cda6ac, 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>

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

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

@slawekjaranowski it’s not an issue with the plugin – it’s not even been executed.

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

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 πŸŽ‰

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.

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

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

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