I have used highchart-export-web war in my project. I want to change app-convert.properties file of the war on runtime. (while extracting war to deploy folder. )
Related
Grails 3.2.5. Build.gradle has mail plugin:
compile "org.grails.plugins:mail:2.0.0.RC6"
In deploying a war to production I need to remove javax.mail-1.5.6.jar from WEB-INF/lib since that jar must be in the Tomcat lib when using a JNDI mail resource. So how do I keep the mail plugin but remove the offending jar file from the war? I knew how to do this in Grails 2.x. Via the gradle war task in build.gradle I have tried to exclude the file (doesn't work - the jar drifts in from a plugin somehow), and have tried to filter the file out. When I build the war I get two files - "app-0.1.war" and "app-0.1.war.original". The "original" file has the WEB-INF/lib/javax.mail jar filtered out, but the real, complete war still has it.
So how do I prevent that plugin jar from getting into the war file? Thanks.
One way to do it is with something like this:
war {
rootSpec.exclude '**/javax.mail*.jar'
}
(you may need to adjust depending on whether or not you want to also exclude the javax.mail-api jar file along with the javax.mail jar)
See https://github.com/jeffbrown/excludejar/blob/67734ac0c65cdbead468f1e65bcfc29041cd2279/build.gradle#L70-L72
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 wanna add additional files, respectively test data file, to the generated WAR file. How can I modify the build.gradle to reach this goal? I have already tried to change the war task, e.g.
war {
from "testdata"
}
but no files were added to the war file. GRAILS 3.1.8 is used.
Here is example code - we use it to copy generated docs to war:
//copy documnetation to war if exist
war {
from('build/docs/manual') {
include '**/*'
into('docs')
}
}
I have done a small application in Grails, and now I need to generate a war file to test it on server. I generated a war using command grails:war. It has generated the file but named it as myapp-01.war. I don't want this, I need a war where the file name should be same as the project; like myapp.war
Try:
grails war myapp.war
Additional options: http://docs.grails.org/3.1.1/ref/Command%20Line/war.html
I have a jar file to build my project stored within source control with the rest of the project files. An older version of this jar file is in the ant/lib/ folder as well. When I do a Jenkins deployment, it is referencing the old jar despite being aware of the jar in source control. How can I get Jenkins to use the file in source control rather than in the ant/lib/ folder?