How to set shared-session-context true by default - maven

I've a Maven EAR with some modules that need to share the session context.
So when I run it on Liberty Server (on Eclipse) I've to add in the "Server Configuration" the application extension and set the shared-session-context flag to true.
I guess how can I set it by default, maybe in the pom.xml? I can find any information about it.
Thanks.

The recommended practice is to have in your source repo server.xml that is required for your application, and have all the required settings there. Then your maven build creates also Liberty server with your config and deploys app there.
If you dont want to store that in the server config file, you can add ibm-application-ext.xml file to your EAR/META-INF folder, with shared session enabled like this:
ibm-application-ext.xml contents:
<?xml version="1.0" encoding="UTF-8"?>
<application-ext xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-ext_1_1.xsd"
version="1.1">
<shared-session-context value="true"/>
</application-ext>

Related

WebAPI Core, set a custom nuget/packge folder

I am trying to figure out how to override the package folder from the user folder to a custom folder location like inside my project folder
I have a webapi Core project with an appSetting.json
I read a few posts and may suggests using nuget.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="globalPackagesFolder" value="d:\\packages" />
</config>
</configuration>
I added in my WebAPI project which show along side with appsetting.json.
When I build the project, I see no package folder.
I also read about packages.config but I can't find that file anywhere.
Any help is appreciated.
Thanks
The nuget.config file should be placed in a directory one level above the project and then it will work.
For an example, the ConsoleApp152 folder is the folder which contains all your project files. And nuget.config file should be placed at the one level above the project files.
When you finish it, please close VS and then restart your project to enable this setting. And it will act on all projects in the directory level where the current nuget.config file is located and also all projects in the subordinate directories.

Liquibase: Maven Plugin ignores logicalFilePath when relativeToChangelogFile is set to false

i've created the following changelog file:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"
logicalFilePath="path-ignored"
>
<include file="db/changelog/usermanagement/db.changelog-master.xml"/>
<include file="initial/db.changelog-initial.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
All my files have the logicalFilePath attribute. When I update my database using the maven plugin, all change sets that are included via the first file (db/changelog/usermanagement/db.changelog-master.xml) have a relative path in the filename column of the databasechangelog table.
All change sets included by the second file (initial/db.changelog-initial.xml) have "path-ignored" as filename.
When I drop everything and let the server doing the update (I'm using spring boot), the filename of all change sets is set to the logicalFilePath value (path ignored). This is what I expected.
I'm using liquibase 3.5.3.
The databasechangelog scripts are located in different projects. That is the reason why I don't set the relativeToChangelogFile to true for the first included file.
Of course, I can move all scripts into the same project, but this is not what I want.

Mule maven build updating config.resource property of mule-deploy.properties failed for a newly created mule project which was not deployed anytime

I have use case to build a mule project using maven and i experienced a scenario where if a new mule project created in mule studio with multi flows which was not run/deployed anytime.
I performed a maven build for the mule project There were two observations
1) when the mule build deployed in mule stand alone it got deployment failure with error
org.mule.module.launcher.InstallException: Config for app ...not found....mule-config.xml.
2)when i checked the config.resource property of mule-deploy.properties was not assigned(config.resources=) with flow config file .
Please let me know any suggestions where i am going wrong.
The easiest thing to do is just update the property with the name of the config xml in mule-deploy.properties.
config.resources=my-projects-config.xml
1) Go to <>/src/main/app/mule-deploy.properties, verify config.resources=test.xml<>. If any other files are assigned, remove it.
or
2) Keep a dummy mule-config.xml in the directory src/main/app
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.0/mule.xsd">
<!-- empty config to avoid the hot deployment classloader choking on a missing config file -->
</mule>
Although we create a "default" application in the "apps" folder, it's empty and thus hot deploy complains about a missing mule-config.xml file

Continuous Integration with Jenkins: Binary Output need to be copied to a shared directory

Our .NET app with 8-10 projects and created a Jenkins job to build it.
We also have a batch job called in Jenkins to create the set up files for our app using INNO Setup. The issue we need to address is copy the Setup files to a shared location. Could you please suggest a better way to accomplish it.
In general, you will probably want to use a publishing plugin. There are different plugins depending on where (and how) you want to put the file. Here's a quick list to get you started:
Publish Over FTP Plugin - use if you want to send the output to an FTP location
Publish Over SSH Plugin - use if you want to use SSH to publish your artifacts.
Publish Over CIFS Plugin - use this if you are wanting to put stuff in a Windows (CIFS , SMB) share
A larger list can be found in the Artifact Uploader Plugins list.
In a .NET environment you should have a look at Nant (http://nant.sourceforge.net/).
Use a Nant script as a post-build action with a default.build like this :
<?xml version="1.0" encoding="UTF-8" ?>
<project name="MyProject" default="network-copy" basedir=".">
<target name="network-copy">
<copy file="target\setup.exe"
todir="\\server\share$\directory"></copy>
</target>
</project>

Can Web Deploy's setAcl provider be used on a sub-directory?

I'm trying to make a subdirectory in an MS Deploy package writable to the application pool user. Thanks to a helpful post about the setAcl provider by Kevin Leetham I was able to get most of what I need into my project file:
<MsDeploySourceManifest Include="setAcl"
Condition="$(IncludeSetAclProviderOnDestination)">
<Path>$(_MSDeployDirPath_FullPath)\doc\public</Path>
<setAclAccess>Read,Write,Modify</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
Note that I've added "\doc\public" to the root deployment directory. In the resulting manifest that VS2010 builds, I see the following setAcl element:
<sitemanifest>
<contentPath path="C:\Source\...\obj\Debug\Package\PackageTmp" />
<setAcl path="C:\Source\...\obj\Debug\Package\PackageTmp"
setAclResourceType="Directory" />
<setAcl path="C:\Source\...\obj\Debug\Package\PackageTmp"
setAclUser="anonymousAuthenticationUser"
setAclResourceType="Directory" />
<setAcl path="C:\Source\...\obj\Debug\Package\PackageTmp\doc\public"
setAclResourceType="Directory"
setAclAccess="Read,Write,Modify" />
</sitemanifest>
That last line looks good: it's appended the subdirectory I want to be writable, and the access modifiers all seem to have transferred over well enough.
However, when I deploy this package I receive an error:
Error: A value for the 'setAclUser' setting must be specified when the
'setAcl' provider is used with a physical path.
This is a confusing error because I'm not trying to set an ACL on a physical path, exactly, but a subdirectory of a web application. Looking at the output of MS Deploy, it's easy to see the problem:
Info: Adding setAcl (REST Services\1.0.334).
Info: Adding setAcl (REST Services\1.0.334).
Info: Adding setAcl (C:\...\obj\Release\Package\PackageTmp\doc\public).
MS Deploy is apparently substituting the web application name for my absolute path "C:...\obj\Release\Package\PackageTmp", but when I append "\doc\public" to that absolute path it no longer recognizes it as a web application directory. This exact problem is described by another victim over on the ASP.NET forums without any resolution.
Does anyone know how to set an ACL on a particular subdirectory of a web application via Web Deploy without manually identifying the physical path and application pool user on the target host?
OK let me first say that this is way harder than it should be!
I think the reason why it is failing is because when you are publishing it cannot recognize the folder as being a folder in the IIS Application. The reason this is happening is because the full path is being transferred to the destination when the SetAcl provider is invoked. Instead of that we need an path which is relative to the IIS Application. For instance in your case it should be something like : "REST SERVICES/1.0.334/doc/public". The only way to do this is to create an MSDeploy parameter which gets populated with the correct value at publish time. You will have to do this in addition to creating your own SetAcl entry in the source manifest. Follow the steps below.
In the same directory as your project create a file with the name {ProjectName}.wpp.targets (where {ProjectName} is the name of your Web application project)
Inside the file paste the MSBuild content which is below this list
Reload the project in Visual Studio (VS caches the project files in memory so this cache needs to be cleared).
{ProjectName}.wpp.targets
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupCustomAcls" AfterTargets="AddIisSettingAndFileContentsToSourceManifest">
<!-- This must be declared inside of a target because the property
$(_MSDeployDirPath_FullPath) will not be defined at that time. -->
<ItemGroup>
<MsDeploySourceManifest Include="setAcl">
<Path>$(_MSDeployDirPath_FullPath)\doc\public</Path>
<setAclAccess>Read,Write,Modify</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
<Target Name="DeclareCustomParameters" AfterTargets="AddIisAndContentDeclareParametersItems">
<!-- This must be declared inside of a target because the property
$(_EscapeRegEx_MSDeployDirPath) will not be defined at that time. -->
<ItemGroup>
<MsDeployDeclareParameters Include="DocPublicSetAclParam">
<Kind>ProviderPath</Kind>
<Scope>setAcl</Scope>
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\doc\\public$</Match>
<Value>$(_DestinationContentPath)/doc/public</Value>
<ExcludeFromSetParameter>True</ExcludeFromSetParameter>
</MsDeployDeclareParameters>
</ItemGroup>
</Target>
</Project>
To explain this a bit, the target SetupCustomAcls will cause a new SetAcl entry to be placed inside of the source manifest used during publishing. This target is executed after the AddIisSettingAndFileContentsToSourceManifest target executes, via the AfterTargets attribute. We do this to ensure that the item value is created at the right time and because we need to ensure that the property _MSDeployDirPath_FullPath is populated.
The DeclareCustomParameters is where the custom MSDeploy parameter will be created. That target will execute after the AddIisAndContentDeclareParametersItems target. We do this to ensure that the property _EscapeRegEx_MSDeployDirPath is populated. Notice inside that target when I declare the value of the parameter (inside the Value element) that I use the property _DestinationContentPath which is the MSBuild property containing the path to where your app is being deployed, i.e. REST Services/1.0.334.
Can you try that out and let me know if it worked for you or not?
FYI - this does work for a root website if you follow the convention specified in the post here:
http://forums.iis.net/p/1176955/1977169.aspx#1977169
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\#(CustomDirAcl)$</Match>
<DefaultValue>{$(_MsDeployParameterNameForContentPath)}/#(CustomDirAcl)</DefaultValue>
<Value>$(_DestinationContentPath)/#(CustomDirAcl)</Value>
This post also has the benefit of being able to specify a block of subdirectories in a single ItemGroup.

Resources