Mojo's NetBeans Module Maven Plugin
  1. Mojo's NetBeans Module Maven Plugin
  2. MNBMODULE-78

Module logs are not printed to output window when running netbeans module

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.4
    • Labels:
      None
    • Environment:
    • Number of attachments :
      0

      Description

      When I build and run the netbeans module, I expect to see netbeans logs in the output window (just like in the ant version of netbeans module), however when I run the maven modules, they are not printed into output window.

      How to reproduce:
      Create a new netbeans module project (new project->Maven Project->Maven NetBeans Module Archetype), build it and try to run it. The module complains about missing path to netbeans in pom (<netbeansInstallation>VALUE</netbeansInstallation>), add it, rebuild and run it and close it.

      In the output window or the netbeans I am running module from appears following output:

      NetBeans: Executing '"C:\Program Files\Apache Software Foundation\apache-maven-2.2.1\bin\mvn.bat" -Dnetbeans.execution=true nbm:cluster nbm:run-ide'
      NetBeans: JAVA_HOME=C:\Program Files\Java\jdk1.6.0_03
      Scanning for projects...
      ------------------------------------------------------------------------
      Building Netbeans Module TestModule
      task-segment: [nbm:cluster, nbm:run-ide] (aggregator-style)
      ------------------------------------------------------------------------
      [nbm:cluster]
      Created NetBeans module cluster(s) at D:\TestModule\target\netbeans_clusters
      [nbm:run]
      Additional arguments=null
      --userdir
      D:\TestModule\target\userdir
      -J-Dnetbeans.logger.console=true
      -J-ea
      Executing: cmd.exe /X /C ""c:\Program files\NetBeans 6.8\bin\netbeans.exe" --userdir D:\TestModule\target\userdir -J-Dnetbeans.logger.console=true -J-ea"
      ------------------------------------------------------------------------
      BUILD SUCCESSFUL
      ------------------------------------------------------------------------
      Total time: 13 seconds
      Finished at: Mon Mar 22 17:40:09 CET 2010
      Final Memory: 5M/11M
      ------------------------------------------------------------------------

      As you can see, there is are no log outputs, but the content of logs can be found in log directory of module, such as D:\TestModule\target\userdir\var\log\messages.log.

      Try to run it (the cmd.exe /X /C .... command you can see above) from cmd.exe or through Start->Run... the console window appears with stuff I expect (the logs)

      Microsoft Windows XP [Verze 5.1.2600]
      (C) Copyright 1985-2001 Microsoft Corp.

      C:\Documents and Settings\Admin>cmd.exe /X /C ""c:\Program files\NetBeans 6.8\bin\netbeans.exe" --userdir D:\TestModule\target\userdir -J-Dnetbeans.logger.console=true -J-ea"

      The launcher has determined that the parent process has a console and will reuse it for its own console output. Closing
      the console will result in termination of the running program.
      Use '--console suppress' to suppress console output.
      Use '--console new' to create a separate console window.
      -------------------------------------------------------------------------------
      >Log Session: Monday, March 22, 2010 5:56:21 PM CET
      >System Info:
      Product Version = NetBeans IDE 6.8 (Build 200912041610) (#ec9be6a6486c)
      Operating System = Windows XP version 5.1 running on x86
      Java; VM; Vendor = 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05; Sun Microsystems Inc.
      Runtime = Java(TM) SE Runtime Environment 1.6.0_03-b05
      Java Home = C:\Program Files\Java\jdk1.6.0_03\jre
      System Locale; Encoding = cs_CZ (nb); Cp1250
      Home Directory = C:\Documents and Settings\Admin
      Current Directory = C:\Documents and Settings\Admin
      User Directory = D:\TestModule\target\userdir
      Installation = C:\Program Files\NetBeans 6.8\nb6.8
      C:\Program Files\NetBeans 6.8\ide12
      C:\Program Files\NetBeans 6.8\java3
      C:\Program Files\NetBeans 6.8\apisupport1
      C:\Program Files\NetBeans 6.8\websvccommon1
      C:\Program Files\NetBeans 6.8\profiler3
      C:\Program Files\NetBeans 6.8\harness
      C:\Program Files\NetBeans 6.8\foobar
      D:\TestModule\target\netbeans_clusters\maven1
      c:\Program files\NetBeans 6.8\platform11
      Boot & Ext. Classpath = C:\Program Files\Java\jdk1.6.0_03\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_03\jr
      e\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_03\jre\lib\jsse.jar
      ....
      ....
      Non heap memory usage: initial 32,2MB maximum 232,0MB
      Garbage collector: Copy (Collections=72 Total time spent=0s)
      Garbage collector: MarkSweepCompact (Collections=1 Total time spent=0s)
      Classes: loaded=4840 total loaded=4840 unloaded 0
      INFO [org.netbeans.core.ui.warmup.DiagnosticTask]: Total memory 2á145á824á768
      INFO [org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalog]: No content in cache for URL_Standard provider.
      Returns EMPTY_MAP

      When I run netbeans by itself, I get following (no logs or anything)

      C:\Program Files\NetBeans 6.8\bin>netbeans.exe
      C:\Program Files\NetBeans 6.8\bin>

      The launcher has determined that the parent process has a console and will reuse it for its own console output. Closing
      the console will result in termination of the running program.
      Use '--console suppress' to suppress console output.
      Use '--console new' to create a separate console window.

      C:\Program Files\NetBeans 6.8\bin>

        Issue Links

          Activity

          Hide
          Christian Lebaudy added a comment -

          I experience same problem when running a netbeans platform application : no logs are printed

          this occurs only when using plugin nbm-maven-plugin 3.2
          using 3.1 all is fine for me, I don't know if this issue stands for the same problem as it indicates version 3.1 and it talks about a similar problem when running a module. I open a new issue, close it this is about the same thing.

          Show
          Christian Lebaudy added a comment - I experience same problem when running a netbeans platform application : no logs are printed this occurs only when using plugin nbm-maven-plugin 3.2 using 3.1 all is fine for me, I don't know if this issue stands for the same problem as it indicates version 3.1 and it talks about a similar problem when running a module. I open a new issue, close it this is about the same thing.
          Hide
          Jesse Glick added a comment -

          Working fine for me using a newly created platform app and 3.3-SNAPSHOT.

          Show
          Jesse Glick added a comment - Working fine for me using a newly created platform app and 3.3-SNAPSHOT.
          Hide
          Jesse Glick added a comment -

          Possibly affects only Windows users, in which case it may be a side effect of https://netbeans.org/bugzilla/show_bug.cgi?id=85228 and the new launchers it introduced.

          Show
          Jesse Glick added a comment - Possibly affects only Windows users, in which case it may be a side effect of https://netbeans.org/bugzilla/show_bug.cgi?id=85228 and the new launchers it introduced.
          Hide
          Honza Havlí&#269;ek added a comment -

          If someone else will stumble here, try setting additionalArguments to '--console suppress', that fixes the issue (at least for me in win7 and XP).
          Example:
          <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>nbm-maven-plugin</artifactId>
          <version>3.3</version>
          <extensions>true</extensions>
          <configuration>
          <netbeansInstallation>c:\Program Files\NetBeans 6.9.1</netbeansInstallation>
          <additionalArguments>--console suppress</additionalArguments>
          </configuration>
          </plugin>

          Show
          Honza Havlí&#269;ek added a comment - If someone else will stumble here, try setting additionalArguments to '--console suppress', that fixes the issue (at least for me in win7 and XP). Example: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>nbm-maven-plugin</artifactId> <version>3.3</version> <extensions>true</extensions> <configuration> <netbeansInstallation>c:\Program Files\NetBeans 6.9.1</netbeansInstallation> <additionalArguments>--console suppress</additionalArguments> </configuration> </plugin>
          Hide
          Jesse Glick added a comment -

          I can reproduce w/ 3.1+ in Windows. Does seem to be specific to the new Win launcher.

          Show
          Jesse Glick added a comment - I can reproduce w/ 3.1+ in Windows. Does seem to be specific to the new Win launcher.
          Hide
          Jesse Glick added a comment -

          Fixed in revision 12914.

          Show
          Jesse Glick added a comment - Fixed in revision 12914.
          Hide
          Gabriele Kahlout added a comment -

          Not sure how to re-open the issue.

          I'm trying to debug the following line of code:
          if (value.startsWith(s)) {
          and according to the values shown in the debugger it should work. I'm trying to get more feedback by having printlines of value and s before the statement but these don't show up on the console. I guess -J-Dnetbeans.logger.console=true means to use the output window of netbeans, but it's not working. Neither log nor sout templates get displayed.

          It works for non nbm maven projects. Steps to reproduce:
          new nbm:maven app and in the sample module create an installer and add log/print lines in the restored method.
          Run and see nothing being printed.

          Executing:
          cmd.exe /X /C "C:\Users\kahloutg\ws\MemoPlatform\application\target\memorizeasy\bin\memorizeasy.exe --console suppress --userdir C:\Users\kahloutg\ws\MemoPlatform\application\target\userdir -J-Dnetbeans.logger.console=true -J-ea --branding memorizeasy --jdkhome "C:\Program Files\Java\jdk1.6.0_21" -J-Xdebug -J-Xrunjdwp:transport=dt_socket,suspend=n,server=n,address=58030 -J-Xmx2048m"

          prints the output in the console (w/o --console).

          Show
          Gabriele Kahlout added a comment - Not sure how to re-open the issue. I'm trying to debug the following line of code: if (value.startsWith(s)) { and according to the values shown in the debugger it should work. I'm trying to get more feedback by having printlines of value and s before the statement but these don't show up on the console. I guess -J-Dnetbeans.logger.console=true means to use the output window of netbeans, but it's not working. Neither log nor sout templates get displayed. It works for non nbm maven projects. Steps to reproduce: new nbm:maven app and in the sample module create an installer and add log/print lines in the restored method. Run and see nothing being printed. Executing: cmd.exe /X /C "C:\Users\kahloutg\ws\MemoPlatform\application\target\memorizeasy\bin\memorizeasy.exe --console suppress --userdir C:\Users\kahloutg\ws\MemoPlatform\application\target\userdir -J-Dnetbeans.logger.console=true -J-ea --branding memorizeasy --jdkhome "C:\Program Files\Java\jdk1.6.0_21" -J-Xdebug -J-Xrunjdwp:transport=dt_socket,suspend=n,server=n,address=58030 -J-Xmx2048m" prints the output in the console (w/o --console).

            People

            • Assignee:
              Jesse Glick
              Reporter:
              Honza Havlí&#269;ek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: