Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Maven Integration (M2E) » Question or suggestion: sorting dependencies?
Question or suggestion: sorting dependencies? [message #27190] Thu, 28 May 2009 17:05 Go to next message
Yves Schumann is currently offline Yves Schumann
Messages: 40
Registered: July 2009
Member
Hi

We've got some projects with a huge list of dependencies. Because of the
amount of entries this list is not really usable, especially if a
dependency should be found. This is the case on the list of dependencies
on the pom-Editor and on the Maven dependency list on the project itself.

Some of our developers made the suggestion, that it would be very nice,
if this list could be sorted. So what do you think about a sort function
on the pom-Editor? The best solution would be sorting by two columns:
Sorting by GroupID and/or sorting by ArtifactID.

The next point is, that the entries listed on the Maven dependencies on
the project itself are using the same order than given on the pom file.
But on this location I think the situation is a little bit more complex.
After a dependency out of the pom file you can see at first the
dependencies of this dependency and after that the next dependency out
of the pom file. Understand what I try to describe?

Let's say, that in the pom file the two jar's "foo.jar" and "bar.jar"
are given as dependencies. The first dependency "foo.jar" has a
dependency to "doom.jar". This appears on the Maven dependency list on
the project in this order:

- foo.jar
- doom.jar
- bar.jar

As you can see, with a huge amount of dependencies of dependencies
a.s.o. this would be very confusing. If this list could be sorted, the
usage would be way more clear:

- bar.jar
- doom.jar
- foo.jar


Any sentiments on this suggestion?


Regards,
Yves
--
Ballistische Experimente mit kristallinem H2O unterliegen auf dem
Gelände der pädagogischen Institution striktester Prohibition.
--
MfG
Yves
[eisfair-team]

"Das Geheimnis der Medizin besteht darin, den Patienten abzulenken,
während die Natur sich selbst hilft." -- Voltaire
Re: Question or suggestion: sorting dependencies? [message #27267 is a reply to message #27190] Fri, 29 May 2009 04:16 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene Kuleshov
Messages: 505
Registered: July 2009
Senior Member
Yves Schumann wrote:
> We've got some projects with a huge list of dependencies. Because of the
> amount of entries this list is not really usable, especially if a
> dependency should be found. This is the case on the list of dependencies
> on the pom-Editor and on the Maven dependency list on the project itself.
>
You can use the search field at the top of the editor to
search/locate/filter the dependency list. Is it not sufficient?
> Some of our developers made the suggestion, that it would be very nice,
> if this list could be sorted. So what do you think about a sort function
> on the pom-Editor? The best solution would be sorting by two columns:
> Sorting by GroupID and/or sorting by ArtifactID.
>
> The next point is, that the entries listed on the Maven dependencies on
> the project itself are using the same order than given on the pom file.
> But on this location I think the situation is a little bit more complex.
> After a dependency out of the pom file you can see at first the
> dependencies of this dependency and after that the next dependency out
> of the pom file. Understand what I try to describe?
>
> Let's say, that in the pom file the two jar's "foo.jar" and "bar.jar"
> are given as dependencies. The first dependency "foo.jar" has a
> dependency to "doom.jar". This appears on the Maven dependency list on
> the project in this order:
>
> - foo.jar
> - doom.jar
> - bar.jar
>
> As you can see, with a huge amount of dependencies of dependencies
> a.s.o. this would be very confusing. If this list could be sorted, the
> usage would be way more clear:
>
> - bar.jar
> - doom.jar
> - foo.jar
>
> Any sentiments on this suggestion?
>
The order of resolved dependencies is controlled by Maven and it can't
be changed by any other means other then editing your pom.xml (i.e.
change order there and explicitly declare transitive dependencies). Note
that order of dependencies affects the actual classpath, e.g. if there
are two jars with the same class name, the JVM or compiler will only see
the first one, but if you change the order, then it would see the other
one. It means that just by sorting those dependencies in pom.xml you can
easily break the build, so I would recommend to use such sorting with
high caution.

regards,
Eugene
Re: Question or suggestion: sorting dependencies? [message #27304 is a reply to message #27267] Fri, 29 May 2009 07:28 Go to previous message
Yves Schumann is currently offline Yves Schumann
Messages: 40
Registered: July 2009
Member
Hello

Eugene Kuleshov schrieb:
> You can use the search field at the top of the editor to
> search/locate/filter the dependency list. Is it not sufficient?

Yes and no. I know this feature but to use this, the developer needs to
know detailed what to search. If you can "see" the entries, it's way
more comfortable.


> The order of resolved dependencies is controlled by Maven and it can't
> be changed by any other means other then editing your pom.xml (i.e.
> change order there and explicitly declare transitive dependencies). Note
> that order of dependencies affects the actual classpath, e.g. if there
> are two jars with the same class name, the JVM or compiler will only see
> the first one, but if you change the order, then it would see the other
> one. It means that just by sorting those dependencies in pom.xml you can
> easily break the build, so I would recommend to use such sorting with
> high caution.

Yes, that't right, this possibility is well known. But in our case all
the dependencies are defined on a konfiguration project and the modules
only say, which dependency they require but _not_ the version of this
dependency. So the dependencies with the version to use are only defined
one time. OK, there may be other transient dependencies but that's the
risk of the game... ;-)


Regards,
Yves
--
"Jede hinreichend fortschrittliche Technologie ist von Magie nicht zu
unterscheiden." -- Arthur C. Clarke
Previous Topic:M2_REPO
Next Topic:Problem with m2eclipse Ecore Pom model
Goto Forum:
  


Current Time: Sun Oct 26 01:16:04 GMT 2014

Powered by FUDForum. Page generated in 0.01776 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software