1

I downloaded the che plugin project example che-ide-server-extension. It works when mvn clean install. But when I add a dependency in

che-ide-server-extension/plugins/plugin-serverservice/plugin-serverservice-ide/pom.xml

, it fails to install.

The dependency I added is

<dependency>
    <groupId>org.eclipse.che.core</groupId>
    <artifactId>che-core-ide-ui</artifactId>
</dependency>

And the error message of mvn clean install -e -X is:

...
[WARNING] Unused declared dependencies found:
[WARNING]    org.eclipse.che.core:che-core-ide-ui:jar:6.16.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Plugin ServerService :: Parent pom ................. SUCCESS [  2.174 s]
[INFO] Plugin ServerService :: Plugins ::  Parent ......... SUCCESS [  0.064 s]
[INFO] Plugin ServerService :: Plugin :: Parent ........... SUCCESS [  1.382 s]
[INFO] Plugin ServerService :: Plugin :: Server ........... SUCCESS [  3.827 s]
[INFO] Plugin ServerService :: Plugin :: IDE .............. FAILURE [  4.870 s]
[INFO] Plugin ServerService :: Che Assembly :: Assembly Parent SKIPPED
[INFO] Plugin ServerService :: Che Assembly :: Workspace Agent Assembly SKIPPED
[INFO] Plugin ServerService :: Che Assembly :: Workspace Agent Tomcat Assembly SKIPPED
[INFO] Plugin ServerService :: Che Assembly :: IDE Assembly SKIPPED
[INFO] Plugin ServerService :: Che Assembly :: Assemblies Tomcat SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.925 s
[INFO] Finished at: 2019-07-10T10:48:43+08:00
[INFO] Final Memory: 75M/1321M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.0.1:analyze-only (analyze) on project plugin-serverservice-ide: Dependency problems found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.0.1:analyze-only (analyze) on project plugin-serverservice-ide: Dependency problems found
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    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:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Dependency problems found
    at org.apache.maven.plugins.dependency.analyze.AbstractAnalyzeMojo.execute(AbstractAnalyzeMojo.java:261)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
[ERROR] 
[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 <goals> -rf :plugin-serverservice-ide

I don't think I added a wrong dependency. Because when I

import org.eclipse.che.ide.ui.dialogs.DialogFactory;

in my java code, che says

The import org.eclipse.che.ide.ui.dialogs cannot be resolved.

But after I added the dependency, che can recognize it.

I don't know why this happens... The error message says Dependency problems found, but it didn't point out the real problem...

Oopssss
  • 65
  • 5

1 Answers1

0

I've just checked and I didn't face any issues you mentioned above. This my changes for the project:

diff --git a/plugins/plugin-serverservice/plugin-serverservice-ide/pom.xml b/plugins/plugin-serverservice/plugin-serverservice-ide/pom.xml
index 1237c6e..a5eed89 100644
--- a/plugins/plugin-serverservice/plugin-serverservice-ide/pom.xml
+++ b/plugins/plugin-serverservice/plugin-serverservice-ide/pom.xml
@@ -28,6 +28,10 @@
             <groupId>javax.inject</groupId>
             <artifactId>javax.inject</artifactId>
         </dependency>
+<dependency>
+    <groupId>org.eclipse.che.core</groupId>
+    <artifactId>che-core-ide-ui</artifactId>
+</dependency>
         <dependency>
             <groupId>org.eclipse.che.core</groupId>
             <artifactId>che-core-commons-gwt</artifactId>
diff --git a/plugins/plugin-serverservice/plugin-serverservice-ide/src/main/java/org/eclipse/che/sample/ide/MyServiceClient.java b/plugins/plugin-serverservice/plugin-serverservice-ide/src/main/java/org/eclipse/che/sample/ide/MyServiceClient.java
index cb1cf58..0def9c2 100644
--- a/plugins/plugin-serverservice/plugin-serverservice-ide/src/main/java/org/eclipse/che/sample/ide/MyServiceClient.java
+++ b/plugins/plugin-serverservice/plugin-serverservice-ide/src/main/java/org/eclipse/che/sample/ide/MyServiceClient.java
@@ -8,13 +8,15 @@
  */
 package org.eclipse.che.sample.ide;

-import javax.inject.Inject;
 import org.eclipse.che.api.promises.client.Promise;
 import org.eclipse.che.ide.api.app.AppContext;
 import org.eclipse.che.ide.rest.AsyncRequestFactory;
 import org.eclipse.che.ide.rest.StringUnmarshaller;
+import org.eclipse.che.ide.ui.dialogs.DialogFactory;
 import org.eclipse.che.ide.ui.loaders.request.LoaderFactory;

+import javax.inject.Inject;
+
 /**
  * Client for consuming the sample server service.
  *
@@ -25,6 +27,7 @@ public class MyServiceClient {
   private AppContext appContext;
   private AsyncRequestFactory asyncRequestFactory;
   private LoaderFactory loaderFactory;
+  private DialogFactory dialogFactory;

   /**
    * Constructor.
@@ -38,8 +41,10 @@ public class MyServiceClient {
   public MyServiceClient(
       final AppContext appContext,
       final AsyncRequestFactory asyncRequestFactory,
-      final LoaderFactory loaderFactory) {
+      final LoaderFactory loaderFactory,
+      final DialogFactory dialogFactory) {

+    this.dialogFactory = dialogFactory;
     this.appContext = appContext;
     this.asyncRequestFactory = asyncRequestFactory;
     this.loaderFactory = loaderFactory;
@@ -52,6 +57,7 @@ public class MyServiceClient {
    * @return a Promise containing the server response
    */
   public Promise<String> getHello(String name) {
+    this.dialogFactory.createChoiceDialog("1", "2", "", "", null, null);
     return asyncRequestFactory
         .createGetRequest(appContext.getWsAgentServerApiEndpoint() + "/hello/" + name)
         .loader(loaderFactory.newLoader("Waiting for hello..."))
tolusha
  • 99
  • 3
  • btw I `git checkout 6.16.0` after `git clone https://github.com/che-samples/che-ide-server-extension`. (I have to use 6.16.0 version. Sorry for forgetting to say that). And then I edit the pom.xml. And finally `mvn clean install`. – Oopssss Jul 10 '19 at 11:44