How to create spring boot profile for selection in spring boot run configuration - spring-tool-suite

Does anyone know how you create spring boot profiles to use in a spring boot run configuration? I know I can --spring.profiles.active=dev as launch param, but there is a section in the gui of a spring boot launch config. But I can't seem to get the profiles to populate the drop down.

Let me try to give a more complete answer than Alex's. Alex is right that you can just type any string there and use it as a profile. (This has the same effect as adding something like --spring.profiles.active=dev to the commandline.
The pull-down options come from two sources:
history: when you launch the app the current setting for that option is remembered and will be shown to you next time in the pull-down.
discovery: the tools will try to 'guess' real profiles you have defined in your project.
Option 2. at the moment is not very smart and the only way it can currently discover that you defined a profile is by looking for .properties files that follow the naming convention application-${profile-name}.properties.

You can just type the name of you profile in the Combo box located in the Boot launch config tab under right under Main Type and Project combo boxes (it's in the properties editor below). Although the combo box is not populated with options (a bug) you can just type the name of the profile and it would work.

Related

Location of Websphere Application Server config files

I have a Websphere Application Server v8.0, and my job requires me to change the location of my JDBC data source to different values to test in different environments. I traditionally would do this via the admin console and change the settings via the Resources > JDBC > Data sources section, but I'd like to write a script to change these settings. When I run the admin console, where do the settings get stored? I can run the console vis-a-vis the Servers tab in Eclipse (Rational Application Developer) or by navigating to localhost:9044, but I don't know where the settings are stored - which I'd need to write said script.
Can anybody help me out?
From what I remember of WebSphere Application Server, the settings are ultimately persisted to the file system - however you shouldn't be changing them this way because application server config is a messy and complicated business and by directly changing settings you risk destroying your app server.
I'd recommend checking out this redbook, particularly Chapter 8 which describes how you can configure your app server with scripts. Also I seem to recall plans to display the equivalent scripting commands in the admin console.
If it helps, I had a quick look locally and found a reference to my JDBC data source in "resources.xml" located within the websphere directory at...
<server profile root>\config\cells\<aNodeCell>\nodes\<aNode>\servers\<aServer>
In the past I've used xml config to read values for convenience, but not often to update. Instead I have made use of some of the jython script options available and can echo Jim's response to check out the options there in case there is something that would be a viable alternative.
Edit:
There is another link that may be of interest Configuring data access with wsadmin scripting. I've not used this particular feature of wsadmin myself but it does appear to show promise at first glance.
If you want to write a script, then rather than looking at file system write a proper jython script, which will do your modifications in the similar way as you would do it via console.
To make writing script easier you can use:
Command assistance in the console - the Help portlet on the right shows last invoked command in jython
Script library, which already provides some scripts - Automating data access resource configuration using wsadmin scripting
And basic scripting commands - Configuring data access with wsadmin scripting

Play (Scala) auto-reload settings

I am building a web application with Play 2.2 for Scala. I have one issue with the auto-reload feature:
I am adding some settings when running the server like this play "run -Dtwitter.consumerSecret=mykey -Dtwitter.tokenSecret=mysecret". When the application re-compile on change, it does not take into account the parameters. I have to re-start the server. How to tell sbt to take into account the settings on reload.
Thanks for you help.
We add the following line to the bottom our application.conf
include "overrides.conf"
We make sure it's in the ignore file of our version control system.
The overrides.conf file allows us to tweak (and add) settings that should remain local.
Note that the include statement is ignored if the file can not be found.

How to customize Powerbuilder Specify Version Information

I usually make a lot of application deployment and it is very timeconsuming and uncomfortable every time to overwrite the default Powerbuilder Version information. So usually I do not bother with this. But I thought there could be a solution to give this "default" information somehow to the PowerBuilder, so after the default values were filled I would only need to overwrite the exact version number. Do anybody have an idea? Thanx in advance!
Have you looked at VersionEdit from ECrane?
We actually use PowerGen from them as well for production PowerBuilder compiles and the same capability is in there.
http://ecrane.com/
A free tool is Stampver , see http://www.rgagnon.com/pbdetails/pb-0120.html for a short tutorial.
I recommend you build your application with PBORCA (my preference) or OrcaScript. Both support setting the executable properties. PBORCA can read the properties from an INI file.
We use a small Java program to get the next version number from a database and update the INI file. If you're doing any more than clicking a button to build and deploy your app, you're working too hard. We have Jenkins jobs that watch the SVN repository and build our projects automatically.
This is what one of the INI files for PBORCA looks like before the version is set
[exeproperties]
companyname=BogoSoft
productname=BogoMojo
description=BogoMojo is BogoMojo
copyright=Reserved Rights
fileversion=5.01
fileversionnum=2
;productversion=
productversionnum=0002
;manifestinfo=
[config]
targetname=bogo.pbt
exename=bogomojo.exe
iconname=images\\bogo1.ico
pbrname=bogo.pbr
The Script for PBORCA has
profile string %%WORKSPACE%%\build.ini, config, targetname
profile string %%WORKSPACE%%\build.ini, config, exename
profile string %%WORKSPACE%%\build.ini, config, iconname
profile string %%WORKSPACE%%\build.ini, config, pbrname
profile exeinfo %%WORKSPACE%%\build.ini, exeproperties

How do you deploy a website and database project using TFS 2010?

I've been trying to figure this out and so far haven't found a simple solution. Is it really that hard to deploy a database project (and a web site) using TFS 2010 as part of the build process?
I've found one example that involved lots of complicated checks and editing the workflow (which is a giant workflow btw).
I've even purchased the book "professional application lifecycle management with VS 2010", but apparently professionals don't deploy their applications since it isn't even mentioned in the book.
I know I'm retarded when it comes to TFS, but it seems like there should be any easy way to do this. Is there?
I can't speak for the database portion, but I just went through this on the web portion, the magic part is not very well documented component, namely the MSBuild Parameters.
In your build definition:
Process on the Left
Required > Items to Build > Configurations to Build
Edit, add a new one, for this example
Configuration: Dev (I cover how to create a configuration below)
Platform: Any CPU
Advanced > MSBuild Process
Use the following arguments (at least for me, your publish method may vary).
MsBuild Params:
/p:MSDeployServiceURL="http://myserver"
/p:MSDeployPublishMethod=RemoteAgent
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:username=aduser
/p:password=adpassword
Requirements:
You need to install the MS Deploy Remote Agent Service on the destination web server, MSDeploy needs to be on the Build/Deployer server as well, but this should be the case by default.
The account you use in the params above needs admin access, at least to IIS...I'm not sure what the minimum permission requirements are.
You configure which WebSite/Virtual Directory the site goes to in the Web project you're deploying. Personally I have a build configuration for each environment, this makes the builds very easy to handle and organize. For example we have Release, Debug and Dev (there are more but for this example that's it). Only the Web project has a Dev configuration.
To do this, right click the solution, Configuration Manager..., On the web project click the configuration drop down, click New.... Give it a name, "Dev" for this example, copy settings from debug or release, whatever matches closest to what your deployment server environment should be. Make sure "Create new solution configurations" is checked, it is by default. After creating this, change the configuration dropdown on the solution to the new Dev one, and Any CPU...make sure your projects are all correct, I had some flipping to x86 and x64 randomly, not sure of the exact cause of that).
In your web project, right click, properties. On the left, click Package/Publish Web (you'll also want to mess with the other Package/Publish SQL tab, but I can't speak to that). In the options on the right click Create deployment package as a zip file. The default location is fine, the next textbox I didn't find documented anywhere. The format is this: WebSite/Virtual Directory, so if you have a site called "BuildSite" in IIS with no virtual directory (app == site root), you would have BuildSite only in this box. If it was in a virtual directory, you might have Default Web Site/BuildVirtualDirectory.
After you set all that, make sure to check-in the solution and web project so the build server has the configuration changes you made, then kick off a build :)
If you have more questions, I recommend you watch this video by Vishal Joshi, specifically around 22 and 59 minutes in, he covers the database portion as well...but I have no actual experience trying it since we're on top of a non MSSQL database.

What is the best way to integrate an external build tool into Eclipse?

I've just started using Eclipse for Python development since we can make use of a lovely plugin I've found to enable distributed pair-programming. Anyway, the next step to getting Eclipse to integrate properly with our existing environment, would be finding a way to drive our current build tool (Waf) from within the IDE.
So the question is, is there a way I can set up Eclipse to drive Waf in a Make-like fashion? I see for Make it has some quite advanced functionality, such as being able to work out what targets are available etc. Bonus points for telling me if there is a way I could go as far as this! (I suspect the answer is that this is all built in to the Make plugin for Ecplipse).
In eclipse CDT I run waf by simply changing the build program in
ProjectPreferences->C/C++ Build->BuilderSettings
Choose External builder and then put in the path to waf
for example I use
/Users/mark/bin/waf -v -k -j2
Note that waf and make do not agree on the -j setting and you have to give i explicitly and not use the eclipse dialog.
You can use the Make targets view add the targets to call waf e.g. configure, build etc.
One issue I had is that Eclipse is hard coded to see the output from Make say Make when i changes directory so I had to patch waf
see waf issue
You could try and define a Custom builder, calling Waf with the appropriate options for the python compilation step.
(From eclipsejdt alcatel-lucent manual)
That picture (not related to Waf at all) illustrates the fact a builder can be defined as an external tool (meaning any .bat or shell you may want to call)
In that "eclipsejdt" example, the custom builder was configured like so:
To set up the builder, bring up the property dialog for project "jex1p" by selecting the project in the Package Explorer and selecting Project > Properties > Builders. Then click New..., select Program, and click OK.
Configure the builder Main tab using values:
Name : nmbldr_pre
Location : ${system_path:ksh}
Working Directory: ${build_project}
Arguments : nmbldr -p 2 -t ${build_type} -s jpre
As VonC says, the elegant way is to use a Custom builder.
Alternatively it is less work (in the short term) to hack together an ant script to do the heavy lifting and define an external builder to configure it onto the project. You may find the drawbacks of an external builder (e.g. no incremental support) mean it is worth investing the effort to do it "properly".