Reputation: 2852
It seems that there is an overwhelming lot of info about similar matters which makes search difficult, so I've decided to ask.
I need to create small project using GWT. I have no experience with GWT, though I have used different web-frameworks for java. I want to start it as pure maven project, without depending on any IDE (at least at the beginning). However it is not obvious for me where to start with. I've tried this:
http://mojo.codehaus.org/gwt-maven-plugin/user-guide/project.html
And maven created for me eclipse project. I do not want it! Is there any straight way to achieve my goal?
Upvotes: 0
Views: 578
Reputation: 21664
Unless you are doing it for sheer fun, or personal challenge, in my least humble of opinions, there is no point in skipping using IDE.
Download Springsource's version of Eclipse where Maven is all set up for you.
From there use Eclipse not as an IDE but as an interface to create/manage Maven projects. Use Eclipse pom editor.
The disadvantage is, of course, the temptation of the IDE features being right in front of you would be very seductive to tempt you into breaking your personal penance/indulgence of not using the IDE.
Just as long as you avoid that temptation, simply think of Eclipse as a Maven management tool. Use only the POM editor. Or if using the POM editor violates the indulgence, then use the XML editor or even the text editor. Simply treat Eclipse as an integrated file explorer - maven project manager.
Hierarchical Projects
In Eclipse you would be able to set up hierarchical maven projects and Eclipse helps you manage that hierarchy.
Once you have your hierarchy of Maven projects set-up, You could then throw Eclipse away and happily use any text editor and issue command line Maven. Which is a daunting waste of time for anyone sincerely wanting to learn Maven. Because I would not be able to see the hierarchy and visually inspect the dependency relationships which Eclipse affords me.
Time is better spent learning how to integrate Ant with Maven, or Maven with OSGI (Eclipse platform native dependency)
Setting up maven without Eclipse
If you do persist in wanting command line maven, however, simply unzip maven 3 (please use maven 3 not 2) into any location. And then set up env execution path to its bin directory so that you could simply type "mvn" rather than the whole path to invoke maven.
Then you could read up on mvn http://maven.apache.org/guides/mini/guide-creating-archetypes.html.
Maven artifact structure
The next concept you absolutely has to learn is the maven artefact structure (ok, artifact is spelt "artefact" in British English).
You should understand the simple concept of maven artifact structure, so that you could set up a maven repository by hand without use of any tools (except using mvn install:install-file or manually creating the simple directory structure).
And also, so that you could make your open-source project available as a maven artifact on the web by setting up that directory structure in, say, your google code project. For example other people would be able to use your "artifact repo" thro a url like
http: //code.google.com/p/ {your project} / {your artifact path}
Use mvn install-file to set up an artifact structure in a specific directory (rather than your local default .m2 repo) and then copy/replicate the structure elsewhere where you wish to publish it:
http://maven.apache.org/plugins/maven-install-plugin/examples/specific-local-repo.html
Bundling jars in your maven project
For one reason or another, you might have jars that are not distributed as maven artefacts openly on the web (for example, why does oracle refuse to allow their jdbc drivers for jdk5 and jdk6 from being dispensed on maven?), and you need to bundle that jar with your project. That is when having a "maven repo" set up within your project directory thro maven install-file comes in handy:
Maven add jars through systemPath/system but not added to war or anywhere else
In conclusion
There are so many exciting things to do with maven (like debating if maven should be by-convention or by-configuration), so let eclipse lighten the burden of learning for you.
Upvotes: 0
Reputation: 2389
The Maven GWT Plugin does not create an Eclipse specific project. As it is stated in this page :
http://mojo.codehaus.org/gwt-maven-plugin/user-guide/archetype.html
The generated project can then be imported as "existing project" into Eclipse, or if you don't like Eclipse you can use another IDE and run command-line maven to launch GWT hoste mode with ''mvn gwt:run''.
May I add that if you're not comfortable with Maven, you can use the tools that comes with the GWT SDK (Ant).
If you want that, follow the tutorial offered by GWT offical site :
https://developers.google.com/web-toolkit/doc/2.4/tutorial/create?hl=fr Creating the StockWatcher application (without using Eclipse)
Upvotes: 2