Renaming the generated war file in gradle? - groovy

I am using gradle to generate a war file so that I can directly deploy the war in any remote tomcat server. I want to name the generated war as ROOT.war and after going through the docs I found a way of doing it as:
war.archiveName = "ROOT.war"
Its working fine but gradle generates the war as root.war (the name is in lowercase).
Can you tell me how to convert it into uppercase or is there any better way of doing it?
NOTE: I am using Gradle 2.2 on MAC OS X Yosemite

Related

How to deploy and debug war application with smart tomcat in intellij

I have a plain text java project in intellij, the project contains some java modules, one of the module is web application module, it will be generated a war file finally. All the modules build is manven.
After the maven build, the war file will be generated under /module/target/application-1.0.0.SNAPSHOT.war
Now what I have
1.Intellij community edition 2021.3.2
2.Smart tomcat 4.3.7
3.Tomcat 9.0.68
4.Maven 3.8.6
The target is
1.Add tomcat run/debug configuration which can include the War file
2.Before each launch of the war application, all modules should be built firstly
3.After the application startup, I can debug
Is this doable? if yes may I know how to configure this in intellij?

Lombok installation in Spring Tool Suite 4 for Windows

To install Lombok on one of my spring boot project on STS 4 in Windows 10 OS, I did the following steps:
Added the lombok gradle dependency to build.gradle:
compile 'org.projectlombok:lombok'
Then to install the jar retrieved from building the above dependancy got a lombok-1.16.16.jar.
To compile the jar did a right click on the jar -> Run as Java application.
Lombok Installer appeared, but couldn't detect the IDE from the drives. So manually tried searching for the .exe file of STS4 (which I couldn't find)
So kindly help me find the .exe file of STS, so as to complete the installation
The Spring Tool Suite 4 by default has a name as SpringToolSuite4 which is the executable file. This file doesn't get detected in the Lombok installer.
After googling it for quite a long time, all I could see were results of how to install the same of Mac or Linux.
Finally, had to experiment a little. Following is the solution:
Rename the SpringToolSuite4 (Application(.exe)) file and (Configuration settings (.ini)) to sts and now it is detectable in the Lombok installer.
Complete the installation and restart STS and rebuild-clean your project and it works just fine.
You have to add the Lombok JAR file reference to the ini file. The inif file is in the STS installation directory:
-javaagent:<your-path-to-lobmok>lombok-1.16.16.jar
If you are using Spring Tool Suite4, the name of the app is no longer STS.app on MacOS, however, the installer still uses the old name, which on macOS is part of the path. So if you use the installer, check the path in the .ini file to ensure that the name of the app used in the path is correct.
After following the suggested lombok installation on the page
https://projectlombok.org/setup/eclipse
and if it doesn't work
go to C:\User\.m2\repository\org\projectlombok\lombok folder
and remove all versions of lombok contained in the folder
(do not worry maven will redo the files needed for lombok to work)
if using spring boot put in pom.xml:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
and maven update with the force update option
I'am using
Spring Tool Suite
Version: 3.9.4.RELEASE
Build Id: 201804120943
Platform: Eclipse Neon.3 (4.6.3)

where does gradle put the jars it downloads?

I am using Android Studio with Gradle. Where in my project do I find the jar files that I am pulling with Gradle with say
compile 'com.squareup.picasso:picasso:2.5.2'
Digging through Android Studio I find a xml file under
/Users/myname/StudioProjects/Myproject/.idea/libraries/picasso_2_5_2.xml
I look inside, opened a terminal and routed to the path suggested. I get to the jar. Now I want to browse it. If I source for picasso-2.5.2-sources.jar using Spotlight Search then nothing is found. So obviously I cannot just get to it to view what's inside. So how might I do that?
When running Gradle, a .gradle folder is created in your home directory: ~/.gradle/caches.

Android training for FragmentBasics won't import into AS 1.5.1

In trying to get the hang of Fragment, I imported into Android Studio 1.5.1 the unzipped folder FragmentBasics after extracting the downloaded file FragmentBasics.zip to that Folder.
Now I have Gradle problems and I have no clue what to do to be able to run the app. I don't know that the .zip file is from Eclipse as the message suggests.
I did move the folder FragmentBasics to C:\Users\Dov because of the space in "Google Drive" but got same error.
Gradle project sync failed . Basic functionality (e.g., editing, debugging) will not work properly.
Failed to sync gradle project 'FragmentBasics'
Error:Cause: failed to find target with hash string 'android-15' in: C:\Users\Dov\AppData\Local\Android\sdk
Open Android SDK Manager
ECLIPSE ANDROID PROJECT IMPORT SUMMARY
Risky Project Location:
The tools should handle project locations in any directory. However,
due to bugs, placing projects in directories containing spaces in the
path, or characters like ", ' and &, have had issues. We're working to
eliminate these bugs, but to save yourself headaches you may want to
move your project to a location where this is not a problem.
C:\Users\Dov\Google Drive\AndroidStudioProjects\FragmentBasics
-
Replaced Jars with Dependencies:
The importer recognized the following .jar files as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the .jar file in your project was of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the jar replacement in the import wizard and try again:
android-support-v4.jar => com.android.support:support-v4:18.0.0
Moved Files:
Android Gradle projects use a different directory structure than ADT
Eclipse projects. Here's how the projects were restructured:
AndroidManifest.xml => app\src\main\AndroidManifest.xml
res\ => app\src\main\res\
src\ => app\src\main\java\
Next Steps:
You can now build the project. The Gradle project needs network
connectivity to download dependencies.
Bugs:
If for some reason your project does not build, and you determine that
it is due to a bug or limitation of the Eclipse to Gradle importer,
please file a bug at http://b.android.com with category
Component-Tools.
(This import summary is for your information only, and can be deleted
after import once you are satisfied with the results.)
I installed sdk 15 but then had problems with Gradle griping about
gradle-wrapper.properties file having a line with
gradle-2.8-all.zip that needed to be changed to
gradle-2.1-all.zip, so I edited gradle-wrapper.properties file to contain 2.1 instead of 2.8.
Message said after making change, re-import project. And it works.
Before importing I only removed following line from AndroidManifest.xml
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
Worked with FragmentsBasics.zip in Android Studio 2.3.3

deploy java desktop application in netbeans

I create a java desktop application in Netbeans and now I want to deploy to work as software in Linux but I am not very familiar with neat beans I used visual studio and mono to build applications for both Windows and Linux and both of them create your application in bin/release directory and now I want to know what is equivalent to visual studio/mono release in Netbeans.
Thank you
Go to the project folder. Inside that there is a folder named "dist" this contains the jar file. This is the java equivalent of .exe. You need to use that to run on linux(given that JRE is installed on Linux machine). In case of external libraies: the libraries exists in side the "lib" folder which resides inside the "dist" folder.

Resources