I started working on Jenkins for continuous integration. My java project is build successfully but am not able to find .war file for deployment. If I manually keep the myproject.war file inside workspace auto deployment is happening in tomcat7.
Now my question: is Jenkins able to create .war or not (if any extra plugins are needed please let me know), or if i need to add any build.xml file where can i keep this file.
Thanks in advance.
Finally i find the solution,
Jenkins is not having a feature like auto creating .war file.
so we have to create build.xml (ANT) for creating .war file.
Keep this file in your project and check-in into the repository.
And map the build.xml location in Jenkins configuration page. When the build is happen through Jenkins it will take the code from repository build it and stores in workspace in Jenkins folder along with .war file.
You can do auto deploy this .war file into your tomcat using Jenkins.
Related
I'm trying to get my maven project deployed to Jboss AS 7.1 using the jbos tools plugin version 4.3.1.FINAL.
My project setup is
parentPom
common.jar
util.jar
mywebapp.war
When I run mvn clean install form both eclipse and command line the resulting target folder is the same atleast for the mywebapp.war and /mywebapp (folder)
If i copy either the folder or war file from the target folder directly into the servers /standalone/deployments directory. The application starts up without a problem.
However if I go to my server setup in eclipse which is pointing to the same base and do Add/Remove -> select mywebapp -> run
The problem is this doesnt copy all the files over to the server becasue when i run a diff I see a whole load of files missing. Consequently the build fails saying it canot load some annotation, presumably this is because some of the files are missing.
Ideally I wouldn't want to copy the war or folder manually and would love to be able to edit jsp/css/javascript files etc without having to go through this laborious task.
I want to deploy my war file after Jenkins build it with Gradle. so I used the deploy plugin. as far as i know i should create a post build action in my task configuration in jenkins. i created that like this:
and I checked that the war file is there.
but its not working and the war is not deployed anywhere and there is no sign of any effort from jenkins to deploy the artifact to the tomcat. here is the console output of my task:
which are all about build actions not post build actions!
anybody can help?
where can i see logs of jenkins post build actions?
it seems like there was a problem with the path to the war file!
although it's relative to ~/.jenkins/jobs/MyJob/workspace/ but it's not working
I changed that to **/*.war and works now!!
I have an eclipse workspace (for work) that has an ear project that I use to "export"/deploy an ear file to a JBoss server.
However, they recently asked me to create an ant script that can build the workspace and create the ear, and I have done this successfully. The problem arises when I try to run my program with this ear that was built using the ant script; for deploying I'm simply copying the resulting ear file and pasting it into the JBoss/standalone/deployments folder and running the application.
The JBoss AS starts fine, but then I get a few exceptions that halt my application that I do not get when I do a build and deploy through eclipse. The two ear files are identical when viewing the two ear files using 7zip, however I see in the eclipse workspace, in the ear project, theres a .settings folder that has 4 files, one of them being org.eclipse.wst.common.component and I'm guessing this (if not all 4 files) is necessary when deploying somehow.
Does ecplise use this .settings folder and the files inside when deploying an ear? What happens during this process? and how can I replicate it in an ant script so that my application runs identically from either ant or eclipse builds?
EDIT
let me just add that none of the files in the .settings folder get packaged up in the ear file, so I'm guessing they're somehow used when eclipse does a build/deploy, but it doesnt get placed in the final ear product
thank you
Eclipse uses the data in org.eclipse.wst.common.component to figure out the dependencies needed for deployment. The file corresponds to the settings found in Eclipse when Right-clicking on an EAR project > Properties > Deployment Assembly.
E.g. if your EAR project has a dependency on a WAR project then Eclipse knows to include the WAR when deploying because of the Deployment Assembly settings which get stored in org.eclipse.wst.common.component
When building the EAR using Ant you need to add these dependencies manually (without relying on Eclipse metadata)
I have a web project in STS, that iam looking to deploy in Tomcat. The build file for the project is written in GRADLE. Using GRADLE'S build script, a war file is generated in build/libs.
But STS looks for the war file in workspace/metadata/plugins/org.eclipse.wst.server.core/ folder.
Now If I manually copy the generated WAR file from build/libs to this workspace/metadata/plugins folder, and then start the tomcat, everything works fine but I am not able to debug using breakpoints in STS.
How do I make sure that the war file from build/libs gets moved to workspace/metadata/plugins folder?
And, Why is STS looking to find the war in workspace/metadata/plugins folder. As the app-server is tomcat, should it not be looking in Tomcat/webapps folder to find the war?
I am not a eclipse fan nowadays but did you run eclipse plugin? you can add it to the gradle file
apply plugin: 'eclipse'
and then just run
gradle eclipse
check Eclipse Plugin
I don't believe STS deploys/runs your war file directly. That is, if you select the project and say "Run on Server", STS/eclipse will generate an exploded war to the wtp.deploy directory defined. You can control/alter this by editing the "run configuration" for your server. Just go to the "Arguments" tab and change the setting for the "-Dwtp.deploy".
You should really only use this STS mechanism for development purposes - as it is invaluable for that. To deploy an actual warfile to Tomcat you have a variety of options. You can start a tomcat instance with the manager UI enabled and upload the war file from the Tomcat GUI, you can just manually drop the war file into Tomcat's deployment area, or probably your best option - extend your gradle build scripts to include deploying the generated war file to a tomcat server. Hope this helps some.
I'm using SubClipse for Eclipse for my project.
And in this project I've added my own package "com.mytestpkg.www"
I then use TortoiseSVN to deploy my project on the TomCat server where the project is running, because i the easily can update the site with "SVN Update".
But using this method I always have to manually update my package by copying it from my Eclipse workspace build path to the WEB-INF folder classes/com/mytestpkg/www.
Is there a way to make Subclipse/SVN update this file directly with the other files?
Why don't you do this a more conventional way; e.g.
get Eclipse to create and deploy a WAR file
use Ant or Maven to build the WAR file and deploy it by hand. (The Maven way of building WAR files is really slick!)
Doing a checkout into a Tomcat server's webapps directory is ... weird. And you've got the problem of stopping the world seeing the .svn directories.