I am getting into Maven as a build tool and am trying to convert a whole lot of manual processes to something streamlined.
I have a web application that uses audio files that currently at deployment time, are run through a SoX tasK: http://sox.sourceforge.net/ to convert them to a desired sample rate and destination folder. (manual step using a .bat file)
Is there a plugin or simplified way of integrating the audio build component into the Maven build?
I have thought about using an Ant script embedded in, but not sure if this is the right direction to be heading.
Cheers
It is not difficult to create your own Maven plugin (Mojo). Take a look at the Mojo Developers Cookbook
[Edit ]
I should also mention that you could run the .bat script using the Exec Maven Plugin as a less portable alternative. The exec plugin source code is also a good place to start were you to write your own SoX plugin.
Related
I have a really simple java spring-boot gradle application.
When I build an image from source with:
pack build testapp:0.0.1 --builder paketobuildpacks/builder:base
and try to run it with docker I get the following error:
ERROR: failed to launch: determine start command: when there is no default process a command is required.
The generated Entrypoint in this image is "/cnb/lifecycle/launcher".
When I inspect the image with pack inspect-image there are no processes.
I tried this with different java spring-boot gradle applications. When I use the "bootBuildImage" gradle task, it does nearly the same but uses the pre-build .jar-file and the resulting image works. The generated Entrypoint in this image is "/cnb/process/web" and pack inspect-image shows three processes.
Any ideas?
I can't see your build output, but it sounds like you're hitting a known issue. If this is not your problem, please include the full output of running pack build.
Onto the issue. By default, Spring Boot Gradle projects will build both an executable and non-executable JAR. Because this produces two JAR files, it presently confuses the buildpacks.
There are a couple of solutions:
Tell Gradle to not build the non-executable JAR. The buildpack requires the executable JAR. You can do this by adding the following to your build.gradle file:
jar {
enabled = false
}
This is the solution we have used in the Paketo buildpack samples.
If you don't want to make the change suggested in #1, then you can add the following argument to pack build: -e BP_GRADLE_BUILT_ARTIFACT=build/libs/<your-jar>.jar. For ex: -e BP_GRADLE_BUILT_ARTIFACT=build/libs/demo-0.0.1-SNAPSHOT.jar. You can use glob-style pattern matching here, but you need to make sure that what you enter does not match *-plain.jar. That will be the non-executable JAR that gets built by default.
This option just simply tells the Gradle buildpack more specifically what the JAR file to pass along to subsequent buildpacks.
We also have an open issue that should help to mitigate this problem. When the executable-jar buildpack gains support for multiple JARs, it'll be less likely that you'll need to set this. Essentially, this fill will add support so the executable-jar buildpack can inspect and detect an executable JAR, which would allow it to throw out the -plain.jar file since it's not executable.
I have a go lang application which exposes a rest API and logs the information to DB. I am trying to convert the make file to gradle build. Is there any default way similar to maven2gradle plugin or the gradle build file should be written manually? I checked the syntactical differences between gradle and make file but still not clear about passing run time arguments to gradle that is similar to
run:build
./hello -conf=/apps/content/properties/prop.json -v=0 -logDest="FILE" -log_dir="/var/log/logdir"
hello is my executable and others are the runtime arguments. This is my first attempt in migrating make to gradle and I couldnt find any clear documentation. Please help.
As far as I have checked, there is no direct plugin that could do this task. As a workaround, the build execution could be written as seperate tasks in gradle and ordered accordingly. Tasks here would contain setting Go path, installing dependencies and building the application and would be run as command line process in Gradle. Gradle provides support to run command line processes as described in gradle documentation. Hope it helps.
Congratulations on the spring state machine, I found it yesterday and have been trying it out, specifically the turnstile example running in STS. I found it very easy and intuitive to build a FSM.
Because spring shell doesn't work well in STS I tracked down the instructions to run the examples from the command line in the reference doc,
"java -jar
spring-statemachine-samples-turnstile-1.0.0.BUILD-SNAPSHOT.jar"
,
but running it got an error
"no main manifest attribute, in spring-statemachine-samples-turnstile-1.0.0.BUILD-SNAPSHOT.jar".
Although not even a novice in using gradle, I tried fixing this by adding this line to build.gradle in the jar section
"manifest.attributes['Main-Class'] = 'demo.turnstile.Application'"
(which doesn't handle the various sub-projects I know) but got this error
"NoClassDefFoundError: org/springframework/shell/Bootstrap".
If it is possible to run the samples from gradle, could you include them in the reference document? I tried running the samples using
gradle run
but it there was no interaction with the shell scripts.
Samples are designed to be run as executable jar and with shell so that you can interact without a need to recompile with every change. Your error indicates that you didn't build that sample jar as mentioned in docs.
./gradlew clean build -x test
This will automatically use spring boot plugin which will add the necessary jar manifest headers to jar meta info to make it a true executable jar. Essentially every every sample is a spring boot app.
Building SM sample projects in Windows Environment:
Open Command prompt (windows key + r -->cmd-->Enter), Change directory to project root folder spring-statemachine-master (Inside the Extracted folder).
Run gradlew install to get all spring dependencies copied to local machine.
Run gradlew clean build -x test to get the spring shell jars built. Courtesy Janne
These steps should ideally get all .jar built, look into \build\libs folder of respective sample project for jar files.
Run the like any other java jar file java -jar [jar-file-name.jar] (make sure to be change directory to jar file directory location).
One more thing where I was stuck was, How to give events to SM:
It's like this sm event EVENT_NAME_AS_DEFINED_IN_CLASS. Ref
E.g.: sm event RINSE --> to washer project
I am currently using Maven 3 and have a really simple .ism file for InstallShield 2012.
My pom.xml creates a .jar file which is the only file used by the .ism. I can do something like this:
C:>IsCmdBld.exe -p "c:\InstallShield Projects\Simple.ism" -r "COMP" -y "1.0"
This is of outside of my POM, but I would like to use the version info in the POM and other metadata to in the installer creation.
I'm aware no specific InstallShield plug-in does not exist for Maven, but I'm wondering if there is a way to get Maven to help out by calling the command block above, or something similar?
You could use the exec-maven-plugin and pass in the ${project.version} as part of your execution call.
Otherwise if there is an anttask for InstallShield you could use that with the antrun plugin.
While the question was asked way in the past, and I haven't had access to InstallShield for a year now, I did happen to work on a Maven plugin to introduce things that you want to achieve.
https://github.com/tptak/installshield-maven-plugin
I could continue work on this to some extent if I had a licence
I am trying to write Ant scripts to build jar files for Oracle ADF application and I noticed some differences in the contents being generated by the build (deploy might be a better word actually) process within JDev and from the Ant process:
META-INF/adfc-config.xml
META-INF/adflibWEBINDEX.txt
META-INF/adfm.xml
META-INF/faces-config.xml
META-INF/jar-adf-config.xml
META-INF/jar-connections.xml
META-INF/jax-ws-catalog.xml
META-INF/oracle.adf.common.services.ResourceService.sva
META-INF/task-flow-registry.xml
Does anyone know how these files are generated and how to edit the Ant scripts to include them?
I know that some of these exist in the project folder structure but when I compare their contents against the same files generated from the Jdev build produced jar file they are different. So I assume there is something more than a simple copy going on here.
Cheers,
Mo
Your best bet is to use "Create buildfile from project" in JDeveloper. This will produce the calls to ojdeploy necessary to create/update all the extra artifacts.
http://www.oracle.com/technetwork/articles/adf/part4-098813.html