You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thomas Darbois <Th...@edifixio.com> on 2008/07/18 17:21:54 UTC
scope "Optional"
I'm having some trouble with the scope Optional and the plugin maven dependency plugin.
I'm having a dependency to an artefact which scope is <scope>optional</scope>. I had to choose this scope because I can't see any other scope that was doing what I wanted : a dependency that I absolutely need during generation sources, compilation and test phases, but that I don't need (and don't want) at runtime, and I don't think I want them through transitive dependency.
I thought that with maven dependency plugin (goal : copy-dependency) I could include only runtime dependencies but this one is coming too, so I tried with exclude optional, and it was throwing an error that says that he doesn't understand what scope is optional.
What should I do? Perhaps I m using a wrong scope?
Tomas Darbois
Edifixio Grenoble - Projet ScorWare
04 76 29 89 27
thomas.darbois@edifixio.com<ma...@edifixio.com>
RE: scope "Optional"
Posted by Thomas Darbois <Th...@edifixio.com>.
Yes i know that, but I saw people using it for a while for there own project and so I assumed it was an option that can be used (and it has a different behaviour than any other listed in the page you've linked). Why maven doesn't display an error or a warning when using an incorrect scope?
And for the use I had of it what is the scope that I should use.
"an artefact that I absolutely need during source's GENERATION, compilation and test source's GENERATION, test Compilation, and test run phases, but that I don't need (and don't want) at runtime, and I probably don't want them through transitive dependency."
Compile: not acceptable because it will be in the runtime.
Test: I'm missing the artefact at least during test generation and I think also for compilation.
Provided : Missing it for tests.
System : not a system library
Runtime : missing during generation and compilation...
I have also an other problem with dependencies : a dependency that I do need for compilation in several modules that are dependant on each other but I strictly don't want it at runtime. I used up to now provided, so that it doesn't appear at runtime, but I had to add it in each pom. I thought in using exclude, but it doesn't do exactly what I need, since I still need to declare the dependence to this artefact in the artefact where I exclude it because I still need it for compilation (and test and stuff like that).
Tomas Darbois
Edifixio Grenoble - Projet ScorWare
04 76 29 89 27
thomas.darbois@edifixio.com
-----Message d'origine-----
De : Wendy Smoak [mailto:wsmoak@gmail.com]
Envoyé : vendredi 18 juillet 2008 17:37
À : Maven Users List
Objet : Re: scope "Optional"
On Fri, Jul 18, 2008 at 8:21 AM, Thomas Darbois
<Th...@edifixio.com> wrote:
> I'm having some trouble with the scope Optional and the plugin maven dependency plugin.
>
> I'm having a dependency to an artefact which scope is <scope>optional</scope>.
Optional isn't a scope, it's a separate element: <optional>true</optional>.
http://maven.apache.org/ref/2.0.8/maven-model/maven.html#class_dependency
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: scope "Optional"
Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Jul 18, 2008 at 8:21 AM, Thomas Darbois
<Th...@edifixio.com> wrote:
> I'm having some trouble with the scope Optional and the plugin maven dependency plugin.
>
> I'm having a dependency to an artefact which scope is <scope>optional</scope>.
Optional isn't a scope, it's a separate element: <optional>true</optional>.
http://maven.apache.org/ref/2.0.8/maven-model/maven.html#class_dependency
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org