How run tests on Heroku with Maven - java

How do I run tests on Java Maven app on Heroku. I am using autodeploy linked to a branch on Github.
The default Maven command run on Heroku is:
mvn -DskipTests clean dependency:list install
To remove the skipTests, I set the MAVEN_CUSTOM_OPTS as described on https://github.com/heroku/heroku-buildpack-java#customize-maven.
However this does not result on the tests to be run. Looking at the build log I can see:
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (java-test-compile) # myapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M1:test (default-test) # myapp ---
[INFO] No tests to run.
Compared to running Maven locally, I can see:
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (java-test-compile) # myapp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 65 source files to ...
So it would seem there is an issue with Heroku ignoring my test resources and code.

the Heroku deployment only builds and deploys your application into a Dyno.
If you need a CI environment there's Heroku CI (not free) or you can use the Azure GitHub pipelines (free for GitHub projects)
Beppe

Related

maven release plugin fails second time on gitlab

I setup a pipeline on gitlab but I get a weird error "You don't have a SNAPSHOT project in the reactor projects list"
I'm just trying to deploy a java spring boot.
Below the pom.xml (only what's relevant)
<name>Project Phoenix - Base</name>
<groupId>com.gfs</groupId>
<artifactId>phoenix</artifactId>
<version>1.12-SNAPSHOT</version>
<packaging>pom</packaging>
...
<scm>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<url>git#gitlab.com:"myuser"/phoenix.git</url>
<tag>HEAD</tag>
</scm>
....
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven.release.plugin}</version>
<configuration>
<scmDevelopmentCommitComment>#{prefix} prepare for next development iteration [skip ci]</scmDevelopmentCommitComment>
</configuration>
</plugin>
My gitlab-ci.yml looks like this:
workflow:
rules:
- if: $CI_COMMIT_TAG
when: never
- if: $CI_COMMIT_BRANCH == 'master'
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
MAVEN_CLI_OPTS: "-s settings.xml --batch-mode --errors --fail-at-end --show-version"
MAVEN_IMAGE: maven:3.8.5-openjdk-17-slim
services:
- docker:dind
stages:
- build
- release
cache:
paths:
- .m2/repository/
- target/
build-job:
image: $MAVEN_IMAGE
stage: build
script:
- echo "Building $MODULE"
- mvn clean package -B $MAVEN_CLI_OPTS
release-job:
image: $MAVEN_IMAGE
stage: release
tags:
- local-runner
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- apt-get update -qq
- apt-get install -qq git
- git config --global user.email "hidden"
- git config --global user.name "hidden"
- git checkout -B "$CI_COMMIT_REF_NAME"
script:
- echo "Creating the release"
- mvn $MAVEN_CLI_OPTS clean deploy release:prepare release:perform
only:
- master
After I push, gitlab starts a pipeline on the commit which is successful and it deploys in the gitlab package registry the snapshot and the release.
However, there are other 2 pipeline starting
[maven-release-plugin] which it seems it does the same things but it fails:
First it says:
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Then it says: You don't have a SNAPSHOT project in the reactor projects list
$ git checkout -B "$CI_COMMIT_REF_NAME"
Switched to and reset branch 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
$ echo "Creating the release"
Creating the release
$ mvn $MAVEN_CLI_OPTS clean deploy release:prepare release:perform
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/share/maven
Java version: 17.0.2, vendor: Oracle Corporation, runtime: /usr/local/openjdk-17
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.10.104-linuxkit", arch: "aarch64", family: "unix"
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.gfs:phoenix >---------------------------
[INFO] Building Project Phoenix - Base 1.11
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # phoenix ---
[INFO] Deleting /builds/gfalco77/phoenix/target
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.8:prepare-agent (default) # phoenix ---
[INFO] argLine set to -javaagent:/builds/gfalco77/phoenix/.m2/repository/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar=destfile=/builds/gfalco77/phoenix/target/jacoco.exec
[INFO]
[INFO] --- spring-boot-maven-plugin:2.6.7:repackage (repackage) # phoenix ---
[INFO]
[INFO] --- maven-failsafe-plugin:3.0.0-M6:integration-test (default) # phoenix ---
[INFO] No tests to run.
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.8:report (report) # phoenix ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO]
[INFO] --- maven-failsafe-plugin:3.0.0-M6:verify (default) # phoenix ---
[INFO] Failsafe report directory: /builds/gfalco77/phoenix/target/failsafe-reports
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # phoenix ---
[INFO] Installing /builds/gfalco77/phoenix/pom.xml to /builds/gfalco77/phoenix/.m2/repository/com/gfs/phoenix/1.11/phoenix-1.11.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) # phoenix ---
[INFO] Uploading to gitlab-maven: https://gitlab.com/api/v4/projects/36116501/packages/maven/com/gfs/phoenix/1.11/phoenix-1.11.pom
[INFO] Uploaded to gitlab-maven: https://gitlab.com/api/v4/projects/36116501/packages/maven/com/gfs/phoenix/1.11/phoenix-1.11.pom (6.5 kB at 2.2 kB/s)
[INFO] Downloading from gitlab-maven: https://gitlab.com/api/v4/projects/36116501/packages/maven/com/gfs/phoenix/maven-metadata.xml
[INFO] Downloaded from gitlab-maven: https://gitlab.com/api/v4/projects/36116501/packages/maven/com/gfs/phoenix/maven-metadata.xml (361 B at 334 B/s)
[INFO] Uploading to gitlab-maven: https://gitlab.com/api/v4/projects/36116501/packages/maven/com/gfs/phoenix/maven-metadata.xml
[INFO] Uploaded to gitlab-maven: https://gitlab.com/api/v4/projects/36116501/packages/maven/com/gfs/phoenix/maven-metadata.xml (361 B at 111 B/s)
[INFO]
[INFO] --------------------------< com.gfs:phoenix >---------------------------
[INFO] Building Project Phoenix - Base 1.11
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-release-plugin:3.0.0-M5:prepare (default-cli) # phoenix ---
[INFO] phase verify-release-configuration
[INFO] starting prepare goal, composed of 17 phases: check-poms, scm-check-modifications, check-dependency-snapshots, create-backup-poms, map-release-versions, input-variables, map-development-versions, rewrite-poms-for-release, generate-release-poms, run-preparation-goals, scm-commit-release, scm-tag, rewrite-poms-for-development, remove-release-poms, run-completion-goals, scm-commit-development, end-release
[INFO] [prepare] 1/17 check-poms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.246 s
[INFO] Finished at: 2022-07-13T16:57:18Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M5:prepare (default-cli) on project phoenix: You don't have a SNAPSHOT project in the reactor projects list. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:3.0.0-M5:prepare (default-cli) on project phoenix: You don't have a SNAPSHOT project in the reactor projects list.
The third and last pipeline is
[maven-release-plugin] prepare for next development iteration [skip ci] which is Skipped..
Does anybody know what it should happen, why does it complain on the snapshot?
Thanks
Basically, if not that error you would run in infinite loop :) The release:prepare performs the following steps:
Check that there are no uncommitted changes in the sources
Check that there are no SNAPSHOT dependencies
Change the version in the POMs from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
Transform the SCM information in the POM to include the final destination of the tag
Run the project tests (preparation goals) against the modified POMs to confirm everything is in working order
Commit the modified POMs
Tag the code in the SCM with a version name (this will be prompted for)
Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
Eventually run completion goal(s) against the project (since 2.2)
Commit the modified POMs
So, upon completion of your CI pipeline you are getting two new commits into master branch:
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release XXX
which in turn triggers your CI pipeline again, you just need to disable pipeline triggering for specific CI_COMMIT_MESSAGE (or setup scmReleaseCommitComment, which actually looks not so good as well as scmDevelopmentCommitComment)
UPD.
I have revised your release pipeline I can definitely say everything you are doing is wrong. The main problem is you are trying to implement release pipeline relying on suggestions from internet (e.g. what you have provided looks very similar to https://forum.gitlab.com/t/getting-mvn-release-to-work-with-gitlab-ci/4904) instead of basing on best practices and common sense...
what is the purpose of the following code snippet?
stages:
- build
- release
...
build-job:
image: $MAVEN_IMAGE
stage: build
script:
- echo "Building $MODULE"
- mvn clean package -B $MAVEN_CLI_OPTS
...
release-job:
stage: release
...
script:
- echo "Creating the release"
- mvn $MAVEN_CLI_OPTS clean deploy release:prepare release:perform
mvn package performs compile, test and package
mvn deploy performs compile, test, package, verify and deploy
release:prepare by default performs mvn clean verify
so, in your release pipeline you perform compile and test three times, and verify two times, which actually sounds good for your SaaS provider: more resources you consume - more money you spend.
following code snippet:
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- apt-get update -qq
- apt-get install -qq git
- git config --global user.email "hidden"
- git config --global user.name "hidden"
actually assumes you supposed to create your own docker images which contains jdk, maven, ssh, git and other toolchain stuff.
following code snippet:
before_script:
...
- git checkout -B "$CI_COMMIT_REF_NAME"
reveals that Gitlab is neither CI nor CD, the question is: what commit your release is based on? The answer is: on something after my commit :)

Problem with Maven plugin :maven-enforcer-plugin:3.0.0-M3:enforce Some Enforcer rules have failed

A little bit of context:
Im working as a FE developer for an AEM project. The project is a SPA AEM as cloud service. I am running the author instance from the command line.
My pc specs are:
CPU: Intel(R) Core(TM) i5-7400 CPU # 3.00GHz 3.00 GHz
RAM: 24.0 GB
SSD: 476 GB
OS: Windows 10 Pro
For the AEM Project we are using
Java sdk 11
Maven 3.6.3
I have already set up everything, the path variables, JAVA_HOME, mvn. All of them work fine, even trying to build other type of projects with "older" versions of AEM like 6.5 build perfectly. I don't have a problem with them. But with this version of AEM I am getting this error
[WARNING] Rule 9: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/renders/default_renders.any
[WARNING] Rule 10: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/virtualhosts/default_virtualhosts.any
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for xxxxxx 1.0.0-SNAPSHOT:
[INFO]
[INFO] xxxxxx ................................. SUCCESS [ 0.270 s]
[INFO] xxxxxx - Core .......................... SUCCESS [ 59.232 s]
[INFO] xxxxxx - UI Frontend ................... SUCCESS [ 19.876 s]
[INFO] xxxxxx - UI Frontend React ............. SUCCESS [ 39.613 s]
[INFO] xxxxxx - Repository Structure Package .. SUCCESS [ 0.991 s]
[INFO] xxxxxx - UI apps ....................... SUCCESS [ 12.990 s]
[INFO] xxxxxx - UI content .................... SUCCESS [ 4.178 s]
[INFO] xxxxxx - UI config ..................... SUCCESS [ 0.314 s]
[INFO] xxxxxx - All ........................... SUCCESS [ 1.052 s]
[INFO] xxxxxx - Integration Tests ............. SUCCESS [ 12.166 s]
[INFO] xxxxxx - Dispatcher .................... FAILURE [ 0.030 s]
[INFO] xxxxxx - UI Tests ...................... SKIPPED
[INFO] xxxxxx - Project Analyser .............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:34 min
[INFO] Finished at: 2021-08-22T15:11:20-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-checksum-of-immutable-files) on project xxxxxxx.dispatcher.cloud: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :xxxxxx.dispatcher.cloud
I've been searching in sites, some of the answers for this problem haven't work for me.
I tried to run everything from the "gitbash"
command line and I had the same problem.
I tried to change the version in the pom.xml, didnt work.
I tried to build the project using eclipse IDE and all the build-in tools, I get an error that org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce is missing
Disable firewall and antivirus, nope
Use other versions of maven like 3.8.2
Delete the .m2 directory and download again all the plugins, not working
One of many answers tell me to comment out the dispatcher module in the pom.xml and after I did that builds fine. Other is doing the same and upload the ui.apps/target/*.zip with the crx package manager I did it but im not sure if the result is the "best".
To end, I installed the same project in a Mac Pro and i did without a problem. I hope someone can help me with this. Thanks for reading.
[WARNING] Rule 9: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/renders/default_renders.any
The Maven Enforcer Plugin is checking for some files to have an specific checksum using requireFileChecksum rule
Somewhere in your pom.xml the Enforcer Maven plugin should be declared, so you will be able to see the rule and the hash it is applying. This xml snippet is from the maven plugin documentation.
<requireTextFileChecksum>
<file>E:\java-workspace\apache-maven-enforcer\maven-enforcer\target\checkout\enforcer-rules\target\classes/foo.txt</file>
<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
<type>md5</type>
</requireTextFileChecksum>
Check that hash against the hash of the file of your filesystem. Maybe when you change aem version, you need to upgrade some of those files.
As discussed here: https://github.com/adobe/aem-guides-wknd/pull/202
Adobe have reported the issue and the fix to Adobe AEM WKND project:
Some Windows users experience a Maven enforcer issue where it appears that default dispatcher files have been modified. Unclear if this is a result of differences between Mac and Windows or something that occurs during the checkout process. Most users simply want to install the code base to a local environment and this check is unnecessary. Removing the enforcement for windows builds.
so you can :
Skips Dispatcher enforcement plugin for users on windows environments.
doing a change you dispatcher/pom.xml
with the commit reported here:
https://github.com/adobe/aem-guides-wknd/pull/202/commits/bebcf5d2236c75a95055d5ff71ea58f66379f271
replacing the line:
<goal>enforce</goal>
with:
<goal>display-info</goal>

How do I suppress some Maven logs but keep other output?

I'm running Maven in a CI environment and want to see some of its log output - but I don't want to see routine messages about downloading artifacts etc.
I can use -q but that suppresses everything useful too.
Maven uses slf4j and by default uses the slf4j-simple backend so there's no logging.properties etc, and anyway how would I even find out which class generates the log messages?
e.g. if I have
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] XXX JDBC Driver - JDBC 4.2 [bundle]
[INFO] XXX JDBC Driver aggregate [pom]
[INFO]
[INFO] -----------------< XXX:XXX >------------------
[INFO] Building XXX JDBC Driver - JDBC 4.2 XXXX [1/2]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # XXXX-jdbc ---
[INFO] Deleting XXXX/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-java) # XXX-jdbc ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.5:parse-version (parse-version) # XXXX-jdbc ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (default) # XXXX-jdbc ---
[WARNING] Ignoring missing properties file: XXX/build.local.properties
[INFO]
[INFO] --- jcp:6.0.1:preprocess (preprocessSources) # XXX-jdbc ---
[INFO] Added MAVEN property mvn.project.name=XXX JDBC Driver - JDBC 4.2
[INFO] Added MAVEN property mvn.project.version=XX.YY.ZZ
.... blah blah blah ...
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running XXX.TestSuite
Tests run: 58, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 6.43 sec
and for this task I just want the test output, how do I do that?
Maven uses slf4j-simple. Its configuration is loaded from the classpath in a file simplelogger.properties. You can modify the classpath to put your own copy of this file first, but you can also override these properties by setting system properties.
First re-run your build with -D-Dorg.slf4j.simpleLogger.showLogName=true so you can see which classes the logs are coming from. Then adjust log levels as desired by setting additional properties named -Dorg.slf4.simpleLogger.log.[[classname]]=[[level]].
You may require the -B (batch) flag too.
I find it convenient to set these in a .mvn/maven.config file in my project, but you can use MAVEN_OPTS or the command line instead. An example .mvn/maven.config might be:
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-Dorg.slf4j.simpleLogger.log.com.igormaznitsa.jcp.maven.PreprocessorMojo=warn
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.event.ExecutionEventLogger=warn
-Dorg.slf4j.simpleLogger.log.org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering=warn
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugin.clean.CleanMojo=warn
-Dorg.slf4j.simpleLogger.showLogName=true
Note that putting these options in a simplelogging.properties of the project being compiled will not work, it must be in the classpath of the maven runtime.
Also beware that .mvn/maven.config doesn't appear to support comments. I tried #, ;, //, /* .. */.

Why my maven package triggered by Jenkins failed but can be success if I manually execute it?

I have a jenkins job which tend to build my java application using maven, but it always gets failure during the compile phase.
[[1;34mINFO[m] Changes detected - recompiling the module!
[[1;34mINFO[m] Compiling 550 source files to /var/lib/jenkins/workspace/test/target/classes
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] [1;31mBUILD FAILURE[m
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] Total time: 9.575 s
[[1;34mINFO[m] Finished at: 2017-12-02T07:47:47+08:00
[[1;34mINFO[m] Final Memory: 24M/346M
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;33mWARNING[m] The requested profile "nexus" could not be activated because it does not exist.
[[1;31mERROR[m] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.1:compile[m [1m(default-compile)[m on project [36mtest[m: [1;31mCompilation failure[m -> [1m[Help 1][m
[[1;31mERROR[m]
I find and copied the below command in the Jenkins job's console output(on the webpage).
/opt/apache-maven-3.5.0/bin/mvn -f pom.xml -s /var/lib/jenkins/test-maven-setting/setting.xml -gs /var/lib/jenkins/test-maven-setting/setting.xml -Dmaven.repo.local=/var/lib/jenkins/workspace/test/.repository clean package
Then I switched to the jenkins user in the Linux console and go to the job's workspace directory and tried to manually execute the above commands I copied.
but it success!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.994 s
[INFO] Finished at: 2017-12-02T07:50:17+08:00
[INFO] Final Memory: 35M/298M
so it's very strange, same commands, same user, same directory, but it can success when I execute it manually while fail when Jenkins build the job. Does anyone know what's the problem that Jenkins job failed?
here I retested the maven plugin and pasted some screenshots.
You as using "use default maven settings" option in invoke-maven-targets.
select option for "settings file in filesystem" for both default and global

client-side breakpoints for GWT maven project work in Eclipse but not Netbeans

I've been trying in Netbeans to break into the client-side code for a project built with gwt-maven-plugin 2.7.0.
My dev environment: win7 64bits, java 7.0.60, netbeans 8.01
I build the bare-bones project with the gwt-maven-plugin artifact, do a maven clean install, then a gwt:debug, everything (devmode/jetty) starts up correctly (no visible error), I can break into the server-side code, but as far as the client-side breakpoints are concerned, it will only work if I use Eclipse + Google plugin...no luck with netbeans.
Any idea what is wrong ?
For your reference, please find below the output of my gwt:debug in Netbeans.
Thank you very much in advance for your feedback and your expertise.
Regards
kb
cd C:\DN\MyApp; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_60" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0.1\\java\\maven\\bin\\mvn.bat\" -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.0.1\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 gwt:debug\""
Scanning for projects...
------------------------------------------------------------------------
Building GWT Maven Archetype 1.0-SNAPSHOT
------------------------------------------------------------------------
>>> gwt-maven-plugin:2.7.0:debug (default-cli) # MyApp >>>
--- gwt-maven-plugin:2.7.0:generateAsync (default) # MyApp ---
--- maven-resources-plugin:2.5:resources (default-resources) # MyApp ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 2 resources
--- maven-compiler-plugin:2.3.2:compile (default-compile) # MyApp ---
Nothing to compile - all classes are up to date
<<< gwt-maven-plugin:2.7.0:debug (default-cli) # MyApp <<<
--- gwt-maven-plugin:2.7.0:debug (default-cli) # MyApp ---
starting debugger on port 8000 in suspend mode
create exploded Jetty webapp in C:\DN\MyApp\target\MyApp-1.0-SNAPSHOT
Listening for transport dt_socket at address: 8000
Super Dev Mode starting up
workDir: C:\Users\myname\AppData\Local\Temp\gwt-codeserver-6759665201993273993.tmp
Loading Java files in com.mycompany.myapp.MyApp.
Module setup completed in 4879 ms
The code server is ready at http://127.0.0.1:9876/
GET /recompile/MyApp
Job com.mycompany.myapp.MyApp_1_0
starting job: com.mycompany.myapp.MyApp_1_0
binding: user.agent=safari
Compiling module com.mycompany.myapp.MyApp
Unification traversed 16789 fields and methods and 1580 types. 1548 are considered part of the current module and 1548 had all of their fields and methods traversed.
Compiling 1 permutation
Compiling permutation 0...
Linking per-type JS with 1532 new types.
prelink JS size = 2512880
prelink sourcemap = 2512880 bytes and 73220 lines
postlink JS size = 2384562
postlink sourcemap = 2384562 bytes and 69785 lines
Source Maps Enabled
Compile of permutations succeeded
Compilation succeeded -- 7.911s
Linking into C:\Users\myname\AppData\Local\Temp\gwt-codeserver-6759665201993273993.tmp\com.mycompany.myapp.MyApp\compile-2\war\MyApp; Writing extras to C:\Users\myname\AppData\Local\Temp\gwt-codeserver-6759665201993273993.tmp\com.mycompany.myapp.MyApp\compile-2\extras\MyApp
Link succeeded
Linking succeeded -- 0.824s
8.817s total -- Compile completed
GWT 2.7's DevMode defaults to using SuperDevMode (as you can see in your logs), rather than "classic DevMode" with the browser plugin.
With SuperDevMode you debug client-side code in your browser using source maps, or in your IDE by remote-debugging your browser (in Eclipse using SDBG for example).
To roll back to "classic DevMode", configure your gwt-maven-plugin with <superDevMode>false</superDevMode> or pass -Dgwt.superDevMode=false to Maven.
See http://mojo.codehaus.org/gwt-maven-plugin/debug-mojo.html#superDevMode

Categories