I am a novice with Jenkins and wanted to know if it is possible to trigger a Java program (e.g. a hello world program) with Jenkins. For example, when any change is made in GitHub repository Jenkins should trigger this hello world program. Is this even possible using Jenkins? Can someone please help me with this? I will really appreciate your help.
You can use the Jenkins GitHub plugin to get notified when a push is made to GitHub, more details here: https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Plugin
Hope that helps.
Yes you can.
1.You can write shell script in post-recieve hook of GIT repository.
2.Whenever you push the code this hook is executed, your script can remotely call build-JOB on your Jenkins using jenkins-cli.jar
https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI
3.you can use maven or gradle build for your project.
4.Artifacts created from build job (ear,war,etc) can be deployed onto your application server using Jenkins Job(some shell scripting again)
GitHub Webhook from GitHub Plugin
Build -> Execute shell -> Command
Related
I just created a sample Quarkus CLI app. When I run it in dev mode, pressing [enter] does not restart the application.
Steps to reproduce:
I am using the quarkus CLI, on macOS Big Sur, default Terminal app. I generate a default cli app with the following command:
quarkus create cli --group-id=test --artifact-id=test --maven --java --code
Then, once I am inside the test folder, I run:
quarkus dev
The example code runs and dev mode stays waiting for changes, but if I update the sample code and press [enter] on the terminal as described in the quarkus guide for CLI apps, the app is not rerun.
I also tried maven directly as suggested on the guide:
mvn compile quarkus:dev
But the result is the same.
The example generated is very simple, and uses Quarkus 2.0.1 with the picocli extension. Works fine when compiled and run standalone.
Does anyone know what am I missing?
Thanks for any suggestions.
I think what you are seeing is a bug in 2.0 cli where create cli does not create a cli but just the standard app. Thus it won't reload until you hit localhost:8080.
it will be fixed in next version. sorry for inconvenience.
In the mean time you can use https://quarkus.io/guides/command-mode-reference which explains the minimal code and dependencies needed for a Quarkus cli.
Does your project have any tests? The picocli project created by the cli doesn't by default (yet?).
https://github.com/quarkusio/quarkus/pull/18700 should fix your issue (behavior of dev mode for projects without tests).
I'm developing a plugin that analyzes source code in a project. Now I need to run it on a great number of projects, so I decided to automate the process. Looking for a way to achieve this I found that I need to implement ApplicationStarter interface and declaring it as extension point in appStart category, as described here:
Intellij - how to make a plugin that can perform IDE actions via a CLI or web service?
Although, I was not able to execute my custom command. When I run
idea64 mycommand
a loading screen of intellij starts and then nothinng happens. I have to kill the process via task manager. My version Is 2020 on Windows 10.
I'm writing here too as on jetbrains I've received no answers yet.
Is there something i'm missing? Thank you in advance.
I made a java program which runs unit test on my website.
I need the unit test to keep running during the day while I watch the log.
For this, I search a java platform on which I can run my soft. Openshift will be the best because it's easy to install and maintain.
However I will often modify this soft and if the java project could be built whenever I made a commit it will be the best. That's why I think to Jenkins, but I don't know if it is a good way to run a jar from a jenkins server whereas it is made to do build.
I tried JBoss and tomcat by wrapping my programs into an Enterprise Application Client but I can not run and check the log of the program from a web interface.
Currently my project is a Java Application, using MySQL, hibernate, maven and git.
What would be the best option for you ?
Thanks.
Florian C.
Finally, here is my soluce.
I use Jenkins.
When I push on Jenkins, my project is automatically built and ran using a shell script.
If the build or the run fails Jenkins sends me the command output by mail.
Else, every day, the project is run (using the cron of jenkins) and the console output is sent to me by mail, so I can check the result of my test.
I usually compile and execute from Java project using eclipse IDE. Now, I need to write a bash script to submit this task to a cluster. My project contains 3 packages and has been written as per the Maven architecture. Can anyone hint me as to how can I include the task of executing the java program in the my bash script?
I tried different things like first trying to execute the project using command line but it does not work. I already read the replies provided in this post: Compiling and running multiple packages using the command line in Java and some others, but didn't help.
Thank you for your help.
I strongly suggest you look into something like the Maven App Assembler plugin. I don't know about your cluster but the mentioned plugin can create run scripts for most major OSes and is highly configurable.
I'm very new for Appium. I have configured all my Win-7(64 bit) machine using this blog i.e Appium for windows, node.js and Android SDK with API level 17, emulator etc.
I found many java files on git-hub also in this blog also
but How to run this java files I don't have idea.
If anybody guide me step wise will be very helpful.
Thanks.
You can run the java test file using following command:
mvn -Dtest=com.saucelabs.appium.SimpleTest test
Note: You need to open terminal -> navigate to project directory --> execute the above command.
Refer to this link: Run Java Test File
For command line execution you can integrate your automation test with build tools.
Like Ant, Maven, Gradle. it can help you to execute and build automation test, also you can easily integrate with CI tools with the help of these.