AFAIR In Maven 2.x it was possible to put anything in scopes and it was
very error prone because any unknown scope was silently transformed into
compile scope
In 3.x the choice was done to strictly check the scope with ones known by
Maven.
I agree that an API to declare new scope using extensions may be a good
thing but the problem we'll have to take care of the behavior to load such
extension when maven find such unknown scope and how old versions will
manage them.


On Tue, Jul 30, 2013 at 2:22 PM, Francesco Mari <mari.france...@gmail.com>wrote:

> Hi,
>
> I was wondering why using custom dependency scopes issues a warning
> when the POM model is validated. Why Maven just don't ignore dependecy
> scopes he cannot understand?
>
> I was thinking to treat dependency scopes in a different way. The only
> logic I've found about dependency scopes is in [1] and [2] (I'm pretty
> sure there is more around), respectively how dependency scope
> inheritance is computed and whether to import POM dependencies with
> scope "import".
>
> Can this logic be encapsulated in a component which is able to track
> other optional "dependency scope" components? Each "dependency scope"
> component will define a new dependency scope and will encapsulate the
> rules about it (i.e. what happens if a dependency of the given scope
> is inherited, if it can be imported, and so on).
>
> An alternative and simpler solution could be that a "dependency scope"
> component maps a custom dependency scope to one standard scope defined
> by Maven, so to establish an "is-a" relationship between a custom
> dependency scope and a standard one.
>
> What do you think?
>
> [1]:
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java#L351
> [2]:
> https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L876
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


-- 
-----
Arnaud Héritier
http://aheritier.net
Mail/GTalk: aheritier AT gmail DOT com
Twitter/Skype : aheritier

Reply via email to