last day (15 days later) » 

13:32
2
A: How to use properties of one maven project in other maven project

JF MeierNo, you cannot use properties from dependencies. If you need common properties, you can define them in a parent POM that is used by the different projects (this does not require them to be modules)

I added (first)master project as parent .Got below error Project build error: Non-resolvable parent POM for com.amd:filetounzip:1.0: Failure to find com.amd:master:pom:${artifact.version} in maven.repository.redhat.com/ga was cached in the local repository, resolution will not be reattempted until the update interval of red-hat-ga-repository has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM
Note that you cannot add projects with packaging jar as parent. Parent POMs cannot have any Java code.
Here first(master) project has java code ,hence packaging cannot be changed to pom
Then it cannot be a parent POM. If you want a parent POM, you need to create a new project for that.
My question is not how to add parent tag My question is how to use properties of one maven project in other maven project Please suggest how to do this without creating one more new project and using parent tag
13:32
As I said: This is impossible.
Ok , can we access property from properties file in pom for dependency
What exactly do you mean? Can you give an example?
<dependency>
<groupId>com.amd</groupId>
<artifactId>master</artifactId>
<version>${{master.version}}</version>
</dependency>

properties file
--------------------
master.version=2.0

using below plugin
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<configuration>
<files>
<file>config.properties</file>
<file>${existent.property.file}</file>
</files>
</configuration>
</plugin>
with this i am getting below error
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for com.amd:master:jar must be a valid version but is '${{master.version}}'. @ line 94, column 13
any other way similar to this
Please suggest
You cannot use properties from external files for defining versions of dependencies.
13:40
If you want to set your dependency version through a property, this property has to be either defined in the same POM, or a parent POM, or the settings.xml or on command line.
any example of using settings.xml
will try
Why do you want this in the settings.xml?
As this is one of the option suggested by you

and other options are not suitable in my scenario
when i change master version ,all projects which you master as dependency
should be changed .. is my question
i am ready to try all options
13:47
You know that settings.xml is just on one computer? Other developers will have separate ones.
typo...
when i change master version ,all projects which use master as dependency
should be changed dynamically.. without manually changing version .. is my question
i am ready to try all options
The best solution I know for that is to put all the projects into one multi-module project. Then everything is built together and you always have the newest version of master.
If you want to keep everything in separate projects, then I do not think that you can do this in a sensible way.
Yes this would be the best
but the no of modules/projects is not fixed
module/project will keep on adding as per the requirement
so i did not go for muli-module project
any idea how to achieve this with this rule...
14:05
...
any solution for with condition "no of modules/projects is not fixed.
module/project will keep on adding as per the requirement"
any solution for question - "when i change master version ,all projects which use master as dependency
should be changed dynamically.. without manually changing version .. is my question
with condition "no of modules/projects is not fixed.
module/project will keep on adding as per the requirement"
any other solution except multi-module
please suggest
14:23
No, not really.

last day (15 days later) »