impossible to publish artifacts for.... java.io.IOException: missing artifact lib#MyService;1.0!MyService.jar - build

Basically I am exploring IVY, to version my binary artifacts and how to do version control automatically using ivy. I found that publish, pubrevision could help me out.
Hence I am trying to publish my jar through IVY. However I am getting below error and build failed.
impossible to publish artifacts for lib#MyService;working#Localhost java.io.IOException: missing artifact lib#MyService;1.0!MyService.jar
Please find my ivy.xml
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="lib" module="MyService" />
<configurations defaultconfmapping="default->default;sources->sources;test->default">
<conf name="sources" transitive="false" visibility="private" />
<conf name="test" transitive="false" visibility="private" />
<conf name="default" transitive="false" />
</configurations>
<publications>
<artifact name="MyService" type="jar"/>
</publications>
<dependencies defaultconf="default">
<dependency org="lib" name="commons-logging-1.1" rev="1.1" />
<dependency org="lib" name="commons-collections-3.2" rev="3.2" />
<dependency org="lib" name="commons-beanutils" rev="1.7.0" conf="default" />
</dependencies>
</ivy-module>
Publish task : Note: dist will resolve my dependency and compile and jar
build.xml
<target name="publish" depends="dist">
<ivy:publish resolver="local" pubrevision="1.0" module="MyService" status="release" forcedeliver="true" update="true">
<artifacts pattern="publish/[organisation]-[artifact].[ext]"/>
</ivy:publish>
</target>
MyService.jar is being created in my build folder.
Can you please assist me, what is wrong with my code. I am pretty new to IVY. So any inputs will be appreciated very much.
Thanks.

Related

How do i pull in 2 materials into a stage using GoCD?

I have 2 types of materials:
A static git repo
Artifacts from an upstream pipeline
Down stream i have an AnalysisBuilders that requires both to function. When the task executes, i only seem to have access to the git repository and not the 'web' artifacts.
xml:
<pipeline name="FishAnalysis">
<materials>
<git url="https://fish:XXXXXXX#redacted.com/fish/analysis.git" />
</materials>
<stage name="CommitHandler" cleanWorkingDir="true">
<jobs>
<job name="builder">
<tasks>
<exec command="yarn" workingdir="web">
<arg>install</arg>
<runif status="passed" />
</exec>
<exec command="npm" workingdir="web">
<arg>run</arg>
<arg>build</arg>
</exec>
</tasks>
<artifacts>
<artifact src="web/dist" dest="web" />
<artifact src="web/package.json" dest="web" />
<artifact src="web/node_modules" dest="web" />
<artifact src="web/nginx.conf" dest="web" />
</artifacts>
</job>
</jobs>
</stage>
</pipeline>
.....
<pipeline name="AnalysisBuilders">
<materials>
<pipeline pipelineName="FishAnalysis" stageName="CommitHandler" materialName="FishAnalysis" />
<git url="https://fish:XXXXX#redacted.com/fish/docker.git" dest="docker" materialName="Docker">
</git>
</materials>
<stage name="Builders">
<jobs>
<job name="shellScripts">
<tasks>
<exec command="ls">
<arg>-R</arg>
<arg>.</arg>
<runif status="passed" />
</exec>
</tasks>
</job>
</jobs>
</stage>
</pipeline>
I would expect the ls -R output to have a 'web' & 'docker' folder. It does not. It only has the contents of the docker repo. How do i make both materials available?
Artifacts are not automatically propagated to downstream pipelines. You need to add a fetch artifact task, as shown here:
<tasks>
<fetchartifact pipeline="FishAnalysis" stage="CommitHandler" job="builder" srcdir="web" dest="web">
<runif status="passed" />
</fetchartifact>
<exec command="ls">
...
</exec>
</tasks>
This is because artifacts can be published in multiple upstream jobs and each upstream job can publish different artifacts. Notice that in your upstream material definition in AnalysisBuilders pipeline, you didn't specify a job.
GoCD will ensure that the version of the artifact is correct. That is, it corresponds to the upstream pipeline instance that caused this pipeline to run. Even if you re-run the pipeline sometime later.

WiX Heat.exe generates different output after VS2008 -> VS2015 upgrade

We execute the following command line with heat (3.0.5210.0):
heat.exe -srd -suid file OurLib.dll -out bin_OurLib.tmp
OurLib.dll is a VC++ 2008 dll file, it's a COM component.
Output (bin_OurLib.tmp)
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="OurLib.dll" Guid="PUT-GUID-HERE">
<File Id="OurLib.dll" KeyPath="yes" Source="SourceDir\OurLib.dll">
<Class Id="{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}" Context="InprocServer32" Description="OurProduct.OurLib">
<ProgId Id="OurProduct.OurLib" Description="OurProduct.OurLib" />
</Class>
</File>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
This works fine.
Now we updated the VS to 2015, and compiled OurLib with it.
Running the same heat command now results in different output:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="OurLib.dll" Guid="PUT-GUID-HERE">
<Class Id="{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}" Context="InprocServer32" Description="OurProduct.OurLib">
<ProgId Id="OurProduct.OurLib" Description="OurProduct.OurLib" />
</Class>
<File Id="OurLib.dll" KeyPath="yes" Source="SourceDir\OurLib.dll" />
<RegistryValue Root="HKCR" Key="CLSID\{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}\InProcServer32" Value=""[#OurLib.dll]"" Type="string" Action="write" />
</Component>
</DirectoryRef>
</Fragment>
</Wix>
And when wix is linking, it gives error:
error LGHT0130 : The primary key 'reg51A1FC16367511AF81E9B18CA009A1C6' is duplicated in table 'Registry'. Please remove one of the entries or rename a part of the primary key to avoid the collision.
Checking the wixobj file, reg51A1FC16367511AF81E9B18CA009A1C6 is related to line
<Class Id="{B1AB297C-1BC6-65E1-A7C1-A1833DFAED6A}...." and <RegistryValue Root="HKCR" Key="CLSID\{B1AB.... - obviously.
Anwyay, this is obviously due to the generated wix output files are different.
Why is that if compiling a dll with a newer C++ compiler will cause WIX HEAT to generate different output, while running the same options, etc.
And how can I have back the same "old" output, which we need.
Tried with -scom and -sreg, none of them gave back the "old" output.
Well primary key duplicated means you've got that same RegistryValue in two different places in your wix source code somehow.
Or maybe the newer DLL is self-registering differently? It's putting the InProcServer32 value in quotes. I don't think that's normal.
Or have you checked that your 2008 and 2015 DLL source and project files are identical? The VS project upgrade process changes things...

Sitecore Feature ActiveDirectory - adding AD domain to the domainManager doesn't work

I'm using Habitat Sitecore. It comes with a bunch of foundation and feature projects. One of the feature projects is Sitecore.Feature.ActiveDirectory.
I'm trying to configure domains from patch files. It is outlined by Kam in this blog.
In the /App_config/Include/Feature/Feature.ActiveDirectory.config, I added the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<switchingProviders>
<membership>
<provider providerName="ad" storeFullNames="false" wildcard="*" domains="ad" />
</membership>
<roleManager>
<provider providerName="ad" storeFullNames="false" wildcard="*" domains="ad" />
</roleManager>
</switchingProviders>
<domainManager>
<domains>
<domain id="ad" type="Sitecore.Security.Domains.Domain, Sitecore.Kernel" patch:after="domain[#id='default']">
<param desc="name">$(id)</param>
<ensureAnonymousUser>false</ensureAnonymousUser>
<locallyManaged>false</locallyManaged>
<isDefault>false</isDefault>
</domain>
</domains>
</domainManager>
</sitecore>
</configuration>
However, I get the following Exception:
A domain specified in the Sitecore.Security.SwitchingRoleProvider provider/domain map could not be found. Domain name: ad
in
<add name="switcher" type="Sitecore.Security.SwitchingRoleProvider, Sitecore.Kernel" applicationName="sitecore" mappings="switchingProviders/roleManager" />
What am I doing wrong?
Domains must be added directly to to Domains.config, located in App_Config\Security. It is not able to be patched. Make it part of your build train.

Is it possible that a directory copied and pasted to a particular directory using XHTML plugin in DITA OT 1.8.5

Is it possible that a directory or a file copying from 'resource' folder in org.dita.xhtml to out put folder generated by the XHTML DITA OT transform.
If its possible using xsl changes in plugin its possible means provide me the code.
Any other way is there means please guide me the steps to do.
Please assist me.
You should use the depend.preprocess.post extension point, or another one that fits your needs, to call a new Ant target.
plugin.xml
<plugin id="com.example.extendchunk">
<feature extension="depend.preprocess.post" value="copyfiles"/>
<feature extension="dita.conductor.target.relative" file="myAntStuffWrapper.xml"/>
</plugin>
myAntStuffWrapper.xml
<dummy>
<import file="myAntStuff.xml"/>
</dummy>
myAntStuff.xml
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myAntStuff">
<target name="copyfiles">
<copy todir="foo">
<fileset>
<include name="**/*.bar"/>
</fileset>
</copy>
</target>
</project>

Is there a way to get build status as a property?

I have a ugly Teamcity build configuration using MSBuild. It executes custom application (test runner), which is using custom messaging to report test results to teamcity.
##teamcity[testStarted name='test1']
##teamcity[testFailed name='test1' message='failure message' details='message and stack trace']
Which show in teamcity in build overview and tests tab.
Teamcity recognizes failed tests and if any test fails, it marks the build as failed:
http://i.stack.imgur.com/Qz9UT.png
Later in the MSBuild target I would like to label cvs based on the test results.
Is there a way to get the build status (if it is failed, hanging, warning) as a property? something like %build.status%? The format does not matter - if its a string or number.
PS: I know that best solution to my problem would be to modify the application to return non-zero exit code if test fail.
TeamCty does not seem to expose this directly, but the status can be acquired using the REST api. Here is an example using curl; but you could also uwe PowserShell's Invoke-RestMethod for instance.
Here's the msbuild script that casues test failure I used for testing:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Test">
<Message Importance="high" Text="##teamcity[testStarted name='test1']" />
<Message Importance="high" Text="##teamcity[testFailed name='test1' message='failure message' details='message and stack trace']" />
</Target>
</Project>
Then the script that gets the current build's status, dumps it to a file, reads the file into an msbuild item and then uses regex to get the status out of it. You just have it to supply the tc_user and tc_password properties (or allow guest access) and change the url to match your server.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GetBuildStatus">
<Target Name="RunCurl">
<PropertyGroup>
<MyTempFile>curl_out</MyTempFile>
</PropertyGroup>
<Exec Command="curl http://localhost/httpAuth/app/rest/builds/id:$(teamcity_build_id) -basic -u $(tc_user):$(tc_password) > $(MyTempFile)"/>
<ReadLinesFromFile File="$(MyTempFile)">
<Output TaskParameter="Lines" ItemName="CurlOutput"/>
</ReadLinesFromFile>
<Delete Files="$(MyTempFile)"/>
</Target>
<Target Name="GetBuildStatus" DependsOnTargets="RunCurl">
<PropertyGroup>
<CurlOutputFull>#(CurlOutput)</CurlOutputFull>
<BuildStatus>$([System.Text.RegularExpressions.Regex]::Match($(CurlOutputFull), `status="(\w*)"`).Groups[ 1 ].Value)</BuildStatus>
</PropertyGroup>
<Message Text="BuildStatus = $(BuildStatus)"/>
</Target>
</Project>
This prints:
BuildStatus = FAILURE