Wednesday, October 16, 2024

Re: Error : No project found - Running GWT in client mode only

I am trying to set up a project where I want to use the GWT app on the client side only that is going to interact with another remote server.

Which server is going to host the GWT compiled JavaScript / HTML / ...?
1. If you'll have your own server, just leave the architecture as is, and write your calls to the external server in the the client.
2. If you need to host it on the external server, again, just leave the  architecture as is, as you can just copy the compiled GWT code across when you are ready to deploy.  But, if this is the situation, it's a bit crazy to not just make the external server a GWT app.

On Tuesday 15 October 2024 at 4:54:10 am UTC+11 Mukeya Kassindye wrote:
I am trying to set up a project where I want to use the GWT app on the client side only that is going to interact with another remote server.
However, before I implement the CORS option, I just want to run the client only part by eliminating all the server side code and deleting their corresponding module.
The GWT project is generated with the Tbroyer archetypes modular web-app.
This is what I did so far :
- copied the webapp folder from the web-project-server/src/main to web-project-client/src/main
- deleted the web-project-server and web-project-shared folders.
- updated the web-project-client's packaging from gwt-app to war
- kept the main pom packaging to "pom" because, soon the client's project is going to  have another modules(maven).
- deleted all reference to the two modules in the main pom.xml file.

So, if I run mvn clean install I can see that a war file is generated that can be deployed let's say to a Jboss/ wildfly server app.

However, from the main folder where the main pom.xml file is, I have an error of No project found if I run mvn gwt:codeserver -pl *-client -am

is there any other tweak I should consider on both poms xml file?
Notice that, if the packaging is kept to gwt-app in the client module, codeserver/devmode runs without a problem but I will have no reference the webapp files (index.html, css) because they won't be referenced.

Please advise.

this the content of my main pom.xml file : 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>web-app</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <packaging>pom</packaging>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.gwtproject</groupId>
        <artifactId>gwt</artifactId>
        <version>2.11.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <plugins>
      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <moduleName>com.example.WebAppClient</moduleName>
          <launcherDir>${project.build.directory}/gwt/launcherDir</launcherDir>
          <!-- To be able to use gwt:devmode (useful on Windows where Ctrl+C won't kill gwt:codeserver)-->
          <warDir>${project.build.directory}/gwt/launcherDir</warDir>
          <devmodeArgs>
            <arg>-noserver</arg>
            <arg>-startupUrl</arg>
            <arg>app/index.html</arg>
          </devmodeArgs>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.12.1</version>
          <configuration>
            <release>11</release>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.4.0</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <version>11.0.19</version>
        </plugin>
        <plugin>
          <groupId>net.ltgt.gwt.maven</groupId>
          <artifactId>gwt-maven-plugin</artifactId>
          <version>1.1.0</version>
          <extensions>true</extensions>
          <configuration>
            <sourceLevel>11</sourceLevel>
            <failOnError>true</failOnError>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <modules>
    <module>web-app-client</module>
  </modules>
</project>


and this is the content of my client module pom.xml file : 
<?xml version="1.0" encoding="UTF-8"?>
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.example</groupId>
    <artifactId>web-app</artifactId>
    <version>HEAD-SNAPSHOT</version>
  </parent>

  <artifactId>web-app-client</artifactId>
  <!-- <packaging>gwt-app</packaging> -->
  <packaging>war</packaging>

  <dependencies>
    <dependency>
      <groupId>org.gwtproject</groupId>
      <artifactId>gwt-user</artifactId>
    </dependency>
    <dependency>
      <groupId>org.gwtproject</groupId>
      <artifactId>gwt-dev</artifactId>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>net.ltgt.gwt.maven</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <configuration>
          <moduleName>com.example.WebAppClient</moduleName>
          <moduleShortName>app</moduleShortName>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


what am i missing?

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/7030870f-8897-4ead-9e04-47d4138ced21n%40googlegroups.com.

No comments:

Post a Comment