Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Isomorphic
    replied
    The easiest thing would be to start all over using the Smart GWT Pro/EE Project Setup documentation as your guide, but you can skip directly to the Maven Support topic if you're already familiar with Maven.

    Do let us know if you have any trouble at that point.


    Leave a comment:


  • Plugin org.codehaus.mojo:gwt-maven-plugin:2.10.0 or one of its dependencies could not be resolved

    Hi GWT Experts,

    I am new to GWT world of development. Doing a fresh GWT maven based project setup. Below is my system configuration details:
    • Java Version: 1.17
    • Eclipse Version: 2023-03 (4.27.0)
    • GWT SDK: 2.11.0
    • GWT Plugin: 4.0.0
    • Maven: 3.9.6

    I found an article (link) which talks about GWT Basic Archetype for creating a GWT Maven project .
    Code:
    mvn archetype:generate ^
    -DarchetypeRepository=https://oss.sonatype.org/content/repositories/snapshots ^
    -DarchetypeGroupId=com.github.branflake2267.archetypes ^
    -DarchetypeArtifactId=gwt-basic-archetype ^
    -DarchetypeVersion=2.0-SNAPSHOT ^
    -DgroupId=com.example.project.ChangeMe ^
    -DartifactId=new-project-name-ChangeMe
    While running I get BUILD FAILED with error:
    Code:
    Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.github.branflake2267.archetypes:gwt-basic-archetype:2.0-SNAPSHOT)
    So I tried generating with maven-archetype-plugin:2.4 and manually update the config.

    Maven generate with maven-archetype-plugin:2.4

    Code:
    mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate \
    -DarchetypeRepository=[URL]https://oss.sonatype.org/content/repositories/snapshots[/URL] \
    -DarchetypeGroupId=com.github.branflake2267.archetypes \
    -DarchetypeArtifactId=gwt-basic-archetype \
    -DarchetypeVersion=2.0-SNAPSHOT \
    -DgroupId=com.example.project.ChangeMe \
    -DartifactId=new-project-name-ChangeMe
    Here is what my pom looks like:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <project xmlns="http://maven.apache.org/POM/4.0.0"
    
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>com.example.project.ChangeMe</groupId>
    
    <artifactId>new-project-name-ChangeMe</artifactId>
    
    <packaging>war</packaging>
    
    <version>1.0-SNAPSHOT</version>
    
    <name>new-project-name-ChangeMe</name>
    
    <description>Basic GWT Maven setup.</description>
    
    
    <properties>
    
    <!-- GWT -->
    
    <gwt.version>2.10.0</gwt.version>
    
    <gwt.maven.plugin.version>2.10.0</gwt.maven.plugin.version>
    
    <!-- Java -->
    
    <maven.compiler.source>1.17</maven.compiler.source>
    
    <maven.compiler.target>1.17</maven.compiler.target>
    
    <!-- Maven -->
    
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
    <!-- WebApp/War Output Directory -->
    
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
    
    </properties>
    
    
    <build>
    
    <!-- Compiled Classes -->
    
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
    
    <resources>
    
    <resource>
    
    <directory>src/main/java</directory>
    
    <includes>
    
    <include>**</include>
    
    </includes>
    
    </resource>
    
    </resources>
    
    <plugins>
    
    <!-- Java -->
    
    <plugin>
    
    <groupId>org.apache.maven.plugins</groupId>
    
    <artifactId>maven-compiler-plugin</artifactId>
    
    <version>3.3</version>
    
    <configuration>
    
    <source>1.17</source>
    
    <target>1.17</target>
    
    </configuration>
    
    </plugin>
    
    <!-- GWT -->
    
    <!-- https://tbroyer.github.io/gwt-maven-plugin/usage.html -->
    
    <!--
    
    http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22net.ltgt.gwt.maven%22%20AND%20a%3A%22gwt-maven-plugin%22 -->
    
    <!-- Requires Java 1.7+ -->
    
    <plugin>
    
    <groupId>org.codehaus.mojo</groupId>
    
    <artifactId>gwt-maven-plugin</artifactId>
    
    <version>${gwt.maven.plugin.version}</version>
    
    <extensions>true</extensions>
    
    <configuration>
    
    <!-- Eclipse will work with module naming in the gwt-app
    
    config only -->
    
    <moduleName>com.example.project.ChangeMe.App</moduleName>
    
    <moduleShortName>App</moduleShortName>
    
    <webappDirectory>${webappDirectory}</webappDirectory>
    
    <startupUrls>
    
    <startupUrl>App.html</startupUrl>
    
    </startupUrls>
    
    </configuration>
    
    </plugin>
    
    
    <!-- War -->
    
    <!-- run: mvn clean package -->
    
    <plugin>
    
    <groupId>org.apache.maven.plugins</groupId>
    
    <artifactId>maven-war-plugin</artifactId>
    
    <version>3.0.0</version>
    
    <configuration>
    
    <webappDirectory>${webappDirectory}</webappDirectory>
    
    </configuration>
    
    <executions>
    
    <execution>
    
    <id>copy-war-contents-to-exploded-dir</id>
    
    <phase>package</phase>
    
    <goals>
    
    <goal>exploded</goal>
    
    </goals>
    
    </execution>
    
    </executions>
    
    </plugin>
    
    </plugins>
    
    
    <pluginManagement>
    
    <plugins>
    
    <plugin>
    
    <groupId>org.eclipse.m2e</groupId>
    
    <artifactId>lifecycle-mapping</artifactId>
    
    <version>1.0.0</version>
    
    <configuration>
    
    <lifecycleMappingMetadata>
    
    <pluginExecutions>
    
    <pluginExecution>
    
    <pluginExecutionFilter>
    
    <groupId>org.codehaus.mojo</groupId>
    
    <artifactId>gwt-maven-plugin</artifactId>
    
    <!-- <versionRange>[2.5.0,)</versionRange> -->
    
    <version>${gwt.version}</version>
    
    <goals>
    
    <goal>compile</goal>
    
    <goal>test</goal>
    
    </goals>
    
    <configuration>
    
    <runTarget>App.html</runTarget>
    
    <hostedWebapp>${webappDirectory}</hostedWebapp>
    
    </configuration>
    
    </pluginExecutionFilter>
    
    <action>
    
    <execute />
    
    </action>
    
    </pluginExecution>
    
    <pluginExecution>
    
    <pluginExecutionFilter>
    
    <groupId>org.apache.maven.plugins</groupId>
    
    <artifactId>maven-war-plugin</artifactId>
    
    <versionRange>[3.0.0,)</versionRange>
    
    <goals>
    
    <goal>exploded</goal>
    
    </goals>
    
    </pluginExecutionFilter>
    
    <action>
    
    <execute>
    
    <!-- Copy war contents on import and
    
    updates -->
    
    <runOnConfiguration>true</runOnConfiguration>
    
    <runOnIncremental>true</runOnIncremental>
    
    </execute>
    
    </action>
    
    </pluginExecution>
    
    </pluginExecutions>
    
    </lifecycleMappingMetadata>
    
    </configuration>
    
    </plugin>
    
    </plugins>
    
    </pluginManagement>
    
    </build>
    
    
    <!-- GWT BOM -->
    
    <!--<dependencyManagement>
    
    <dependencies>
    
    <dependency>
    
    <groupId>com.google.gwt</groupId>
    
    <artifactId>gwt</artifactId>
    
    <version>2.10.0</version>
    
    <type>pom</type>
    
    <scope>import</scope>
    
    </dependency>
    
    </dependencies>
    
    </dependencyManagement>-->
    
    
    <dependencies>
    
    <!-- GWT -->
    
    <dependency>
    
    <groupId>com.google.gwt</groupId>
    
    <artifactId>gwt-user</artifactId>
    
    <version>${gwt.version}</version>
    
    <scope>provided</scope>
    
    </dependency>
    
    <dependency>
    
    <groupId>com.google.gwt</groupId>
    
    <artifactId>gwt-dev</artifactId>
    
    <version>${gwt.version}</version>
    
    <scope>provided</scope>
    
    </dependency>
    
    <dependency>
    
    <groupId>com.google.gwt</groupId>
    
    <artifactId>gwt-servlet</artifactId>
    
    <version>${gwt.version}</version>
    
    <scope>runtime</scope>
    
    </dependency>
    
    
    <!-- Testing -->
    
    <dependency>
    
    <groupId>junit</groupId>
    
    <artifactId>junit</artifactId>
    
    <version>4.12</version>
    
    <scope>test</scope>
    
    </dependency>
    
    </dependencies>
    
    </project>
    Any suggestion on this to resolve this issue?
Working...
X