You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by rm...@apache.org on 2014/01/14 18:57:14 UTC

git commit: making diagram mojo working headless

Updated Branches:
  refs/heads/master 0a8765b44 -> 1bc5d4fb5


making diagram mojo working headless


Project: http://git-wip-us.apache.org/repos/asf/incubator-batchee/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-batchee/commit/1bc5d4fb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-batchee/tree/1bc5d4fb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-batchee/diff/1bc5d4fb

Branch: refs/heads/master
Commit: 1bc5d4fb51ce60525b31ab09809b2fbf748f7389
Parents: 0a8765b
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Tue Jan 14 18:57:28 2014 +0100
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Tue Jan 14 18:57:28 2014 +0100

----------------------------------------------------------------------
 tools/maven-plugin/pom.xml                                | 10 ++++++++++
 .../java/org/apache/batchee/tools/maven/DiagramMojo.java  |  6 +-----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/1bc5d4fb/tools/maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/tools/maven-plugin/pom.xml b/tools/maven-plugin/pom.xml
index c3c54a6..1c7d109 100644
--- a/tools/maven-plugin/pom.xml
+++ b/tools/maven-plugin/pom.xml
@@ -104,6 +104,16 @@
           <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
         </configuration>
       </plugin>
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.16</version>
+          <configuration>
+            <systemPropertyVariables>
+                <java.awt.headless>true</java.awt.headless>
+            </systemPropertyVariables>
+          </configuration>
+      </plugin>
     </plugins>
   </build>
 

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/1bc5d4fb/tools/maven-plugin/src/main/java/org/apache/batchee/tools/maven/DiagramMojo.java
----------------------------------------------------------------------
diff --git a/tools/maven-plugin/src/main/java/org/apache/batchee/tools/maven/DiagramMojo.java b/tools/maven-plugin/src/main/java/org/apache/batchee/tools/maven/DiagramMojo.java
index f0ca6a4..9747bf6 100644
--- a/tools/maven-plugin/src/main/java/org/apache/batchee/tools/maven/DiagramMojo.java
+++ b/tools/maven-plugin/src/main/java/org/apache/batchee/tools/maven/DiagramMojo.java
@@ -250,9 +250,6 @@ public class DiagramMojo extends AbstractMojo {
         viewer.setPreferredSize(diagramLayout.getSize());
         viewer.setSize(diagramLayout.getSize());
 
-        // creating a realized window to be sure the viewer will be able to draw correctly the graph
-        final JFrame window = createWindow(viewer, diagram.getName());
-
         // saving it too
         if (!output.exists() && !output.mkdirs()) {
             throw new MojoExecutionException("Can't create '" + output.getPath() + "'");
@@ -261,6 +258,7 @@ public class DiagramMojo extends AbstractMojo {
 
         // viewing the window if necessary
         if (view) {
+            final JFrame window = createWindow(viewer, diagram.getName());
             final CountDownLatch latch = new CountDownLatch(1);
             window.setVisible(true);
             window.addWindowListener(new WindowAdapter() {
@@ -275,8 +273,6 @@ public class DiagramMojo extends AbstractMojo {
             } catch (final InterruptedException e) {
                 getLog().error("can't await window close event", e);
             }
-        } else {
-            window.dispose();
         }
     }