How to draw the result of "Analyze Particles" on the original image?

Thank you for the advice. But I guess the generated java code by the macro recorder, is only suitable for developing plugins. Since I am developing my own java application, I can only get general ideas from the generated macro and may not be able to directly use it.

Are you generating macro code? Or Java code? The recorder can do either.

The Java code generated will work from your own application, with the caveat that it might rely on the ImageJ 1.x user interface being visible to work properly, depending on the circumstances.

Yes I generated the java code. I don’t want the ImageJ user interface to be visible in my application.

You will find various limitations in what you can do using the ImageJ 1.x API without its interface being visible.

In general, consider using the ImageJ2 APIs instead for maximum flexibility.

If you describe specifically what you are trying to do, we can comment further.

1 Like

Thank you for your prompt reply @ctrueden. I am specifically trying to deal with the problem I’ve already described here on StackOverflow. I am going to develop a software for a hair transplant company which allows them count the number of hairs they transplant for each patient. I may ask specifically about this on a separate question, but that’s all I am trying to achieve.

I am trying to count the number of white dots in that scalp picture using a combination of several methods and filters including: “Subtract Background”, “FFT > Bandpass Filter” (to correct uneven illumination), “Adjust > Threshold”, Posterizing (which seems not to be available in ImageJ), “Binary > Fill Holes”, “Filters > Median”, “Process > Binary > Erode, Dilate, Open, Close, Watershed”, “Analyze > Analyze Particles” and finally use the “ROI Manager” to show the found dots and count them. I may also need to use some filters from “Plugins > Fast Morphology > Morphological Filters”.

That’s all the features I think I need to use of ImageJ library behind the scenes in the application I am developing.

I also came across Cell Profiler which seems very promising. Do you think I can use it for my purpose?

And thank you for pointing out ImageJ2 APIs. Currently I am using the libraries shipped with ImageJ 1.49. Is it fine if I download https://github.com/imagej/imagej to work with ImageJ2 API? What about testing its functionality before using the API? Should I use Fiji instead of ImageJ?

Hi Meysam

If you are interested in ImageJ2 I suggest starting with the ImageJ2 tutorials on github

I have actually been working on projects similar to yours over the last couple years, processing images from dermatology, looking for spots, porphyrins etc…

I put some code on github that shows how you might attack scalp analysis in an ImageJ2ish fashion… by no means polished or optimized for your application, however it shows how you might build an application out of ImageJ2 commands and ops.

Scalp analysis example(s)

2 Likes

Thank you @bnorthan :slightly_smiling: I really appreciate the code you shared on github. Could you please share the file this example application is working with? (aR5VYcropped.tif) (Is it the scalp image I posted myself?)

And your sample application opens the ImageJ as well, right? Is it possible to avoid it?

It’s easy to avoid opening up the ImageJ. I just updated it on github.

this code starts imagej and shows the GUI

 final ImageJ ij = net.imagej.Main.launch(args);

this code creates a new ImageJ instance… but doesn’t show the GUI

final ImageJ ij = new ImageJ();
2 Likes

I just cropped a version of the ‘truecolor’ image you shared on stack overflow. It was cropped closer to the patient’s head, just to make the program run faster.

2 Likes

@meysam I updated the Scalp Analysis so that it can find Fiji plugins. Previously the routine based on “Auto Threshold” didn’t run correctly. If you want to try running the program on your machine you will have to edit ScalpAnalysisMain.java so that the directory locations are correct for your system.

Do you use maven?? To start my example project, from the command line with maven try

mvn exec:java -Dexec.mainClass=“com.truenorth.ScalpAnalysisMain”

For ImageJ2 development it is useful to know a little bit about maven. Maven in 5 minutes.

Maven can be used within an IDE. I use eclipse, I think you mentioned you use NetBeans?? If so search for “NetBeans Maven” or ask other netbeands users about this.

1 Like

Hi @bnorthan
Thank you for the update. Indeed, I’ve never used maven before, but it seems easy to get my hands on it. I can work both on Windows and Linux, but currently I am on Windows and cannot execute the mvn exec:java command you mentioned. Fortunately, I am using NetBeans to open your sample project and it apparently automatically takes care of the maven stuff. After opening the project in NetBeans, it resolves all the ImageJ dependencies using the pom.xml file. I could run your application and got two different output images (which to me seems that you have tested two different approaches on the image):

So it gives me a good start on using ImageJ and its plugins behind the scenes. I will take a look at your code and will try to fine tune it to get more accurate results. I greatly appreciate your help and will keep you posted. :smile:

2 Likes

Awesome that you got it running so fast.

Here is a quick explanation of the various parts of the program

The program is made of 4 Commands and a main

Main -> starts up headless imagej, loads the data, calls ScalpAnalysisCommand

ScalpAnalysisCommand -> high level command

OpsLogFilterThresholdCommand -> This uses the IJ2 ops library to perform the segmentation

IJ1LocalAutoThresholdAndOpenCommand -> Uses IJ1 function(s) to perform the segmentation

CountParticlesDrawOverlay -> Uses IJ1 to count particles and draw the overlay.

This example is really a hybrid ImageJ2/IJ1 program. If you have several IJ1 processing steps, that produce nice results for your example, it should be feasible for you to wrap them in your own command(s).

2 Likes

Dear @bnorthan,

I’ve been working on another project and just got the chance to get back to this…
I created a simple Maven-based JavaFx application in Netbeans, and added only ImageJ ij = new ImageJ(); to my code. But when the application starts, the UI of ImageJ is loaded separately and shown as well. Do you know why?

package com.meysam.hello;

import ij.ImageJ;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

public class FXMLController implements Initializable {

    @FXML
    private Label label;

    @FXML
    private void handleButtonAction(ActionEvent event) {
        System.out.println("You clicked me!");
        label.setText("Hello World!");
    }

    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // create the ImageJ application context with all available services
        final ImageJ ij = new ImageJ();// net.imagej.Main.launch(args);

    }
}

I’ve also added these lines to the pom.xml file:

<repositories>
    <repository>
        <id>imagej.public</id>
        <url>http://maven.imagej.net/content/groups/public</url>
    </repository>
</repositories>
   
<dependencies>
    <dependency>
        <groupId>net.imagej</groupId>
        <artifactId>ij</artifactId>
        <version>1.50e</version>
    </dependency>
    <dependency>
        <groupId>net.imagej</groupId>
        <artifactId>imagej-common</artifactId>
        <version>0.19.0</version>
        <type>jar</type>
    </dependency>
</dependencies>

Hi @meysam, it looks like you are importing ij.ImageJ which is actually ij 1.50. in my imagej2 projects I import net.imagej.ImageJ

And add these lines to the pom.xml.

<parent>
		<groupId>net.imagej</groupId>
		<artifactId>pom-imagej</artifactId>
		<version>14.4.0</version>
		<relativePath />
</parent>

<dependencies>
		<dependency>
			<groupId>net.imagej</groupId>
			<artifactId>imagej</artifactId>
		</dependency>
</dependencies>
2 Likes

Thank you @bnorthan
I am now getting the following exception for this line of code:

final ImageJ ij = new ImageJ();

Caused by: java.lang.IllegalArgumentException: No compatible service: org.scijava.service.SciJavaService
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:243)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:170)
at org.scijava.Context.(Context.java:277)
at org.scijava.Context.(Context.java:234)
at org.scijava.Context.(Context.java:174)
at org.scijava.Context.(Context.java:160)
at net.imagej.ImageJ.(ImageJ.java:79)
at com.meysam.scalpanalyzer.FXMLController.initialize(FXMLController.java:25)

I’ve also got a question regarding the following dependency:

<dependencies>
    <dependency>
        <groupId>net.imagej</groupId>
        <artifactId>imagej</artifactId>
    </dependency>
</dependencies>

Is it really required to add it to the pom.xml? I am asking this because this dependency has already been included in the parent pom file. In case it’s really necessary, why does it have no version?

p.s. The complete pom.xml file now looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.imagej</groupId>
        <artifactId>pom-imagej</artifactId>
        <version>14.4.0</version>
        <relativePath />
    </parent>
    
    <groupId>com.meysam</groupId>
    <artifactId>ScalpAnalyzer</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ScalpAnalyzer</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <mainClass>com.meysam.scalpanalyzer.MainApp</mainClass>
        <scijava.jvm.version>1.8</scijava.jvm.version>
    </properties>

    <organization>
        <!-- Used as the 'Vendor' for JNLP generation -->
        <name>Your Organisation</name>
    </organization>        

    <repositories>
        <repository>
            <id>imagej.public</id>
            <url>http://maven.imagej.net/content/groups/public</url>
        </repository>
    </repositories>

    <dependencies>

        <dependency>
            <groupId>net.imagej</groupId>
            <artifactId>imagej</artifactId>
        </dependency>
       
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>1.2</version>
        </dependency>
        
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>unpack-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <excludeScope>system</excludeScope>
                            <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds>
                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>unpack-dependencies</id>
                        
                        <phase>package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>${java.home}/../bin/javafxpackager</executable>
                            <arguments>
                                <argument>-createjar</argument>
                                <argument>-nocss2bin</argument>
                                <argument>-appclass</argument>
                                <argument>${mainClass}</argument>
                                <argument>-srcdir</argument>
                                <argument>${project.build.directory}/classes</argument>
                                <argument>-outdir</argument>
                                <argument>${project.build.directory}</argument>
                                <argument>-outfile</argument>
                                <argument>${project.build.finalName}.jar</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>exec</goal>                            
                        </goals>
                        <configuration>
                            <executable>${java.home}/bin/java</executable>
                            <commandlineArgs>${runfx.args}</commandlineArgs>
                        </configuration>
                    </execution>
                </executions>  
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <additionalClasspathElements>
                        <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Yes, you need to declare it. The parent POM only declares it in the <dependencyManagement> section. It does not declare it as an actual dependency. The parent POM provides only the Bill of Materials (BOM)—i.e., which versions of which components are intended to go together.

Because the parent POM defines the version as part of the BOM.

That exception implies that no services whatsoever were found on your class path, which is quite odd. It should be impossible, actually, since the scijava-common library itself which is looking for services does declare some of its own. So this is a new one on me. Can you push a Short, Self-Contained, Correct Example which illustrates the problem?

Absolutely, I pushed the problematic project here:

I don’t know why, but another problem I have is that compiling the project (using mvn package) takes a long time, like 7 minutes. Is it because a lot of dependent libraries have to be linked? If that’s the case, there should be someway to omit the ones I do not require.


Building ScalpAnalyzer 1.0-SNAPSHOT

— maven-enforcer-plugin:1.3.1:enforce (enforce-rules) @ ScalpAnalyzer —
Adding ignorable dependency: null:jcodings:null
Adding ignore: org/jcodings/*
Adding ignorable dependency: null:jnr-constants:null
Adding ignore: com/kenai/constantine/*
Adding ignore: jnr/constants/*
Adding ignorable dependency: null:jnr-ffi:null
Adding ignore: jnr/ffi/*
Adding ignorable dependency: null:joda-time:null
Adding ignore: *
Adding ignorable dependency: null:slf4j-log4j12:null
Adding ignore: org/slf4j/impl/*
Adding ignorable dependency: batik:batik:null
Adding ignore: *
Adding ignorable dependency: jama:jama:null
Adding ignore: Jama/*
Adding ignorable dependency: com.sun:tools:null
Adding ignore: *

— build-helper-maven-plugin:1.9.1:regex-property (sanitize-version) @ ScalpAnalyzer —
No match to regex ‘^([0-9]+).([0-9]+).([0-9]+).*$’ found in ‘1.0-SNAPSHOT’. The initial value ‘1.0-SNAPSHOT’ is left as-is…

— buildnumber-maven-plugin:1.3:create (default) @ ScalpAnalyzer —
Executing: cmd.exe /X /C “git rev-parse --verify HEAD”
Working directory: E:\Development\Projects\Netbeans\Java\ScalpAnalyzer
Storing buildNumber: UNKNOWN at timestamp: 1455659452949
Cannot get the branch information from the git repository:
Detecting the current branch failed: ‘git’ is not recognized as an internal or external command,
operable program or batch file.

Executing: cmd.exe /X /C “git rev-parse --verify HEAD”
Working directory: E:\Development\Projects\Netbeans\Java\ScalpAnalyzer
Storing buildScmBranch: UNKNOWN_BRANCH

— maven-resources-plugin:2.6:resources (default-resources) @ ScalpAnalyzer —
Using ‘UTF-8’ encoding to copy filtered resources.
Copying 2 resources

— maven-compiler-plugin:3.1:compile (default-compile) @ ScalpAnalyzer —
Nothing to compile - all classes are up to date

— maven-resources-plugin:2.6:testResources (default-testResources) @ ScalpAnalyzer —
Using ‘UTF-8’ encoding to copy filtered resources.
skip non existing resourceDirectory E:\Development\Projects\Netbeans\Java\ScalpAnalyzer\src\test\resources

— maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ScalpAnalyzer —
No sources to compile

— maven-surefire-plugin:2.16:test (default-test) @ ScalpAnalyzer —
No tests to run.

— maven-jar-plugin:2.5:jar (default-jar) @ ScalpAnalyzer —

— maven-source-plugin:2.3:jar-no-fork (default) @ ScalpAnalyzer —

— maven-dependency-plugin:2.6:unpack-dependencies (unpack-dependencies) @ ScalpAnalyzer —
invokebinder-1.2.jar already exists in destination.
languagesupport-2.5.8.jar already exists in destination.
miglayout-3.7.4-swing.jar already exists in destination.
javassist-3.19.0-GA.jar already exists in destination.
clojure-1.6.0.jar already exists in destination.
scijava-plugins-platforms-0.2.0.jar already exists in destination.
imagej-ui-swing-0.17.0.jar already exists in destination.
joda-time-2.3.jar already exists in destination.
scijava-plugins-text-plain-0.1.2.jar already exists in destination.
imagej-deprecated-0.1.1.jar already exists in destination.
jama-1.0.3.jar already exists in destination.
imglib2-realtransform-2.0.0-beta-29.jar already exists in destination.
scripting-jruby-0.2.3.jar already exists in destination.
udunits-4.3.18.jar already exists in destination.
imglib2-algorithm-fft-0.1.2.jar already exists in destination.
scripting-javascript-0.4.2.jar already exists in destination.
eventbus-1.4.jar already exists in destination.
jnr-posix-3.0.1.jar already exists in destination.
options-1.1.jar already exists in destination.
jruby-stdlib-1.7.12.jar already exists in destination.
scifio-0.27.1.jar already exists in destination.
scripting-clojure-0.1.4.jar already exists in destination.
jruby-core-1.7.12.jar already exists in destination.
scijava-common-2.50.1.jar already exists in destination.
scijava-plugins-commands-0.2.1.jar already exists in destination.
imagej-updater-0.7.8.jar already exists in destination.
gentyref-1.1.0.jar already exists in destination.
scijava-plugins-text-markdown-0.1.2.jar already exists in destination.
imglib2-2.5.0.jar already exists in destination.
scripting-java-0.3.5.jar already exists in destination.
mapdb-1.0.3.jar already exists in destination.
imagej-common-0.19.0.jar already exists in destination.
groovy-2.3.6.jar already exists in destination.
asm-analysis-4.0.jar already exists in destination.
jhotdraw-7.6.0.jar already exists in destination.
imagej-plugins-commands-0.6.0.jar already exists in destination.
imglib2-roi-0.4.2.jar already exists in destination.
imagej-legacy-0.17.5.jar already exists in destination.
asm-util-4.0.jar already exists in destination.
imagej-plugins-uploader-webdav-0.2.0.jar already exists in destination.
commons-csv-1.2.jar already exists in destination.
asm-commons-4.0.jar already exists in destination.
markdownj-0.3.0-1.0.2b4.jar already exists in destination.
swing-checkbox-tree-1.0.1.jar already exists in destination.
minimaven-2.2.0.jar already exists in destination.
imagej-ops-0.24.1.jar already exists in destination.
scifio-jai-imageio-1.1.0.jar already exists in destination.
joni-2.1.1.jar already exists in destination.
imagej-plugins-uploader-ssh-0.3.0.jar already exists in destination.
imagej-ui-awt-0.3.0.jar already exists in destination.
jffi-1.2.7.jar already exists in destination.
commons-lang3-3.1.jar already exists in destination.
jfreechart-1.0.19.jar already exists in destination.
scijava-ui-awt-0.1.4.jar already exists in destination.
ij-1.50e.jar already exists in destination.
bsh-2.0b4.jar already exists in destination.
jnr-constants-0.8.5.jar already exists in destination.
asm-tree-4.0.jar already exists in destination.
jzlib-1.1.2.jar already exists in destination.
imglib2-algorithm-0.3.3.jar already exists in destination.
object-inspector-0.1.jar already exists in destination.
imagej-2.0.0-rc-43.jar already exists in destination.
commons-math3-3.5.jar already exists in destination.
imglib2-ij-2.0.0-beta-31.jar already exists in destination.
jcommon-1.0.23.jar already exists in destination.
rsyntaxtextarea-2.5.8.jar already exists in destination.
jffi-1.2.7-native.jar already exists in destination.
yecht-1.0.jar already exists in destination.
jcodings-1.0.10.jar already exists in destination.
autocomplete-2.5.8.jar already exists in destination.
jnr-netdb-1.1.2.jar already exists in destination.
scripting-groovy-0.2.3.jar already exists in destination.
base64-2.3.8.jar already exists in destination.
ij1-patcher-0.12.3.jar already exists in destination.
scijava-ui-swing-0.7.1.jar already exists in destination.
jnr-unixsocket-0.3.jar already exists in destination.
scijava-expression-parser-2.1.1.jar already exists in destination.
nailgun-server-0.9.1.jar already exists in destination.
jsch-0.1.49.jar already exists in destination.
mines-jtk-20151125.jar already exists in destination.
jnr-enxio-0.4.jar already exists in destination.
jnr-ffi-1.0.7.jar already exists in destination.
jdatepicker-1.3.2.jar already exists in destination.
jython-shaded-2.5.3.jar already exists in destination.
rhino-1.7.6.jar already exists in destination.
scripting-beanshell-0.2.3.jar already exists in destination.
asm-4.0.jar already exists in destination.
snakeyaml-1.13.jar already exists in destination.
imagej-scripting-0.2.2.jar already exists in destination.
bytelist-1.0.11.jar already exists in destination.
scripting-jython-0.2.4.jar already exists in destination.
imagej-plugins-tools-0.3.0.jar already exists in destination.
trove4j-3.0.3.jar already exists in destination.
jnr-x86asm-1.0.2.jar already exists in destination.

— exec-maven-plugin:1.2.1:exec (unpack-dependencies) @ ScalpAnalyzer —

The compilation gets stuck in the last line, almost for seven minutes! :frowning:, before the following error appears:

Caused by: java.lang.IllegalArgumentException: No compatible service: org.scijava.service.SciJavaService
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:243)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:170)
at org.scijava.Context.(Context.java:277)
at org.scijava.Context.(Context.java:234)
at org.scijava.Context.(Context.java:174)
at org.scijava.Context.(Context.java:160)
at net.imagej.ImageJ.(ImageJ.java:79)
at com.meysam.scalpanalyzer.FXMLController.initialize(FXMLController.java:25)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
… 22 more
Exception running application com.meysam.scalpanalyzer.MainApp

BUILD FAILURE

Total time: 6:39.977s
Finished at: Wed Feb 17 01:27:15 IRST 2016
Final Memory: 30M/771M

Ah, thank you. I see you are building an uber-JAR. Do you need to do this? As things stand, the plugin metadata inside each JAR file (in META-INF/json/org.scijava.plugin.Plugin) is getting repeatedly overwritten, which results in no plugins being found when you execute the uber-JAR.

It succeeds in 35 seconds on my system (some parts trimmed):

$ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_73, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.3", arch: "x86_64", family: "mac"
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ScalpAnalyzer 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ ScalpAnalyzer ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-rules) @ ScalpAnalyzer ---
...
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:regex-property (sanitize-version) @ ScalpAnalyzer ---
[INFO] No match to regex '^([0-9]+)\.([0-9]+)\.([0-9]+).*$' found in '1.0-SNAPSHOT'. The initial value '1.0-SNAPSHOT' is left as-is...
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ ScalpAnalyzer ---
[INFO] Executing: /bin/sh -c cd /Users/curtis/t/javafx && git rev-parse --verify HEAD
[INFO] Working directory: /Users/curtis/t/javafx
[INFO] Storing buildNumber: 909c0fd1d2100067602903e177408efa195c0f2a at timestamp: 1455661021631
[INFO] Storing buildScmBranch: master
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ ScalpAnalyzer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ ScalpAnalyzer ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/curtis/t/javafx/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ ScalpAnalyzer ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/curtis/t/javafx/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ ScalpAnalyzer ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ ScalpAnalyzer ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.5:jar (default-jar) @ ScalpAnalyzer ---
[INFO] Building jar: /Users/curtis/t/javafx/target/ScalpAnalyzer-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-source-plugin:2.3:jar-no-fork (default) @ ScalpAnalyzer ---
[INFO] Building jar: /Users/curtis/t/javafx/target/ScalpAnalyzer-1.0-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-dependency-plugin:2.6:unpack-dependencies (unpack-dependencies) @ ScalpAnalyzer ---
[INFO] Unpacking /Users/curtis/.m2/repository/com/headius/invokebinder/1.2/invokebinder-1.2.jar to /Users/curtis/t/javafx/target/classes with includes "" and excludes ""
...
[INFO] Unpacking /Users/curtis/.m2/repository/com/github/jnr/jnr-x86asm/1.0.2/jnr-x86asm-1.0.2.jar to /Users/curtis/t/javafx/target/classes with includes "" and excludes ""
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:exec (unpack-dependencies) @ ScalpAnalyzer ---
javafxpackager has been renamed javapackager
The original file may be removed in a future release in lieu of javapackager.
Please update your scripts.

[INFO]
[INFO] --- maven-jar-plugin:2.5:test-jar (default) @ ScalpAnalyzer ---
[INFO] Skipping packaging of the test-jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.043 s
[INFO] Finished at: 2016-02-16T16:17:32-06:00
[INFO] Final Memory: 53M/650M
[INFO] ------------------------------------------------------------------------

Oh that was not intentional. I may need that for deploying the application but not at the moment. How can I avoid that?
Now I understand why when the project compiles successfully, the size of the generate jar file is very large! (71 MBs)

Remove the maven-dependency-plugin configuration in your <build> section, as well as the unpack-dependencies execution of your exec-maven-plugin configuration. (The other execution, default-cli, does not work from the CLI, but that is irrelevant to the problem at hand.)

2 Likes