I have 3 repositories. In one there is parent-pom.xml, which is a parent for A1 and B1 repository. The B1 repository also has A1-repository in dependencies. If I change the version in parent-pom.xml, I have to manually change it also in A1-pom.xml and B1-pom.xml. Can it be automated somehow?
Automatic versioning dependencies in child modules using parent pom, Java+maven
906 Views Asked by Alice Victoria At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in MAVEN-3
- JENKINS Maven Build Failure
- ClassNotFoundException: com.ibm.mq.jms.MQConnectionFactory (Websphere MQ 7.5 + spring jms + maven tomcat 7 plugin)
- Maven: how to build jar and include as a dependency
- Profile property not resolving in POM - Maven 3.2.1
- How to change hibernate.cfg.xml file path through maven when building project?
- mvn archetype:generate issue
- Batch file - What is the root folder when using -f
- Maven 3.0.5 refuses our updated nexus certificate
- Maven in OSX Keeps Compiling with Java 1.5
- Maven implicit profile Activation
- PluginResolutionException when I run mvn test on the project
- Maven not working when 'mvn package' command is run
- how to define path to superpom?
- Unable to load the mojo 'set-version' in the plugin due to an API incompatibility
- Maven -D options not working in Windows 7
Related Questions in MAVEN-PLUGIN
- Auto reload with play2
- Maven installation error in Eclipse Indigo
- Profile property not resolving in POM - Maven 3.2.1
- mvn archetype:generate issue
- Is it mandatory to specify maven-failsafe-plugin to run integration tests?
- Maven java.exec environment variable is picked up by maven, but not picked up by the class
- The method is undefined for the type [Class Name]
- What is priority of parameters passed to maven plugin?
- Copy runnable jar after install
- Compilation Error on maven
- Running main method from test class via maven
- What is the syntax to run a maven plugin from the command line.
- aspectj within a maven plugin fails to call pointcut
- Maven compile-phase bound plugin running to late.
- Able to generate documentation using mvn site command without using mvn-site-plugin
Related Questions in AUTO-VERSIONING
- project version in .exe-filename
- Modifying AndroidManifest.xml with build tag causes infinite rebuilding in Eclipse
- Versioned containers
- Adding some automatic versioning to CSS files. How come I'm not able to pull assembly info?
- How to commit subversion revision with every commit in order to refer between two repositories
- Forcing the browser to reload css/js only if they have changed
- Best way to specify version in REST service calls
- How to auto increase versioning so that browser can automatically reload the JS/CSS files without having to clear the cache manually
- PHP Get version from url
- In a Golang application, how to embed a version in a other package than main?
- Issue with htaccess redirect for static file versioning not working with .min file names
- How can I update a revision number in a not modified file for every commit having also this file committed?
- Autoversioning CSS/JS in ASP.NET MVC?
- Auto-versioning of static content with JBoss
- How to Add an Auto Version Number in Latex?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As you said parent pom is the solution. If you declare in parent pom, you dont need to declare in child pom where the dependencies get inherited automatically. There are 2 concepts while declaring parent and child pom.xml
<dependencies>tag.Parent pom.xml
Child pom.xml
Now you dont need to include this dependency in your child pom.xml unless you want to change the version. But the drawback of using is , child pom.xml will inherit all the dependencies irrespective of whether child needs the dependency or not.
<dependencyManagement>tag.Parent pom.xml
Child pom.xml
With
<dependencyManagement>tag, you are not actually including dependencies in child module. You need to declare the required dependencies explicitly if you need it. You dont need to mention the version of the dependency which will be taken from the parent pom.xml. This<dependencyManagement>tag will be very helpful when you have one common parent pom where you declare all dependencies, all the child pom.xml will inherit the version and declare the dependencies what they really need instead of inheriting every declared dependency.For more clarity on
<dependencies>and<dependencyManagement>, please refer this SO answers