Hope all doing well. Today I was working on multi-module gradle project, and trying to publish one of it’s dependency to artifactory as well. my project structure are: build.gradle (main) build.gradle (api) and the task artifactoryPublish produces: Now the issue is that, the modules, like admin-api buil…
Tag: gradle
Java program uses wrong locale when jpackaged
I am parsing strings representing German-style numbers (i.e., decimal comma and optional full stop for grouping thousands), e.g., “2.804,13”; this is just done using a DecimalFormat based on my desired Locale: This gives the desired output, e.g., when compiled and run from the command line: Howeve…
How to call the javacc parser from a simple java class and execute
I am recently learning javacc releated concepts and writing tokens and parser. I was able to write a parser and it works perfectly when I run in the terminal using the commands javacc BusParser.jj //BusParser is file name javac *.java java Calculator //Calculator is parser name //and then type input Here I am…
How to remove “extras” from using java gradle shadow plugin
I’m using the gradle shadow plugin in my java project. I used the following code to get rid of all the dependencies I could. However, I’ve got all these extra files in my jar file. I want to remove everything except what’s in the “eu” folder and the “plugin.yml”. How …
vscode – Could not fetch model of type ‘GradleProject’ using Gradle distribution ‘https://services.gradle.org/distributions/gradle-7.2-bin.zip’
I was trying to build a gradle project but it returned with an error: I’m using vscode for this I saw some questions similar to this but they were about android studio, and I couldn’t find anything else about it. Thanks for any help. Answer the issue has been resolved on github: https://github.com…
Moving Jib configuration of one module into a new module, to refactor multi-module gradle project
I have a multi-module gradle project and one of the modules is a webapp. I added Jib configuration within the webapp build.gradle file to generate the container images. Similarly I have a few modules for command-line applications and I use Jib jar config to create container images. I want to move the Jib spec…
What is the purpose of apply maven plugin in build.gradle?
I keep seeing apply plugin: ‘maven’ in build.gradle files for Java projects. What is the purpose of adding a Maven plugin? I can’t seem to find the plugin when querying for it on plugins.gradle.org. Answer Why don’t you just google it? http://sorcersoft.org/project/site/gradle/userguid…
Can’t pass parameters/sytem properties with gradlew command line
I try to pass parameters with gradlew command line, but can’t. I successfully pass the Optional parameter with XML file, but need have the possibility to pass with gradle CMD Gradle task: XML: Code: gradle CMD: In both cases I get the same result: ipAmount=20, IP_AMOUNT_PARAMETER = null How to correctly…
Is it possible to define the gradle publish task to public?
I have a Gradle 7.0 publish task defined in my Java Spring boot project sub module build.gradle file like this: It works fine in each of my sub module. The only problem is that this code snippet must be copied to each of my sub module. Now the sub module increased more than 50+. I have to copy and paste
Run gradle task after doLast of a other task
I have a variable in my build.gradle (xy) file with an integer value and three simple tasks. The tree tasks are also “bundled” in a fourth task, to call the three tasks one after one. If I call the task callAll, the task callOne should add 5 to the int value, task callTwo should add also 5 the int…