Accessing gradle properties in java jar
Hi Sjbufton, thanks for you reply. No my requirement is, I am devloping a jar which other users will be using in there gradle.build. say complile ‘xxxx.myjar’. Inside my jar code is they any way I can...
View ArticleHow to get publication's full SNAPSHOT filename?
I came up with the following; task showSnapshotVersion() { enabled = project.version.contains('SNAPSHOT') dependsOn publish def repo = publishing.repositories[0] def artifactUrl = repo.url.toString()...
View ArticleConverting Maven plugin to Gradle plugin
The code I posted earlier does not what I want after all. Basically I want to have a custom taks which could loop over all Artifacts in the Configurations. I need the actual File of the artifact as I...
View ArticleConverting Maven plugin to Gradle plugin
So you want the dependency jars? Not the artifacts produced by the project? I think you’d do something like: @InputFiles public FileCollection getImplementationConfiguration() { return...
View ArticleConverting Maven plugin to Gradle plugin
Yes, I want the dependency jars. And thanks for your patience E.g. when I do the getFiles() like: Set<Configuration> configurations = getProject().getConfigurations(); for (Configuration...
View ArticleAccessing gradle properties in java jar
Is your jar a build plugin, or simply a dependency included in some other project? If it is a plugin, of course it can read the build properties. If it’s simply a dependency, there is no code which...
View ArticleConverting Maven plugin to Gradle plugin
Hmm, I’ve seen this “canBeResolved=false” before and never took the time to understand why. I wonder if you can do ConfigurationContainer cc = project.getConfigurations(); Configuration resolvable =...
View ArticleDefault vs. compileClasspath configurations
In eclipse, my gradle project is fine. However, when I try to execute the build from the command line, I get a compilation error saying that a class is missing. The missing class comes from a...
View ArticleConverting Maven plugin to Gradle plugin
I tried. The first option does not contain any files unfortunately… The second option gives Resolving dependency configuration 'implementationCopy' is not allowed as it is defined as...
View ArticleConverting Maven plugin to Gradle plugin
I think you put me in the right direction Glad to hear I wonder if it would be possible to include only the top dependencies defined directly in the configuration. You’re in luck! Just do impl.copy()...
View ArticleConverting Maven plugin to Gradle plugin
Thanks, I will give this a try this evening but I think that will do indeed! Thanks for your help and I will let you know later if it worked.
View ArticleUnable to access System property in Src code
Thank you a lot , Now I am able to access provided System property in Cucumber class, can you please explain why it wasn’t working before,
View ArticleHow to access Gradle extra properties in src code?
task in build.gradle file - task automationTest(type: Test) { ext.env = rootProject.hasProperty('TS1') ? rootProject['TS2'] : 'TS1' println env //printing passed pararmeter successfully } now I want...
View ArticleConverting Maven plugin to Gradle plugin
configuration.copyRecursive() vs configuration.copy() doesn’t seem to matter. From the apidocs I see for copyRecursive: Creates a copy of this configuration that contains the dependencies directly in...
View ArticlePassing `null` or empty String as command line argument in plugin task
Is it possible to pass null or an empty String as command line argument? Having: private String destination = new File(getProject().getBuildDir(), "generated/schema.graphql").getPath(); @Optional...
View ArticleUniversally define a classifier in gradle for a jar
We’re using gradle 6.3. We’ve had a long standing issue with using jar files that are available via a classifier. These jar files include a JNI shared library and some supporting shared libraries that...
View ArticleConverting Maven plugin to Gradle plugin
It can be solved with: copiedConfiguration.setTransitive(true|false); So in my case: Configuration copiedConfiguration = configuration.copyRecursive(); copiedConfiguration.setCanBeResolved(true);...
View ArticlePassing `null` or empty String as command line argument in plugin task
I solved this adding: @Option(option = "no-destination", description = "Prints the schema to the log.") public void setNoDestination(boolean destination) { this.destination = null; } this way I can do...
View ArticleWorking with source generated by an annotation processor
I’m using an annotation processor that creates Java source. Here it is QueryDSL, but I guess it doesn’t matter what annotation processor is used. I have mapped a custom source set to a module...
View ArticleUnable to access System property in Src code
Now I am able to access provided System property in Cucumber class, Great! can you please explain why it wasn’t working before Now where’s the fun in that? You have all the information you need to...
View Article