views:

14

answers:

1

I'm trying to write a custom Maven plugin that will parse the SCM changelog of the current Maven project, as well as any of its direct dependencies.

I know that MavenProject.getScm().getConnection() returns the connection URL of the current project. However, I would also like to retrieve the connection URL of any direct dependencies. (They are already defined in each dependency's pom.xml)

I looked at MavenProject.getDependencies(), but it returns a List of Dependency objects which doesn't seem to contain the information I need.

Does anyone know how I can retrieve this information?

+1  A: 

You will have to get instance of MavenProject for each of the dependencies, e.g. obtain instance of the MavenProjectBuilder and build MavenProject instance with it.

See the following question for a sample code snippet for resolving an individual dependency.

Eugene Kuleshov