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.
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>
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
I'm trying to use IzPack to install my program and I'd like to add Desktop Shortcuts to the installer, here is the documentation/instructions from the IzPack website.
http://izpack.org/documentation/desktop-shortcuts.html
However, the below XML files, when compiled, only create a blank screen in the installer that hangs when you try to click "Next" to go past it. Here's what the screen looks like when running on Windows 7 - 64 bit.
Here is my install.xml and shortcutSpec.xml files.
install.xml
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<!-- The info section. -->
<info>
<appname>Application Name</appname>
<appversion>1.0</appversion>
<url>http://www.example.com/</url>
<javaversion>1.6</javaversion>
<run-privileged condition="izpack.macinstall|izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
</info>
<!-- The gui preferences indication. -->
<guiprefs width="640" height="480" resizable="yes"/>
<!-- The locale section. -->
<locale>
<langpack iso3="eng"/>
</locale>
<!-- The resources section. -->
<resources>
<res id="LicencePanel.licence" src="licence.txt"/>
<res id="InfoPanel.info" src="readme.txt"/>
<res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
</resources>
<native type="izpack" name="ShellLink.dll"/>
<!-- The panels section. -->
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<native type="izpack" name="ShellLink.dll"/>
<!-- The packs section. -->
<packs>
<pack name="Program and Dependencies" required="yes">
<description>Program, libraries and other dependencies</description>
<file src="ExecutableJar.jar" targetdir="$INSTALL_PATH"/>
<file src="lib" targetdir="$INSTALL_PATH"/>
<file src="save" targetdir="$INSTALL_PATH"/>
<file src="HelpContents.chm" targetdir="$INSTALL_PATH"/>
<file src="icon.png" targetdir="$INSTALL_PATH"/>
<file src="application.ini" targetdir="$INSTALL_PATH"/>
<file src="readme.txt" targetdir="$INSTALL_PATH"/>
<file src="licence.txt" targetdir="$INSTALL_PATH"/>
<file src="autorun-win.bat" targetdir="$INSTALL_PATH"/>
</pack>
<pack name="Samples" required="no">
<description>Word Document Samples</description>
<file src="samples" targetdir="$INSTALL_PATH"/>
</pack>
<pack name="Templates" required="no">
<description>Word Document Templates</description>
<file src="templates" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
And the shortcutSpec.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<shortcuts>
<skipIfNotSupported/>
<programGroup defaultName="AppGroupName" location="applications"/>
<shortcut
name="Application - Startup"
target="$INSTALL_PATH\autorun-win.bat"
workingDirectory="$INSTALL_PATH"
programGroup="no"
desktop="yes"
applications="yes"
startMenu="yes"
startup="yes"/>
</shortcuts>
Additional Notes:
I am getting zero compilation errors.
Without the shortcut stuff added, the installer works fine.
My program is an executable jar, to run it automatically I've created a batch script in Windows named autorun-win.bat, which is the what the desktop shortcut should be linked to.
EDIT:
I have tried this import as well as the 32-bit flavor. Neither had any effect on the above results. Any more contributions would be greatly appreciated.
<native type="izpack" name="ShellLink_x64.dll" />
Shortcut creation depends on the native support lib ShellLink.dll which only supports 32 bit systems. For 64-Bit windows you must add the following entry as well to support both flavors:
<native type="izpack" name="ShellLink_x64.dll" />
I've never used this tool, so this may be a total red hering.
In your shortcuts file you don't have a CreateForPack statement. Could that be something to do with the fault?
Although this issue is old, I have experienced this problem today on IzPack 4.3.5. Two observations are provided here.
First, the documentation at http://docs.codehaus.org/pages/viewpage.action?pageId=230398023 shows the native statements placed inside a 'natives' tag. This appears to be incorrect for the v4 release.
Second, the ShellLink_x64 DLL must be visible to the compiler. I had to add '-h ${IZPACK_HOME}' to the compiler execution line to make this happen. Sadly there seems to be no warnings if this file cannot be found, but the installer then hangs as described.
Fixing these issues fixed this problem for me.
I have experienced a case where a working izPack configuration with shortcut creation suddenly stopped putting the icon.
It turned out the icon file created under linux with convert commad was faulty, I reverted to the old icon
I decided to use log4net as a logger for a new webservice project. Everything is working fine, but I get a lot of messages like the one below, for every log4net tag I am using in my web.config:
Could not find schema information for
the element 'log4net'...
Below are the relevant parts of my web.config:
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\log.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="100KB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level: %message%newline" />
</layout>
</appender>
<logger name="TIMServerLog">
<level value="DEBUG" />
<appender-ref ref="RollingFileAppender" />
</logger>
</log4net>
Solved:
Copy every log4net specific tag to a separate xml-file. Make sure to use .xml as file extension.
Add the following line to AssemblyInfo.cs:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "xmlFile.xml", Watch = true)]
nemo added:
Just a word of warning to anyone
follow the advice of the answers in
this thread. There is a possible
security risk by having the log4net
configuration in an xml off the root
of the web service, as it will be
accessible to anyone by default. Just
be advised if your configuration
contains sensitive data, you may want
to put it else where.
#wcm: I tried using a separate file. I added the following line to AssemblyInfo.cs
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
and put everything dealing with log4net in that file, but I still get the same messages.
You can bind in a schema to the log4net element. There are a few floating around, most do not fully provide for the various options available. I created the following xsd to provide as much verification as possible:
http://csharptest.net/downloads/schema/log4net.xsd
You can bind it into the xml easily by modifying the log4net element:
<log4net
xsi:noNamespaceSchemaLocation="http://csharptest.net/downloads/schema/log4net.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
I had a different take, and needed the following syntax:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.xml", Watch = true)]
which differs from xsl's last post, but made a difference for me. Check out this blog post, it helped me out.
Just a word of warning to anyone follow the advice of the answers in this thread. There is a possible security risk by having the log4net configuration in an xml off the root of the web service, as it will be accessible to anyone by default. Just be advised if your configuration contains sensitive data, you may want to put it else where.
I believe you are seeing the message because Visual Studio doesn't know how to validate the log4net section of the config file. You should be able to fix this by copying the log4net XSD into C:\Program Files\Microsoft Visual Studio 8\XML\Schemas (or wherever your Visual Studio is installed). As an added bonus you should now get intellisense support for log4net
In Roger's answer, where he provided a schema, this worked very well for me except where a commenter mentioned
This XSD is complaining about the use of custom appenders. It only allows for an appender from the default set (defined as an enum) instead of simply making this a string field
I modified the original schema which had a xs:simpletype named log4netAppenderTypes and removed the enumerations. I instead restricted it to a basic .NET typing pattern (I say basic because it just supports typename only, or typename, assembly -- however someone can extend it.
Simply replace the log4netAppenderTypes definition with the following in the XSD:
<xs:simpleType name="log4netAppenderTypes">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z_]\w*(\.[A-Za-z_]\w*)+(\s*,\s*[A-Za-z_]\w*(\.[A-Za-z_]\w*)+)?"/>
</xs:restriction>
</xs:simpleType>
I'm passing this back on to the original author if he wants to include it in his official version. Until then you'd have to download and modify the xsd and reference it in a relative manner, for example:
<log4net
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../Dependencies/log4net/log4net.xsd">
<!-- ... -->
</log4net>
Actually you don't need to stick to the .xml extension. You can specify any other extension in the ConfigFileExtension attribute:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", ConfigFileExtension=".config", Watch = true)]
#steve_mtl: Changing the file extensions from .config to .xml solved the problem. Thank you.
#Wheelie: I couldn't try your suggestion, because I needed a solution which works with an unmodified Visual Studio installation.
To sum it up, here is how to solve the problem:
Copy every log4net specific tag to a separate xml-file. Make sure to use .xml as file extension.
Add the following line to AssemblyInfo.cs:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "xmlFile.xml", Watch = true)]
For VS2008 just add the log4net.xsd file to your project; VS looks in the project folder as well as the installation directory that Wheelie mentioned.
Also, using a .config extension instead of .xml avoids the security issue since IIS doesn't serve *.config files by default.
Have you tried using a separate log4net.config file?
I got a test asp project to build by puting the xsd file in the visual studio schemas folder as described above (for me it is C:\Program Files\Microsoft Visual Studio 8\XML\Schemas) and then making my web.config look like this:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<appSettings>
</appSettings>
<connectionStrings>
</connectionStrings>
<system.web>
<trace enabled="true" pageOutput="true" />
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<customErrors mode="Off"/>
<!--
<customErrors mode="Off"/>
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="On" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
<log4net xsi:noNamespaceSchemaLocation="http://csharptest.net/downloads/schema/log4net.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<!-- Please make shure the ..\\Logs directory exists! -->
<param name="File" value="Logs\\Log4Net.log"/>
<!--<param name="AppendToFile" value="true"/>-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c %m%n"/>
</layout>
</appender>
<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<to value="" />
<from value="" />
<subject value="" />
<smtpHost value="" />
<bufferSize value="512" />
<lossy value="true" />
<evaluator type="log4net.Core.LevelEvaluator">
<threshold value="WARN"/>
</evaluator>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%newline%date [%thread] %-5level %logger [%property] - %message%newline%newline%newline" />
</layout>
</appender>
<logger name="File">
<level value="ALL" />
<appender-ref ref="LogFileAppender" />
</logger>
<logger name="EmailLog">
<level value="ALL" />
<appender-ref ref="SmtpAppender" />
</logger>
</log4net>
</configuration>
Without modifying your Visual Studio installation, and to take into account proper versioning/etc. amongst the rest of your team, add the .xsd file to your solution (as a 'Solution Item'), or if you only want it for a particular project, just embed it there.
I noticed it a bit late, but if you look into the examples log4net furnishes you can see them put all of the configuration data into an app.config, with one difference, the registration of configsection:
<!-- Register a section handler for the log4net section -->
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
</configSections>
Could the definition it as type "System.Configuration.IgnoreSectionHandler" be the reason Visual Studio does not show any warning/error messages on the log4net stuff?
I followed Kit's answer https://stackoverflow.com/a/11780781/6139051 and it didn't worked for AppenderType values like "log4net.Appender.TraceAppender, log4net". The log4net.dll assembly has the AssemblyTitle of "log4net", i.e. the assembly name does not have a dot inside, that was why the regex in Kit's answer didn't work. I has to add the question mark after the third parenthetical group in the regexp, and after that it worked flawlessly.
The modified regex looks like the following:
<xs:pattern value="[A-Za-z_]\w*(\.[A-Za-z_]\w*)+(\s*,\s*[A-Za-z_]\w*(\.[A-Za-z_]\w*)?+)?"/>