build (mvn install) of new application takes forever - vaadin

I was trying to use an existing application as starting point for a new one.
So, I copied over the src-folder, the pom and a couple of IDE-specific files config files.
I then refactored all giving it a new path and application name and then I wanted to do a first build and entered mvn install.
This process is now hanging since 1 1/2 hours in vaadin-maven-plugin:18.0.2:build-frontend (see full console output below).
Is this expected or why is this taking so long? Can I somehow figure out, why and where this is hanging?
What am I missing? Are there any files other then those mentioned that absolutely MUST exist before a new Vaadin application can (even be tried to) be built?
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< ch.zh.ksta.monitoring:my_app >---------------
[INFO] Building KStA-ZH-Monitoring 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # my_app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # my_app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- vaadin-maven-plugin:18.0.2:prepare-frontend (default) # my_app ---
[INFO] writing file D:\Projects\my_app\target\flow-frontend\package.json.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\form\package.json.
[INFO] writing file 'D:\Projects\my_app\target\index.html'
[INFO] writing file 'D:\Projects\my_app\target\index.ts'
[INFO] Copying frontend resources from jar files ...
[INFO] Visited 173 resources. Took 2229 ms.
[INFO]
[INFO] --- vaadin-maven-plugin:18.0.2:build-frontend (default) # my_app ---
[INFO] Scanning classes to find frontend configurations and dependencies...
[INFO] Visited 720 classes. Took 2553 ms.
[INFO] Visited 126 classes. Took 138 ms.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\package.json.
[INFO] writing file D:\Projects\my_app\target\flow-frontend\form\package.json.
[INFO] writing file 'D:\Projects\my_app\target\index.html'
[INFO] writing file 'D:\Projects\my_app\target\index.ts'
[INFO] Parsing java files from [D:\Projects\my_app\src\main\java]
[INFO] There are no connect endpoints to generate.
[INFO] Running `pnpm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
[INFO] Generated pnpmfile hook file: 'D:\Projects\my_app\pnpmfile.js'
[INFO] installing pnpm version 4.4.0 locally
[INFO] using 'C:\Users\mmo\.vaadin\node\node.exe C:\Users\mmo\.vaadin\node_modules\pnpm\bin\pnpm.js' for frontend package installation
Later addition:
If I terminate this using ^C I get:
...
2021-05-31 18:24:40,199 ERROR [task-1] com.vaadin.flow.server.frontend.TaskRunNpmInstall: Command `C:\Program Files\nodejs\node.exe C:\Users\mmo\.vaadin\node_modules\pnpm\bin\pnpm.js --shamefully-hoist=true install` failed:
Using hooks from: D:\Projects\my_app\pnpmfile.jsreadPackage hook is declared. Manifests of dependencies might get overridden
2021-05-31 18:24:40,201 ERROR [task-1] com.vaadin.flow.server.frontend.TaskRunNpmInstall: >>> Dependency ERROR. Check that all required dependencies are deployed in pnpm repositories.
2021-05-31 18:24:40,205 DEBUG [task-1] com.vaadin.flow.server.startup.DevModeInitializer: Could not initialize dev mode handler. One of the node tasks failed
com.vaadin.flow.server.ExecutionFailedException: Pnpm install has exited with non zero status. Some dependencies are not installed. Check pnpm command output
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.runNpmInstall(TaskRunNpmInstall.java:405)
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.execute(TaskRunNpmInstall.java:120)
at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:634)
at com.vaadin.flow.server.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:471)
at com.vaadin.flow.server.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:381)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
If I restart the build again it will hang again.
Gee - is this brittle... :-(

Got this same error. I deleted from my home directory:
.vaadin
.pnpm-store
... and the generated stuff from my project:
webpack.config.js
tsconfig.json
types.d.ts
webpack.config.js
webpack.generated.js
pnpm-lock.yaml
pnpmfile.js
package.json
.npmrc
target
.pnpm-debug.log
... probably overkill, but then it worked again.

Related

jenkins: Exception when publishing, exception message [Permission denied]

when I bulid a project by using the plugin 'publish over ssh', jenkins shows me the error:
[INFO] Packaging webapp
[INFO] Assembling webapp [bc-ctq] in [/var/lib/jenkins/workspace/bc-
ctq/target/bc-ctq]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/jenkins/workspace/bc- ctq/src/main/webapp]
[INFO] Webapp assembled in [140 msecs]
[INFO] Building war: /var/lib/jenkins/workspace/bc-ctq/target/bc-ctq.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.018 s
[INFO] Finished at: 2018-10-26T19:38:10+08:00
[INFO] ------------------------------------------------------------------------
SSH: Connecting from host [localhost.localdomain]
SSH: Connecting with configuration [love] ...
SSH: Disconnecting configuration [love] ...
ERROR: Exception when publishing, exception message [Permission denied]
Archiving artifacts
Finished: UNSTABLE
Send files or execute commands over SSH after the build runs
the ssh server config
I was facing similar error and it turned out to be ownership issue. The owner of your project folder should be same as the one Jenkins uses to remote SSH into your instance.
Check ownership of your folder by running ls -ltr in your parent directory.
Change ownership using sudo chown -R owner:group DirectoryName/
Check verbose output and start build, then you'll see where is the problem

BUILD FAILURE Error: when executing "mvn clean package" command

I'm using following version.
maven: 3.3.9
jdk: java-7-openjdk-amd64
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/"
I'm getting packages type error when I'm running $ mvn clean package command. I'm new to use swagger to generate documentation(.yml file to .html)
ERROR:
enter code here[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java:21:5: Missing a Javadoc comment. [JavadocMethod]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java:28: Line is longer than 100 characters (found 233). [LineLength]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java:35:5: Missing a Javadoc comment. [JavadocMethod]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java:37:27: Local variable name 'b' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'. [LocalVariableName]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/auth/AuthParser.java:46:36: Catch parameter name 'e' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'. [CatchParameterName]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/config/ConfigParser.java:10: Import statement for 'org.slf4j.Logger' is in the wrong order. Should be in the 'THIRD_PARTY_PACKAGE' group, expecting not assigned imports on this line. [CustomImportOrder]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/config/ConfigParser.java:11: Import statement for 'org.slf4j.LoggerFactory' is in the wrong order. Should be in the 'THIRD_PARTY_PACKAGE' group, expecting not assigned imports on this line. [CustomImportOrder]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/config/ConfigParser.java:17:5: Missing a Javadoc comment. [JavadocMethod]
[WARN] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/config/ConfigParser.java:38:28: Catch parameter name 'e' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'. [CatchParameterName]
Audit done.
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) # swagger-codegen ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-versions) # swagger-codegen ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # swagger-codegen ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1563 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # swagger-codegen ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 147 source files to /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java:[17,32] package org.codehaus.plexus.util does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] swagger-codegen-project ............................ SUCCESS [ 2.958 s]
[INFO] swagger-codegen (core library) ..................... FAILURE [ 11.114 s]
[INFO] swagger-codegen (executable) ....................... SKIPPED
[INFO] swagger-codegen (maven-plugin) ..................... SKIPPED
[INFO] swagger-generator .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.646 s
[INFO] Finished at: 2017-08-16T15:36:08+05:00
[INFO] Final Memory: 39M/553M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project swagger-codegen: Compilation failure
[ERROR] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java:[17,32] package org.codehaus.plexus.util does not exist
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :swagger-codegen
I've also run debugging mode by running mvn clean package -X, but nothing getting in mind please any one look into it save my life.
Based on the following line:
[ERROR] /var/www/html/cg-api-dev-portal/codegen/swagger-codegen/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/XmlExampleGenerator.java:[17,32] package org.codehaus.plexus.util does not exist
Looks like you're not using the latest master, which has the following line instead:
16 import io.swagger.models.properties.AbstractNumericProperty;
17 import io.swagger.models.properties.PasswordProperty;
18 import io.swagger.models.properties.UUIDProperty;
Please clone from the latest master.
You can also use the SNAPSHOT version without building the project manually:
https://github.com/swagger-api/swagger-codegen#compatibility

Why does a Maven 3 multi-module project fail on "clean package", and succeed on "clean compile" followed by "package"?

This is similar to the asked and answered question Maven test dependency on multi module project. However, this has nothing to do with the test phase, instead I'm having problems with package.
I have a multi-module project something like:
root
|
|-parent-client
| |
| |-client-1
| |
| \-client-2
|
\-parent-server
|
|-server-1
|
|-server-2
|
|-server-3
|
\-server-4
My dependencies are client-1 -> client-2 -> server-1 -> server-2 -> server-3 -> server-4, which is to say that client-2 depends on server-1, server-1 depends on server-2, and so on. Each is scoped to compile.
So the problem is that when I run mvn clean package in the root, I get a compilation failure in server-2 that package server-3 does not exist.
When I run mvn clean compile followed by mvn package in the root, it runs through without issue.
It always fails at the same module when it fails.
My understanding of the Build Lifecycle is that compile package is redundant since package includes the compile lifecycle.
The project is more complex, with a total of 41 modules, two parents and one root. Creating a simple example inevitably works as expected.
I'm stumped as to how I should proceed.
Update 2015-10-25
Turns out I was wrong about the order of commands for success. I've updated my question and the description, and included debug output per Michael-O's request:
<snip/>
[INFO] --- maven-ejb-plugin:2.3:ejb (default-ejb) # terradatum-systemconfig ---
[INFO] Building EJB terradatum-systemconfig-4.8.1-SNAPSHOT with EJB version 3.0
[INFO] Building jar: /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/systemconfig/ejb/target/terradatum-systemconfig-4.8.1-SNAPSHOT.jar
[INFO] Building EJB client terradatum-systemconfig-4.8.1-SNAPSHOT-client
[INFO] Building jar: /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/systemconfig/ejb/target/terradatum-systemconfig-4.8.1-SNAPSHOT-client.jar
<snip/>
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building terradatum-payment 4.8.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # terradatum-payment ---
[INFO] Deleting /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # terradatum-payment ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # terradatum-payment ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rbellamy/Development/Terradatum/metrics-project/metrics-server/payment/ejb/src/main/java/com/terradatum/common/payment/PaymentRemoteDelegate.java:[13,42] package com.terradatum.common.systemconfig does not exist
<snip/>
Update 2015-11-16
After much refactoring the build no longer fails in the same place. I've seen it fail in a similar way, consistently, but the location of the failure moves around. I am not running multiple threads, but it seems very clear to me there's a race somewhere in which an obviously available package (absolutely located and reachable in my ~/.m2/repository local cache, and added to the classpath) is not visible to the Maven compiler.
And knowing what I know about race conditions, I have no idea how I would file a bug report of any substance given I can't offer anything more than supposition and finger pointing.

Error building carbon component

I have been doing http://wso2.com/library/tutorials/2014/03/how-to-write-a-wso2-carbon-component/ but when I create client using wsdl file I got this error. How can I solve this issue.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WSO2 Carbon - Student Manager Stub 4.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:add-source (add-source) # org.wso2.carbon.student.mgt.stub ---
[INFO] Source directory: /home/jobs/wso2/Carbon/Old/org.wso2.carbon.student.mgt.stub/target/generated-code/src added.
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # org.wso2.carbon.student.mgt.stub ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-antrun-plugin:1.1:run (source-code-generation) # org.wso2.carbon.student.mgt.stub ---
[INFO] Executing tasks
[java] Retrieving document at 'src/main/resources/StudentManager.wsdl'.
[java] Dec 05, 2014 1:05:42 AM org.apache.axis2.schema.SchemaCompiler compile
[java] WARNING: No schemaLocation for import of http://data.mgt.student.carbon.wso2.org/xsd; compilation may fail
[INFO] Executed tasks
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # org.wso2.carbon.student.mgt.stub ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 8 source files to /home/jobs/wso2/Carbon/Old/org.wso2.carbon.student.mgt.stub/target/classes
Actually what is this warning means? This where what I cant understand ..
[java] WARNING: No schemaLocation for import of http://data.mgt.student.carbon.wso2.org/xsd; compilation may fail
It looks like domain class has not been updated in ../data/xsd directory in the target code. I suspect that the backend component has been updated and the wsdl has been altered, but the stub has not been updated/created yet. Therefore the client side component doesn't aware of the modifications. I suggest that you may update the wsdl file in stub resources and rebuilding the stub and client should probably solve the issue.

DeploySourceNotFoundException on CloudBees

I'am trying to deploy a war with jenkins of CloudBees. Sources are located on the Git repository of CloudBbees.
I can generate an deploy the war with the same sources code on my environment.
On the Jenkins of Cloudbees, the build is successful, but I got the following error at the deployment :
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # mysite ---
[INFO] Deleting /scratch/jenkins/workspace/Deploy/target
[INFO]
[INFO] --- lutece-maven-plugin:3.0.2:site-assembly (default-cli) # mysite ---
[INFO] Assembly-site lutece-site artifact...
[INFO] Exploding webapp in /scratch/jenkins/workspace/Deploy/target/mysite-1.0.0-SNAPSHOT...
[INFO] Copying webapp files
[INFO] Local configuration directory is /home/jenkins/lutece/conf/mysite
[WARNING] Local configuration directory /home/jenkins/lutece/conf/mysite does not exist
[INFO] Building jar: /scratch/jenkins/workspace/Deploy/target/mysite.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.993s
[INFO] Finished at: Sat Mar 08 04:26:07 EST 2014
[INFO] Final Memory: 16M/202M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /scratch/jenkins/workspace/Deploy/pom.xml to fr.paris.lutece/mysite/1.0.0-SNAPSHOT/mysite-1.0.0-SNAPSHOT.pom
channel stopped
[cloudbees-deployer] Deploying as (jenkins) to the xxxx-xxxx account
[cloudbees-deployer] Deploying mysite
com.cloudbees.plugins.deployer.exceptions.DeploySourceNotFoundException: Cannot find source for mysite
at com.cloudbees.plugins.deployer.engines.Engine.perform(Engine.java:126)
at com.cloudbees.plugins.deployer.DeployPublisher.perform(DeployPublisher.java:103)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:795)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:716)
at hudson.model.Run.execute(Run.java:1690)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)
Build step 'Deploy applications' marked build as failure
Finished: FAILURE
The application ID mysite exists and is found in the Jenkins configuration.
What should I do ?
In the logs, I can't see the "archiving" phase of the .war file so I believe that your .war was not properly packaged. Did you define it properly in your pom.xml?
Also, check in your workspace/target if the .war was generated.

Resources