I am trying to download a war file from another machine using get task, below are the scripts -
<get src="http://XX.XX.XXX.XXX:8080/job/workboat-server/ws/NSMobile/target/NSMobile.war"
dest="${sw-in-house}/NSMobile/NSMobile.war"
username="username"
password="password"/>
where ${sw-in-house} is a directory where I want to download the NSMobile war. Now the problem is, above script is downloading just half of the file. The actual size of the file is 116MB but the file which is getting downloaded is just 80MB. Can anyone help me out with this? For your information, when I am trying to call this ant script directly(i.e. externally) then it works as expected but only when I am trying to call it through Jenkins, it is downloading the incomplete file.
Related
enter image description hereAm using Nexus Artifact Uploader plugin to upload my .ear file to Nexus. Its working fine for all jobs except one. In this particular job am supposed to download an existing .ear file from nexus, do some editing to config files within the ear, repackage it as UpgradeTrue.ear and UpgradeFalse.ear and upload both the ears to the same location from where I have downloaded the original .ear.
Strangely it tries to upload the file which doesnt exist. Please advise.
Thanks in advance.
Jenkins Log Snippet:
I haven an Grails 3.1.8 application and building an executable jar file, which runs fine. Now I wanna upload the produced jar file to my maven repository by using the gradle maven plugin. Here the problem begins. The upload tasks uploads the wrong JAR file.
If I execute 'grails assemble' two files get produced:
100032 mcc-1.0.9.jar
4880 mcc-1.0.9.jar.original
As you can see, the first file having the bigger size is obviously the fat jar file, which works fine. After the assemble task the 'upload' task is executed and uploads the smaller file. I tried also to define the artifact:
artifacts {
archives file: file("build/libs/mcc-1.0.9.jar")
}
Then the fat jar get overwritten or is not produced at all:
4880 mcc-1.0.9.jar
4880 mcc-1.0.9.jar.original
and the small JAR gets uploaded again. How can I force gradle to take the fat jar file or at least produce only the correct file?
Thanks to Hubert Klein who answered my question in the comment section of this article: https://dzone.com/articles/grails-goodness-creating-a-fully-executable-jar.
This happens because the uploadArchives task depends on the jar task by default. But then the bootRepackage task is not executed, that actually overwrites the jar file with the full executable jar file.
If you add to your build.gradle file that the task uploadArchives depends on the assemble task the bootRepackage task is invoked before uploadArchives:
uploadArchives.dependsOn(assemble)
I had the same issue
gradle clean build assemble artifactoryPublish
I need to create a war file through ant build without a manifest file. I want the war to me created without the manifest file.
I am using tag in build.xml to create the war.
you can use <zip/> task with .war extension for destfile attribute to achieve the same result as the <war/> task (without manifest.mf).
<zip destfile="..\...\WarFile.war"basedir="..\basedir" update="true"/>
in case WarFile.war already exists, although you've written I need to create a war file , the attribute update="true" will be of use (by only updating and not overwriting the file).
All a war file is is a zip file in a specific format. That is libraries go in a particular place, class files go elsewhere, etc. The <war> task has sub-entities like <classes/> and <lib> that make configuring a war file correctly without knowing exactly where everything has to go.
However, you can correctly format the war yourself, and use <zip/>.
Why don't you want a manifest file? A manifest, if you don't specify anything, will contain nothing but the Java version used for the build, and the Ant version and won't affect the execution of your war at all.
What you can do is put useful information into the manifest. For example, we use Jenkins for our builds, and we put in the Jenkins project name and the build number which helps us understand what was included in the war.
There's no reason not to use a manifest file. And, a manifest file can contain useful information (which is accessible to the Java program too).
I've just started using Jenkins and need some advice.
After a successful build I would like to have the resulting directory packaged into a zip file and stored in workspace so later I can send to Artifactory.
At the moment I'm using a program that I wrote for that purpose which I run in a batch file as the last step of a build, but I wonder if there is a way of having Jenkins do that.
The file operations plugin has a zip operation.
Used with ${GIT_BRANCH} to create a zip file of the successful build.
https://wiki.jenkins.io/display/JENKINS/File+Operations+Plugin
I you use a pipeline job (wheter that's declarative or scripted) you can use the zipFile step and give it the directory path that you want to be zipped.
https://jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#zip-create-zip-file
I have to copy files after build on a TeamCity-Agent via FTP. The orndinary buildjob works itself works fine. The triggering of a custom script finish successfull, too.
The step "copy files via ftp" fails with the following error:
[15:34:31]: copyFiles
[15:34:31]: [copyFiles] ftp
[15:34:31]: [ftp] Could not create type ftp due to java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClientConfig
I searched the web for a while and found many times the same answer: "You have to put commons-net.jar and jakarta-oro.jar in your ANT-plugin directory." So I downloaded these two files and copied it into C:\TeamCity\buildAgent\lib, but the error still exists.
Now the question:
Where do I have to copy these files to make FTP work? Or am I on the wrong track?
You've put the jar into the wrong place, it must be in the classpath of Ant, not in the classpath of the build agent.
You should find ant.zip file (TeamCity\WEB-INF\plugins\ant-tool\agent\ant.zip) and put the required jar (commons-net-1.4.1.jar, for example) inside ant\lib directory of the ant.zip file.
After the zip is re-packaged, TeamCity will update build agents with the new Ant version and commons-net dependency will be automatically available for Ant via its own classpath.
Note that you will have to repeat this step every time you update TeamCity to a new version.
Another option is to install Ant on build agent machines manually and configure TeamCity to use custom Ant installation (with all the required custom dependencies in the Ant's lib directory), however it's inconvenient if you have many build agents, but you will not have to repeat this step when updating TeamCity server.
Ant-net-task tool is bundled with TeamCity. This tool has jar files necessary for FTP, sshexec, scp and mail.
To use it Additional Ant command line parameters: -lib "%teamcity.tool.ant-net-tasks%" should be added.