How to package shell script files on Windows using Maven - maven

we are writing shell scripts in the IDE of Window, and package the project including the shell scripts with assemply maven plugin.
When it is unpacked on Linux OS, there is no problem for the shell scripts is itself, but it has to be changed the format from windows to Linux.
I would ask if there are Maven plugin that supports to make the format transformation during maven packaging process
Thanks!

You shouldn't use an Ant Task for that, cause maven-assembly-plugin's assembly descriptor is capable of doing so. See for lineEndings...

Related

Executing gradle scripts from external directories

I need to execute groovy script with gradle, but the thing is that these scripts are located in external directory (let's say it's Desktop). I've heard, that in previous versions of Gradle (currently working on 3.2.1) it was not possible, since it is not part of the gradle project. I wonder if it is possible now, or do I have to copy all these scripts into some folder located in gradle project, to execute it.
User story:
I found script in external directory (based on some properties passed to console) - I have absolute path to the script
Now I want to execute this script (build.gradle) without copying it into my gradle project
I'm pretty green with gradle and I hope I made my point clear.
Thanks for help and every attempt :)
Is that what you're looking for? To run the script clone the repository, navigate to 42556631/project folder and run the command:
gradle -b ../script/build.gradle clean build
yes you need to move build.gradle file into project/Build Script folder and then run it.

groovy binary edition vs groovy-all-jar

When I want to download groovy from here http://groovy-lang.org/download.html I get the "binary release". This means I have a directory structure with a lib and bin and an embeddable folder. In the bin folder there is a groovy shell script that let's me execute my own groovy sourcefiles. This groovy shell script uses the jarsin the lib directory. I however want it to use the jars in the groovy-all-jar in the embeddable directory. The reason is, that I dont want all the jars in the jar directory in my classpath as I need to use different versions.
How can I make the groovy shell script using the groovy-all-jar?
groovy-all is usually for applications that want to support Groovy. So you just put it in your classpath.
If you want to use something like GroovyConsole from groovy-all using the shell scripts, you will have to edit the startGroovy. I suggest doing the following... remove everything in lib. Then find the line where STARTER_CLASSPATH is frist set and change it to use your groovy-all. I have not tested it, but that should work.
Since groovy-all contains only asm, commons-cli and antlr (in a jarjared version) anything that needs for example Jline (the shell console) will not work

maven, ant, or gradle plugin to execute cygwin cygpath?

Does anyone know of a maven, ant, or gradle plugin that supports invoking cygpath? The cygpath utilities knows how to convert Windows filesystem paths (c:\dev) to cygwin/unix style file paths (/cygdrive/c/dev).
I've searched the internet but didn't find anything. The closest is this jenkins plugin (https://wiki.jenkins-ci.org/display/jenkins/cygpath+plugin).
Context:
I'm trying to automate creating an omniORB maven artifact from the omniORB source tarball. One of the first things I have to do is patch the omniORB source with filesystem paths that match our development environment. On every developer's machine we have an environment variable the specifies the location of their maven repo e.g. c:\mvrepo. The omniORB Windows binaries are built with cygwin. I need to set the omniORB makefile to locate some dependencies from c:\mvnrepo\some-dependency but with a cywin-style path /cygdrive/mvnrepo/some-depenendency.
I cant vouch for it a I haven't used it or looked at it closely but here is a gradle plugin that might be of use: https://github.com/derianto/Gradle-Cygwin-Toolkit-Plugin
In any case, since gradle scripts are written in groovy it should be fairly easy to just code your own solution into your build script if you have to.

Copying files between two windows servers through jenkins

I am working on a project where i want to copy the compiled file (which compiled through jenkins) from one windows server to another through jenkins. Jenkins is installed on a windows server and after building the code, those compiled file should be copied to another windows server through jenkins. Is there any way to achive it?
Jenkins might be able to do it, via the script steps running the scp command; however, if this is part of a build, I would suggest attaching the file(s) to a project, and distributing them through the maven repository.

how do I import my intellij project settings on a groovy script in terminal

I have a single script in a project in intellij that I want to run in my mac terminal. I can run the script but I am getting errors where it can't find the JAR files I added as a module. There are a lot of dependencies, so I was wondering how can I add my intellij project settings to calling my groovy script. Right now all I have is this:
groovy CreateReport.groovy
Turns out all you need to do is dump your libraries into the GROOVY_HOME/lib directory, where GROOVY_HOME is where you have defined your groovy environment variables to be.
http://dustinwhitney.blogspot.com/2008/03/groovy-classpath.html

Resources