Always update Snapshots - I can't get it to work

已回答

Context:

  • I have a project with many modules that change rapidly.
  • Each module builds into its own .jar or .war and is currently stored in the repository.
  • Currently using only the local repository but will eventually use gitHub.
  • I absolutely DO NOT want to change the version number in every POM when the version of one of the dependencies I build changes.  I want to do it for releases or even major checkpoints, but not for Snapshots as the overhead of doing this would be excessive and very error prone.

Issue:

  • Module 2 depends on module 1.
  • I did clean and install of module 1.  In the local repository folder I see its .jar and it has today's date.
  • When I build module 2's JAR I see it in the local repository, but inside it includes a version of module 1 from JANUARY!!!  This happens even when I completely wipe all of the contents of the local repository.  It is clear that IntelliJ is caching the old version of the JAR somewhere.  Even if wiping the local repository had worked, it is not something I want to do at each build long term.

 

Attempts to solve:

  • I checked Settings/Build,Execution,Deployment/BuildTools/Maven/"Always update snapshots" as it is supposed to ensure that dependencies will get reloaded even if the dependency version number does not change.  No effect.  This appears to be bugged, or I am using it wrong.
  • In the POM I tried to use the syntax <version>[0.0.1, 0.0.999)-SNAPSHOT</version> with the intention of changing the version of just module 1 every time I do a minor change.  No such luck.  Apparently Maven 4 no longer supports that syntax or I am using it wrong.

 

QUESTION:

What options do I have so that I can specify exact versions of all open source dependencies, exact versions of dependencies that I create when it is a RELEASE version, but not have to update the version of changed dependent projects in every single POM in my many interdependent projects every time I build?

评论操作 固定链接

>What options do I have so that I can specify exact versions of all open source dependencies, exact versions of dependencies that I create when it is a RELEASE version, but not have to update the version of changed dependent projects in every single POM in my many interdependent projects every time I build?

This sound more like Maven related question rather than IntelliJ IDEA-specific. Have you tried asking on the corresponding Maven forums?

As for the snapshot versions not being updated:

How do specify the artifacts in pom.xml and how you specify the dependencies on them?

Have you tried Reload action in Maven tool window after you update the dependency?

>When I build module 2's JAR I see it in the local repository, but inside it includes a version of module 1 from JANUARY!!! 

What result do you get when building by Maven from the command line?

0

请先登录再写评论。