Need any sample project to integrate spring boot with atlaskit

Hi Experts,

I have created atlassian-connect -spring-bootapp and now I want to integrate atlaskit with my spring boot app. Any working sample code will help.

I checked with below sample code but it is not working

https://bitbucket.org/atlassian/atlassian-connect-spring-boot-samples/src/master/atlassian-connect-spring-boot-sample-atlaskit/

Getting error while building a project using maven.
Error:

INFO] Scanning for projects...
[INFO] 
[INFO] --< com.atlassian.connect:atlassian-connect-spring-boot-sample-atlaskit >--
[INFO] Building atlassian-connect-spring-boot-sample-atlaskit 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ atlassian-connect-spring-boot-sample-atlaskit ---
[INFO] Deleting E:\code\atlassian_spring\atlassian-atlassian-connect-spring-boot-samples\atlassian-connect-spring-boot-sample-atlaskit\target
[INFO] 
[INFO] --- exec-maven-plugin:1.5.0:exec (default) @ atlassian-connect-spring-boot-sample-atlaskit ---
[ERROR] Command execution failed.
java.io.IOException: Cannot run program "C:\Program Files\nodejs\npm" (in directory "E:\code\atlassian_spring\atlassian-atlassian-connect-spring-boot-samples\atlassian-connect-spring-boot-sample-atlaskit"): CreateProcess error=193, %1 is not a valid Win32 application
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:61)
	at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:279)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:336)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
	at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
	at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 30 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.454 s
[INFO] Finished at: 2019-10-09T23:51:31+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (default) on project atlassian-connect-spring-boot-sample-atlaskit: Command execution failed.: Cannot run program "C:\Program Files\nodejs\npm" (in directory "E:\code\atlassian_spring\atlassian-atlassian-connect-spring-boot-samples\atlassian-connect-spring-boot-sample-atlaskit"): CreateProcess error=193, %1 is not a valid Win32 application -> [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

The project is a bit out of date but it works for me. The error message sounds more like it’s a general NPM problem with your system.

Are able to run npm install and npm run build manually?

Yes I am able to run npm start and npm build

but maven - clean package is not working

Should I need to add or remove some code in this project?

Since you are able to run both npm commands manually that part is completely fine. It looks more like the problem here is on your machine as in that your maven is unable to run npm.

Are you maybe running maven from within a cygwin window or something like that?

I am using window. Kindly upload the working project that you have and steps to run it. I will try that.

Thanks!

So are you saying that you are using cygwin? If yes that is most likely the problem and you should try again with standard CMD or PowerShell.

I do not have an example project to upload and even if I had you would very likely experience the same error.

No I am not using cygwin. I am using window command prompt!

Coomand : mvn spring-boot:run -Drun.arguments="–addon.base-url=https://32368f33.ngrok.io"
Error:

E:\code\atlassian_spring\atlassian-atlassian-connect-spring-boot-samples\atlassian-connect-spring-boot-sample-atlaskit>mvn spring-boot:run -Drun.arguments="--addon.base-url=https://32368f33.
ngrok.io"
[INFO] Scanning for projects...
[INFO]
[INFO] --< com.atlassian.connect:atlassian-connect-spring-boot-sample-atlaskit >--
[INFO] Building atlassian-connect-spring-boot-sample-atlaskit 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) > test-compile @ atlassian-connect-spring-boot-sample-atlaskit >>>
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (default) @ atlassian-connect-spring-boot-sample-atlaskit ---
[ERROR] Command execution failed.
java.io.IOException: Cannot run program "C:\Program Files\nodejs\npm" (in directory "E:\code\atlassian_spring\atlassian-atlassian-connect-spring-boot-samples\atlassian-connect-spring-boot-sa
mple-atlaskit"): CreateProcess error=193, %1 is not a valid Win32 application
    at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
    at java.lang.Runtime.exec (Runtime.java:620)
    at org.apache.commons.exec.launcher.Java13CommandLauncher.exec (Java13CommandLauncher.java:61)
    at org.apache.commons.exec.DefaultExecutor.launch (DefaultExecutor.java:279)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:336)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:764)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:711)
    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:289)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions (MojoExecutor.java:355)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:200)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
    at java.lang.ProcessImpl.create (Native Method)
    at java.lang.ProcessImpl.<init> (ProcessImpl.java:386)
    at java.lang.ProcessImpl.start (ProcessImpl.java:137)
    at java.lang.ProcessBuilder.start (ProcessBuilder.java:1029)
    at java.lang.Runtime.exec (Runtime.java:620)
    at org.apache.commons.exec.launcher.Java13CommandLauncher.exec (Java13CommandLauncher.java:61)
    at org.apache.commons.exec.DefaultExecutor.launch (DefaultExecutor.java:279)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:336)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:764)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:711)
    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:289)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions (MojoExecutor.java:355)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:200)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)

Interesting. Have you tried the suggestion in this thread?

Tried still not working!

@acalantog , @danielwester , @epehrson and @biro any suggestion or sample code?
I am still stuck with the same issue.

@dchouksey89 the quickest workaround I can think of is to remove the NPM invocation from the Maven POM and instead create a simple shells script to invoke something like:

mvn clean
npm run build
mvn install

The problem you have encountered isn’t related to Atlassian tooling our APIs in any way, just a combination of Maven and Node.js on Windows.

2 Likes

Hi @epehrson,

It is still not working. I tired these stepes

Step 1. Remove npm invocation code from pox.xml file
Step 2. mvn clean
Step 3. npm run build
Step 4. mvn intsall
Step 5. mvn spring-boot:run

Still, it is loading normal html “Button creating using the reduced-ui-pack” not button from Atlaskit.

@dchouksey89 pull the latest commit from master in atlassian-connect-spring-boot-samples and try again. The AtlasKit dependencies had a wildcard version, and the latest versions probably require a newer version of React or something.