question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Read the variables from Maven/Gradle plugin

See original GitHub issue

I use the plugin and the Maven plugin.

I defined some variables in the Maven plugin, e.g. sources_path, I only write sources_path and the Java class filename when I include some source codes. Then the Maven plugin can deal with the document.

But the plugin does not deal with the variables, so it does not show the code when I open the preview.

Could it read the variables from Maven/Gradle plugin?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ahus1commented, Dec 2, 2021

I mark this issue as a “help wanted”. I as a maintainer am willing to help anyone who wants to take up this task.

The current functionality around finding attributes inside the current project is within the class AsciiDocUtil.findAttributes(). Some search the whole file, some search attribute relevant to the selected PsiElement (that usually means the current file).

One first approach could be:

  • find all pom.xml files in the project
  • search for the Asciidoctor Maven Plugin and extract the attributes
  • add the attributes to the list

The AsciiDocUtil.collectAntoraAttributes() take a similar approach to collect attributes specific to Antora.

Further improvements could include (not necessarily in the first iteration):

  • support might be limited to those scenarios where the project has Maven support enabled in the IDE/in the project; it could try to leverage exiting Maven support within the JetBrains platform
  • if the attribute value in the pom.xml contains Maven placeholders (like for example ${project.build.sourceDirectory}), these could be replaced
  • the Maven plugin defines a sourcedir. Given some evaluation, it might make sense to restrict attributes declared in the maven module to files in that source directory. Please discuss.

Again, I’m willing to support everyone who wants to take up this task. The Contributor’s Guide for Coders contains information how to setup a coding environment for this plugin.

0reactions
diguagecommented, Dec 18, 2020

@ahus1 It is a great solution. Thanks a lot!

The best solution might take time. But the trade-off solution is already a huge improvement. Thank you again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

In gradle, how to use a variable for a plugin version?
As of Gradle 5.6, you can declare your plugin versions in the gradle.properties file, and reference these properties in plugins block.
Read more >
Using Gradle Plugins
See plugin version management if you want to use a variable to define a plugin version. ... This tells Gradle to first look...
Read more >
Maven Publish Plugin - Gradle User Manual
The Maven Publish Plugin provides the ability to publish build artifacts to an Apache Maven repository. A module published to a Maven repository...
Read more >
The Java Plugin - Gradle User Manual
The Java plugin adds Java compilation along with testing and bundling capabilities to a project. It serves as the basis for many of...
Read more >
The Signing Plugin - Gradle User Manual
The Signing Plugin currently only provides support for generating OpenPGP signatures (which is the signature format required for publication to the Maven ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found