-
Notifications
You must be signed in to change notification settings - Fork 29
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
Maven plugin for dumping dependencies (cross-repo navigation) #735
Conversation
Provided, | ||
"org.apache.maven" % "maven-project" % "2.2.1" | ||
), | ||
Compile / resourceGenerators += |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maven has a special packaging mode for plugins, which seems to be nothing more than a post-processing step that introspects the plugin's pom.xml + all the Mojo files, then writes the special plugin.xml file.
https://maven.apache.org/guides/plugin/guide-java-plugin-development.html
Setting up a Maven build just for that seems to be counterproductive, so we just write the plugin.xml
by hand using a template. It's obviously not great, but at this point I don't see a better solution, and we don't expect this plugin to change very frequently.
plugin.xml
will be force-kept in sync by tests, because Maven derives a lot of information from it, so if it's broken - things won't work.
For local development this allows you to do mavenPlugin/publishM2
and use that in maven builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I love sbt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻 Very nice to finally have a Maven plugin. After using Gradle more, I've become fonder of Maven for Java projects (although sbt is still the best JVM build tool, haven't tried Mill much)
Provided, | ||
"org.apache.maven" % "maven-project" % "2.2.1" | ||
), | ||
Compile / resourceGenerators += |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I love sbt
if (artifact.getFile() != null) { | ||
builder.append( | ||
String.format( | ||
"%s\t%s\t%s\t%s\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TSV ftw!
GRAPH-796
This PR adds a maven plugin that can be used to produce
dependencies.txt
file necessary for cross-repo navigation on Sourcegraph.It can be used in a standalone invocation:
Or added directly to maven build and run with
sourcegraph:sourcegraphDependencies
Test plan