Anyone know how to inject an ant build date time stamp into an html page?
When you refer ant, I assume you're on Java.
You can use tstamp task and echo to a property file. This property file can be bundled into the jar so that the application can read the property and display the value as required.
Ex:
<target name="build.timestamp">
<tstamp>
<format property="build.timestamp" pattern="yyyy.MM.dd-hh.mm.ss" locale="en,UK"/>
</tstamp>
<echo message="tstamp=${build.timestamp}" file="build-timestamp.properties"/>
</target>
This will create a build-timestamp.properties in current ant directory.
Jar it up as a regular resource file along with application classes so that it becomes available at app run time.
Related
I have a simple batch (let's call it run_job.bat) job that I set up in VSTS as release definition. VSTS reads this file from the remote git repository that is also set up in VSTS.
The agent is configured on a remote machine to access certain folder, say C:\AllScans\FolderWhereScanIsRunning\ bring the necessary batch file in there and start the run. The job runs some scan against web application and generates report file with some unknown for me extension.
Another job then runs as queue in VSTS (let's call it run_report.bat) that transforms this unckown file to zip file where .html, .css and .js files are sitting. Simply exporting this manually to another folder and double clicking on the index.html file shows nicely looking html report on how the scan is run, and if there were any failures during it.
My question: is it possible to access this zip file C:\AllScans\FolderWhereScanIsRunning\report.zip, unzip it and bring this index.html file within the VSTS UI? I want be able for my other coworkers to see the results of the scan in html format without leaving VSTS interface? Thanks for the help
There isn't any way to achieve this by default.
A workaround would be deploy the html files to a web page which allow iframe embedding and then use "Embedded Webpage" widget in VSTS to show the content.
I want to add a csv response template to the default slingshot/search? web script which is inside in a jar (Alfresco remote api).
Already l have an ant script which build a jar inside Alfresco/tomcat/shared/lib
Inside this jar l have define an extension xml file config/alfresco/site-data/extensions/extension-modules.xml
<extension>
<modules>
<module>
<id>Custom DocumentList Widget</id>
<description>Extend Alfresco Search</description>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.slingshot.search
</targetPackageRoot>
<sourcePackageRoot>webscripts.search</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
Also lnside config/webscripts/search l have the search.get.csv.ftl file but I never get the csv response. Is this the best way to modify/extend the default web script ?
No this isn't the best way to extend this in your case.
Normally it is, but in your case just use the default override mechanism of Alfresco.
So just place your addition in org/alfresco/slingshot/search, cause Alfresco doesn't has a csv.ftl file, so it will be available.
The extension module is uses to extend/change the default get.js & get.html.ftl file, so I'm not sure if it will accept any addition if you don't specify the one of the above files.
I have a web application and I use gradle to build it. In one of the xml files in WEB-INF folder (src/main/webapp/WEB-INF/my.xml) I have a piece of file that needs replacing.
<system-properties>
<property name="clientId" value="#clientId#" />
</system-properties>
When I try to replace the token with some value using:
processResources{
filter(ReplaceTokens, tokens:['clientId': 'test'])
}
Than when I run gradle build the token in the output file (./build/exploded-app/WEB-INF/my.xml) is not replaced. I was wondering which is the correct way to do this?
The problem is that you are configuring the wrong task. processResources only copies files from src/main/resources (or whatever else you define in the main sourceSet as resource), while it is task war which copies / zips your my.xml.
war {
filter(ReplaceTokens, tokens:['clientId': 'test'])
}
I have an XML Source task which requires a XSD to generate my data flow work from my XML files in SSIS. How can I embed the XSD file within the SLN/DTSX project and have it be referenced correctly? It would seem the best case would be to have the XSD source inside a variable, but I dont see where I can do that given the XML Source data task
Using Project Deployment model it is possible to get the miscellaneous files bundled with the deployment. However I want to use the Project Deployment model. That model does not allow for files other than the ispac file. To get around the problem using this following post as reference SSIS dynamic xsd source file
Effectively you store the XSD within a available sql server database as a XML schema, use a dataflow to query for it, and store it in a RAW FILE. Then save the RAW file to disk for future use. Very Effective
I have simple java app that prints `hello world!' on console. It is packed in app.jar.
Jar structure:
main/Hello.class - my main class with singe println method
META-INF/MANIFEST.MF
Manifest file contains following:
Manifest-Version: 1.0
Main-Class: main.Hello
Everything goes fine.
But when you have a dependency than troubles begin. I'm not sure but think in this case you have to put all libs to jar file. If I put them in META-INF/lib I must specify "Class-Path" in manifest. How "Class-Path" will look?
P.S There are some resembling questions but I haven't found appropriate answer.
I tend to use an ANT build script to package my application and all necessary jar files. I find this makes life much easier once you've got it working properly.
build.xml file looks something like:
<project default="create_run_jar" name="Create Runnable Jar for MyProject">
<!--ANT 1.7 is required -->
<target name="create_run_jar">
<jar destfile="my-runnable-jar.jar">
<manifest>
<attribute name="Main-Class" value="my.MainClass"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="E:/path/to/my/project/bin"/>
<fileset dir="E:/path/to/my/project/classes"/>
<zipfileset src="E:/path/to/library/some-library.jar"/>
</jar>
</target>
</project>
Note that if you use Eclipse, you can simplly do File / Export... / Runnable jar file and it will do everything for you (including generating the ANT build.xml).
You don't have to specify anything special if you unpack the libraries and integrate them into your project. If you do this, you should have a "main" folder, and if you have org.apache.foo as an external library, you'll also have an "org" folder at the top level.