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

Combine "maven_jar" and "java_import". Allow maven to work outside of WORKSPACE. #1439

Closed
michaelsafyan opened this issue Jun 23, 2016 · 5 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request

Comments

@michaelsafyan
Copy link

Right now, one can import maven artifacts via maven_jar. However, it only works within the WORKSPACE file. This is problematic for organization, especially if many such jars are listed. For example, if I want these artifacts to be organized in a third-party directory structure, like:

   third_party/google/guava
   third_party/google/dagger2
   third_party/google/gae
   third_party/apache/log4j
   ...

... the restriction on listing these all in WORKSPACE becomes problematic. On top of that, it seems that maven_jar seems to serve much the same purpose as java_import, except that java_import looks for the JAR file locally. Consider merging these into a single rule (where one can specify either "jars" for local jar files or "maven_artifact" for downloading from maven).

@philwo philwo added type: feature request P3 We're not considering working on this, but happy to review a PR. (No assignee) category: extensibility > external repositories labels Jun 24, 2016
@davidzchen
Copy link
Member

FWIW, java_import looks for a JAR file that is within the workspace. A hypothetical local_jar rule that searches for JARs outside the workspace would still be a repository rule since it is non-hermetic and would, under the current convention, be restricted to the WORKSPACE file.

In order to combine maven_jar with java_import, we would need to decide whether we should allow non-hermetic repository rules to be intermixed with conventional build rules in BUILD files.

@michaelsafyan
Copy link
Author

At the very least, allow non-hermetic rules under "third_party" (or some
whitelist of directories specified on the command line), please. Without
that, WORKSPACE files can become unacceptably large and disorganized.

On Wed, Jun 29, 2016, 18:02 David Z. Chen [email protected] wrote:

FWIW, java_import looks for a JAR file that is within the workspace. A
hypothetical local_jar rule that searches for JARs outside the workspace
would still be a repository rule since it is non-hermetic and would, under
the current convention, be restricted to the WORKSPACE file.

In order to combine maven_jar with java_import, we would need to decide
whether we should allow non-hermetic repository rules to be intermixed with
conventional build rules in BUILD files.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1439 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAKPdRIYtiZGRt1wAMx-dvgoSH_mIiYfks5qQut1gaJpZM4I8Wgy
.

@kchodorow
Copy link
Contributor

You can use load() statements from WORKSPACE files, to keep them shorter and more readable.

@zhexuany
Copy link
Contributor

@kchodorow Any updates about this particular issue?

@kchodorow
Copy link
Contributor

What in particular are you looking for? You can currently use load statements and we are working on allowing recursive workspaces (#1943).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants