How to change Gradle download location - build

I am starting to learn gradle.
However when I am building Spring with Gradle; it downloads the dependency jars to
C:\Users\UserName\.gradle
Is there any way I can specify Gradle to download the dependency jars to a specific location?
Just like I can specify repository location in Maven.
System information:
Windows 7 64bit
Gradle version 1.0

You can set the GRADLE_USER_HOME environment variable, gradle.user.home system property, or --gradle-user-home command line parameter.

On android studio just go to File > Settings > Build Execution, Deployment > Gradle > Service directory path choose directory what you want.

You can also try to go in eclipse at window ->preferences -> gradle and change the directory there

You can add following line to your gradle.properties:
systemProp.gradle.user.home=/tmp/changed-gradle

Steps:
Set the GRADLE_USER_HOME environment variable to new path
On android studio just go to File > Settings > Build Execution, Deployment > Gradle > Service directory path choose directory what you want.
Restart the PC (important step, no one mentioned this surprisingly)

If you are using gradle plugin in your eclipse and trying to import the gradle project than your gradle home is set to
C:\Users\UserName.gradle
In some cases your import build model will not work because of your user directory permission issue.
In this case you can copy your .gradle directory from below path
C:\Users\UserName\**.gradle**
paste into some directory where you have all permission and import the project.
In my case i moved my .gradle dir to z drive and than imported the project than made build model and it worked.

If you want to run gradle tasks through IDE then:
You can also set in intelliJ editor>File>settings:
Then restart the IDE.
If you want to run gradle tasks through command line then you have to set GRADLE_USER_HOME in environment system variables. Then restart the pc as others also said.

Related

Windows service not showing up

I have a windows service project that I inherited and need to migrate it to a new server. I have made changes to some code, and so I created a new setup project in VS 2017. I added the .exe of the service to the set up package, and rebuilt both the service and the setup projects. When I run the .msi it seems to complete installation but when I look in the Windows Services list it's not there. What am I missing?
Any help is greatly appreciated. Thanks!
The installer probably didn't run the installutil.exe program.
You can do this manually by dropping to a command prompt then navigating to the location that the installer put the .exe file. From there run this:
installutil.exe myservice.exe
where myservice is the exe file you generated.
For more information:
https://learn.microsoft.com/en-us/dotnet/framework/tools/installutil-exe-installer-tool
Also, you might need to add the installutil.exe path. It's part of the .net framework and will be found in that install directory.

Update build number from installer output in TFS (Advanced Installer Updates Configuration Project)

I'm currently building a project on TFS and using the Advanced Installer build tasks to create an installer and the updater text file. The 2 Advanced Installer Build tasks on TFS are:
1) The first one creates the installer from the Publish Build Artifacts (This works fine)
2) The second one grabs that installer, should get the build number of the installer file and create the updater.txt file with the proper information. (This does not work)
When I run this project on my computer, I have to manually upload the installer executable from the Update Installer/File path section so the project can recognize that is a new build number. When I click on Build and it outputs the correct updater.txt file.
Is there a way for the Advanced Installer Updates Configuration Project in TFS to automatically detect that the installer .exe changed?
Thank you
Build installer settings:
Project: Installer.aip
Build:
Output Package Name: Installer
Output Package Folder: /Output/
Command Line Arguments:
Build Updater settings:
Project: Updater.aip
Build: /Output/Installer.exe
Command Line Arguments:
Link to configuration files on Google Drive

WSO2 Carbon Identity Server - Build and run

I've modified a .jsp file in the org.wso2.carbon.identity.entitlement.ui package, in order to customize the server for my purposes.
The problem is that when I build the project with Eclipse, the build is successful, but I don't understand how I can actually run the compiled code. How can I do it?
Once you build the project with maven, in the target directory you will find the jar (OSGi bundle). In your IS Server under /repository/component/patches, create a new directory something similar to "patch0100". Copy the jar inside this "patch0100" directory and restart the IS server.
The number in the patch directory (0100 in this case) is important. If you put the same jar to a patch directory with a higher number, say pactch0200, that particular jar with override the earlier one. That's how patching works in WSO2 Carobon Server, which is the platform on which the products are built.

Can't load JSTL in multi module maven project with embedded jetty

I have created a test framework for testing .jsp files and .tag files using embedded jetty. I'm starting Jetty server programmatically using Java API, adding servlet holder and wrapper test JSP and initializing the server passing the project's web root.
There were some issues with Jasper discovering TLD locations during runtime when run from maven surefire plugin. I fixed it by providing
<useManifestOnlyJar>false</useManifestOnlyJar>
plugin classpath settings. Everything works good when I run tests using mvn clean install now.
Running tests from eclipse context menu has one issue. If there is any other project in workspace in the multi module maven build, TLD's in that project are not resolved. One workaround I tried was to 'close' the project in eclipse workspace and it worked out.
However I would want it to work with all the projects open in workspace and running from the eclipse JUnit context menu. The problem is in the jasper TldScanner that looks for tld files in jar and WEB-INF of current project only.
TldScanner.scanTlds()
processWebDotXml();
scanJars();
processTldsInFileSystem("/WEB-INF/");
I'm using org.glassfish.web.jsp-impl 2.2.2-b06 version with Jetty-8.1.0-RC5.
Is there a way to specify file based TLD scanning for jasper for extra classpath items?

Missing build.xml when creating project with ClickStart?

I am using Eclipse EE version and CloudBees plugin to create a ClickStart JBoss 7 project. However, I am not very familiar with the EE version of Eclipse, and used Netbeans to edit my JSP.
Then I used CloudBees SDK to run and deploy my new project but it failed (the command prompt):
D:\Personel\Java EE\HelloCloudBees>bees run
ERROR: java.io.FileNotFoundException: D:\Personel\Java
EE\HelloCloudBees\build.xml (The system cannot find the file
specified)
I found no build.xml file in my folder. How can I create it?
bees run command expect an ant-based project structure, so the build.xml. As documented
CloudBees project commands are only available for applications
generated using the Bees wizard (on the web), built using the
CloudBees SDK style.
This is more or less some legacy stuff, as is now superseded by ClickStart. Equivalent command would be bees app:run but require your app to first be packaged as a WAR and only support the default tomcat6 runtime. So for your specific use-case would be simpler to package and deploy on a local JBoss 7 server. To deploy on RUN#Cloud, use bees app:deploy or just git push and let DEV#Cloud Jenkins build and deploy for you (assuming you created app with a clickstart).
Also, there's no need to use Eclipse if you're familiar with NetBeans.
Have you tried out maven?If yes you can download it and then use mvn eclipse:eclipse and then you can import your project in your workspace using eclipse import capabilities.File -> Import -> Maven -> Existing Maven Project...you point to the file where your pom.xml file is..and is imported. Take into accoutn m2eclipse plugin in eclipse must be installed prior.
regards
\n\m