Maven + GWT
I needed to create a GWT project using maven again. The original post lacked some details. This time, I got it to work with a slightly different steps. First, I ran the following command:
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchtypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.4.0 -DarchetypeRepository=repo1.maven.org
Somehow, Maven didn’t pickup the group ID and artifact ID. So, I had to choose from one of the listed item.
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 337 Choose org.codehaus.mojo:gwt-maven-plugin version: 1: 1.1 2: 1.2 3: 2.1.0 4: 2.1.0-1 5: 2.4.0 Choose a number: 5: 5
Next, I defined the properties for my project.
Define value for property 'groupId': : com.my.app.package.name Define value for property 'artifactId': : directoryNameForTheGeneratedProject Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.my.app.package.name Define value for property 'module': : moduleName
Now I can run the generated module with the following command. This will bring up a console. All I have to do is copy the URL and then past it in the browser.
Maven + Eclipse
Next, I followed the instructions on this page to run the following command within the project folder to enable support for Eclipse:
Then, I use Eclipse to import existing project into workspace to open the project. Eclipse complained that the default directory for the project should be set to
/PorjectFolder/src/main/webapp/WEB-INF/classes Since I want to use Maven to build, I ignore the error by right click on the error, choose quick fix, choose
Do not use the WAR directory for ProjectName launching and deploying (this disables management of WEB-INF)
Maven + WebLogic
I noticed that the JRE libraries were referencing version Java SE 7 jars, I changed it to 6 so the project will be compatible with WebLogic 11g. For WebLogic 12c, see this post.
I followed the instructions to configure WebLogic 11g with Maven. The available commands for 11g are slightly different from 12c. They are are
deploy, help, list-apps, redeploy, start-app, stop-app, undeploy, update-app. Once I completed the configuration, I was able to run
mvn weblogic:list-apps command. Next, I ran
mvn package to create the WAR file before attempted
mvn weblogic:deploy. I was able to load the application in my browser! :)