SpringSource Tool Suite (STS): How to run server and Java project through the IDE? - sts-springsourcetoolsuite

I'm using the latest version of SpringSource Tool Suite (STS). I have set up a Java project. My code has an Ant build file that packages a WAR. I have Tomcat 6.0.24 installed locally on my Mac 10.6.3. Can someone point me to how I deploy my project onto the server from the IDE and as such, set up debugging with breakpoints?
Thanks, - Dave

Here is what you need to do:
Open up the servers view inside of STS.
Create a new Tomcat instance, and point it to your locally installed Tomcat. (Alternatively, you can use the pre-installed tcServer instance, which is essentially Tomcat with a few extra things like Spring Insight).
Right-click on your project and select Configure -> Convert to Faceted Form...
In the dialog that comes up, choose Dynamic Web Module
Now, you should be able to drag and drop your project onto the server instance.
After that, right-click on the server instance and select "Debug"
You can find more detailed instructions here:
http://www.ibm.com/developerworks/library/os-eclipse-tomcat/index.html

Related

Jenkins - MSBuild for ASP.NET CI without local IIS

Background: I am doing a POC for CI using Jenkins and MSBuild. I have installed Jenkins, MSBuild plugin and other required components on my machine and configured as well. But I don't have IIS configured on my development machine.
I want build the ASP.NET website and output the published code in a folder "c:\precompiledweb" using MSBuild script. I have
Can someone help me with MSBUild Script.
Make sure you read the prerequisites for functionality.
https://msdn.microsoft.com/en-us/library/1y1404zt.aspx
Walkthrough: Deploying a Web Site Project by Using the Publish Web Site Tool
Prerequisites
In order to complete this walkthrough, you will need the following:
Visual Studio.
*This walkthrough assumes that you selected the Web Development collection of settings when you started Visual Studio the first time. For more information, see How to: Select Web Development Environment Settings.
Access to Microsoft Internet Information Services (IIS) so that you can test the result of publishing a Web site project. In this walkthrough, it is assumed that you have IIS running on your own computer. Alternatively, you can use any instance of IIS for which you have permission to create a virtual directory.*
You need access to some IIS server.
On the flip side....you need to keep this general rule in mind. Jenkins is simply a fancy wrapper for command line calls.
So test the below (article) on your machine without IIS. If you can get the command line to work (outside of jenkins), most likely you can get it working (inside jenkins)
http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/command-line-deployment
Configure Source Code Management section, i.e. for TFS:
Add build step "Execute Windows batch command"
Insert msbuild invocation to your solution, i.e.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
"%WORKSPACE%\{solution_name}.sln"
You can add some optional parameters.
After build you can add another script invocation (batch, powershell, whatever) for copy project output to specific folder, but I would prefer another way: publish to IIS and run application immediately.
in Visual Studio create publish profile with WebDeploy target (help)
enable Web Deploy in IIS on test machine (help - when componentes are already installed go to "USING THE IIS MANAGER TO CONFIGURE WEB DEPLOY FOR A NON-ADMINISTRATOR" section)
add publish parameters to jenkins job from step 2, i.e.:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
"%WORKSPACE%\ {solution_name}.sln"
/P:DeployOnBuild=true
/p:PublishProfile="{publish_profile_filename}.pubxml"
/p:Configuration=Release
/p:Platform="Any CPU"
/p:Password={Password_for_publish_profile_same_as_used_in_VS}
And now you have jenkins click-once job for build and publish solution to test server. Add Source Code change trigger and you have basic CI.

asp.net project installer (Install, creat and fill the database, copy pages and dlls)

I have an asp.net project, and i want to create an installer for the deployment of the project. The installer will check if Sql Server is installed in the server, and if not, it will install it. The installer will also create and fill the database, and finally, it will create an repertory and copy the web pages and the dlls, and create the web site in IIS.
I have no idea how to do all this. So, can you just give the steps to follow.
(the deployment will be on a local server)
Thank you.
You can do this by using installer specialized tools like "InstallShield" or "Advanced Installer". Both tools have dedicated support for this type of setup configuration.

Host NetBean html5 app on iis

I download NetBean IDE and did the Getting Started Tutorial
but now I want to host the site on my local IIS and I can't find in Google way of doing it.
Someone know if it possible? and if yes how?
Note: I am coming from the world of ASP.NET and I used to host my web apps on IIS...
If you open Project Properties dialog (right click on the project and select Project Properties) and switch to Run category, there is a field called Web Server. NetBeans uses for HTML5 projects Embedded server by default but if you place your project to some "DocumentRoot" (sorry, don't know the terminology of IIS), then you can switch to External server in the the dialog and provide URL at which your project is available.
Note that NetBeans won't control your IIS, you simply provides URL which should be opened in browser once you run the project (so the server must be already running and your project must be in the document root)

How to debug Flex application under maven

I develop Flex-Java applications which is running under Apache Tomcat. I use Flex Builder plug-in for Eclipse as my IDE. My application consists of several libraries and modules. I manage all of them as a small maven (flex-mojos) projects.
Does anybody can share some ideas how to setup robust debuging enviroment?
I use Maven & Flexmojos from the command line and the Flash builder 4 plugin inside of Eclipse. In my project I also have a Java/BlazeDS backend I like to debug at the same time as the Flex client on occasion.
Here's what I do:
1) I used cargo to startup an instance of my Java backend that DOES NOT have the SWF or HTML wrapper in it.
2) I've created a "Web Application" debug launch configuration where the launch URL just points to a file (e.g. "/path/to/my/flash-builder/bin/myapp-wrapper.html").
3) When I launch this debug configuration from within Eclipse the Flex debugger Just Works. As soon as a stop point it opened the Flex Debugger perspective automatically opens.
By launching a debug configuration directly from Eclipse I don't have to rebuild and redeploy a WAR file after each change made to the Flex app. In fact, after I shut down the Flex client I just leave the Java server running and reconnect with the next debugging launch.
In order debug the Java side, I start the application server with the JVM debugger command line arguments and launch a Remote Java Debugger debug launch configuration. Eclipse has no problem running both debuggers at the same time.
The only problem with this setup happens when I need to run the Flex web app from an http:// URL (for example to get flashvars to retrieve URL query parameters). In this case it is a long round-trip to get maven to created the WAR and deploy it, then to launch the debugger...after every Flex client source edit. I posted a question on how to make that case better (http://stackoverflow.com/questions/4426053/quickly-debug-flex-java-web-application-from-eclipse).
This is an area of interest to me so let me know what you are looking for and I can probably help more.

ASP.NET Website installs/updates

I am looking for some ideas on how to offer a installation package for my ASP.NET website. Some things I need to be able to do is read/write Registry keys, get the database(s) information and test the connection and I must be able to overwrite the existing website without an uninstall and update the web config on new versions. I do not wish to uninstall the website and re-install it. I would like minimum downtime on upgrades. I think I am going to have to implement a custom solution and if this is true how can i include all the output of my web application into my custom solution?
EDIT: I am not installing this on my own system(s). This is for distribution to other clients who will be installing/upgrading the website. It is important that I be able to upgrade to the latest asp.net website without uninstalling. Ideally it would be overwriting the existing site and updating the web.config file.
Option 1. Create web application installation package
Use Web Setup Project for creating a web application installation package (.msi)
Creating or Adding a Setup Project at MSDN
You can create your installation the way it will offer user an Upgrate option of your application if it's already installed on his or her machine. That's not a problem.
Alternatives to Web Setup Project (all of them can handle upgrade scenarios):
Wise Installation Studio
InstallShield
Nullsoft Scriptable Install System - this one is free and open source
Optoin 2. Deploy web application on the server
You can use NAnt or MSBuild or IIS Web Deployment Tool for these tasks automation.
For example with NAnt of MSBuild you could specify tasks like these:
get project files from source repository
update .config file and maybe some other files if needed
compile you web application
update registry settings on the server
update database schema on the server
synchronize files (x-copy) between you build folder to IIS web folder
Web Deployment Blog
Option 3. Distribute your web applications via Web Plafrom Installer.
http://www.microsoft.com/web/
Have you looked into Web Deployment Projects or the IIS Web Deployment Tool?
I think you can build asp.net application into .msi package and install it. Is that what you are looking for? And then you can build all of your customization into pre-deployment and post-deployment scripts.
I use NAnt and NSIS with some small console apps where they can't easily do some manipulations I require.
Do you tried the new Microsoft Web Platform Installer (new! 2.0 beta)?

Resources