views:

28

answers:

2

I am Java and Maven newbie and I want to create a simple client and server app in Java which will communicate trough sockets.

I read a little about Maven, and I managed to create Hello World example using:

 mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

But I was wondering, can I do more with Maven? I already found some Java examples to help me, but I am wondering can Maven help me with this? (like creating a skeleton for client-server project).

A: 

Tools like Maven don't read minds.

There are frameworks to help with creating web CRUD apps, like Grails and Spring Roo. I'm not aware of anything at the raw socket level.

duffymo
So, if I want to use maven to create this app, I should just use Hello World example (like in the question) to build folder structure and then edit the code, right?
Matthew Murdock
A: 

Such an application is nothing more than a multi-modules project and there is no other archetype than the maven-archetype-quickstart to create this kind of setup. The steps would involve:

  • create a parent project with the maven-archetype-quickstart
  • cd into the parent project directory
    • edit the pom.xml to change the packaging from jar to pom
    • remove the src directory
  • create a client project from the parent directory with the maven-archetype-quickstart
  • create a server project from the parent directory with the maven-archetype-quickstart
Pascal Thivent