Using Emma without instrumenting src folder - emma

I am using Emma for the first time and would like to know if there is any way of instrumenting this tool with only .jar files because I have no access to the original source code.
how can .jar be instrumented from commandline and through ANT script as well?
-Thanks!

Related

How to generate jar file from srcjar artifact?

I have some proto files and I am using bazel to build them. I am using proto-rules-grpc to generate the BUILD file for bazel. Then I'm running bazel build command. But the final artefact is in .srcjar.
This also what the rule says and I quote:
Generates a Java protobuf and gRPC srcjar file
But I want the final artefact in .jar format. Whereas .srcjar only contains the .java file.
The manual process I can think of is to extract the raw java file from the .srcjar artefact and then use them to create the .jar file. But this is a bit annoying to do all this manually.
Is there any way to do it without involving the manual process?
Use java_grpc_library.
java_grpc_compile produces a .srcjar. java_grpc_library produces a .jar.

How to configure a sonar-project.properties file for code coverage?

Current my scanner is running through and only scanning the parent and skipping the rest of my nested files. If I run sonarlint (using the cli and specifying some test and source files) , it tries to analyze 37k files instead of the few I need. I have been able to skip ~3k files by adding the <sonar.skip>true</sonar.skip> property to a pom file. However, I still can't configure the project to run across certain sub-folders and print out some kind of code coverage test. (Is JaCoCo needed for the latest version(6.3,0)? Or can code-coverage be handled through some configuration?).
If Sonar seems to be analyzing too many files, it is probably because you had not set the sonar.sources=src/main/java in your sonar-project.properties file, so it defaults to the basedir and includes everything.
SonarQube can't do code-coverage itself, it just reports on coverage-reports from a tool like JaCoCo. It is funny they don't clarify these things in https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner --but with enough digging, you can find good info on that site.

Maven: Execute custom code during assembly

We are using the assembly plugin to build a zip package.
I would like to execute some custom java code during the execution of the Maven Assembly plugin. The java app should have access to the structure of the assembly but before the zip file is built. So, files which should go into the zip might possibly be modified/added/removed.
How would I configure that?
Cheers
Jonas
I do not think executing Java code is possible. Try getting along with exclusion patterns for file removal and maven filters for file modifications.
http://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html

Maven Build - SoX / Audio Conversion

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.

Build a Oracle ADF application jar file using Ant

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

Resources