Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional config for library dependency maps to incorrect scope #162

Closed
harrah opened this issue Jan 5, 2013 · 1 comment
Closed

optional config for library dependency maps to incorrect scope #162

harrah opened this issue Jan 5, 2013 · 1 comment
Labels

Comments

@harrah
Copy link
Owner

harrah commented Jan 5, 2013

"optional" config for library dependency is just a flag and shouldn't really map to a scope.

For example, having the following as library dependency:

libraryDependencies ++= "com.h2database" % "h2" % "1.2.147" % "optional"

results in the relevant dependency section as thus:

<dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
  <version>1.2.147</version>
  <scope>optional</scope>
  <optional>true</optional>
</dependency>

Per Maven's POM Reference, the scope is not a valid one. In this particular case, it should have been <scope>compile</scope> (the default).

This also means that the following rare and edge case is actually valid:

<dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
  <version>1.2.147</version>
  <scope>runtime</scope>
  <optional>true</optional>
</dependency>

But there isn't a way to add such a dependency because "runtime" and "optional" are both treated as Configuration, and multiple Configurations are not allowed.

@harrah
Copy link
Owner Author

harrah commented Jan 5, 2013

IMPORTANT This project has moved to https://github.com/sbt/sbt. This issue still exists to avoid dead links, but GitHub limitations prevent the original issue from being correctly preserved here. Please see sbt/sbt#162 for the full issue and to comment.

@harrah harrah closed this as completed Jan 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant