Skip to content

Instantly share code, notes, and snippets.

View maurcarvalho's full-sized avatar
🏠
Working from home

Mauricio Carvalho maurcarvalho

🏠
Working from home
View GitHub Profile
$mvn archetype:generate -DarchetypeGroupId=br.com.caelum.vraptor.archetypes -DarchetypeArtifactId=vraptor-archetype-webapp-blank -DarchetypeVersion=0.1.0 -DarchetypeRepository=http://vraptor-archetypes.googlecode.com/svn/trunk/repo
cd sample-project
$ mvn -Dwtpversion=1.0 eclipse:eclipse
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: vraptor-archetype-webapp-blank:0.1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: br.com.mcarvalho.wsclient
[INFO] Parameter: packageName, Value: br.com.mcarvalho.wsclient
[INFO] Parameter: package, Value: br.com.mcarvalho.wsclient
[INFO] Parameter: artifactId, Value: sample-project
[INFO] Parameter: basedir, Value: C:\Users\mauriciosantos\Documents\GitHub\ws-client
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:\Users\mauriciosantos\Documents\GitHub\ws-client\sample-project
Define value for property 'groupId': : br.com.mcarvalho.wsclient
Define value for property 'artifactId': : sample-project
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': br.com.mcarvalho.wsclient: :
Após isso será solicitado a confirmação, digite Y (yes)
Confirm properties configuration:
groupId: br.com.mcarvalho.wsclient
artifactId: sample-project
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO]
@maurcarvalho
maurcarvalho / gist:8238132
Created January 3, 2014 13:47
Teste Interface
public class TesteInterface {
public static void main(String[] args) {
// Array de Objetos que implementam a interface Veiculo
Veiculo[] arrayDaInterface = new Veiculo[] { new Motocicleta(),
new Carro() };
Carro c = new Carro();
// Aqui preciso garantir que na posição 1 terá um carro utilizando um CAST , pois varias classes podem implementam veiculo e pertencer a este array e nao somente um Carro.
@maurcarvalho
maurcarvalho / gist:8238119
Created January 3, 2014 13:47
Motocicleta
public class Motocicleta implements Veiculo {
public void andar() {
System.out.println("Motos andam em rodovias");
}
public void ligar() {
System.err.println("Ligar com partida a combustão");
@maurcarvalho
maurcarvalho / gist:8238106
Created January 3, 2014 13:46
Classe Carro
public class Carro implements Veiculo {
public void andar() {
System.out.println("Carros andam em rodovias");
}
public void ligar() {
System.err.println("Ligar com partida a combustão");
@maurcarvalho
maurcarvalho / gist:8238098
Created January 3, 2014 13:45
Interface Veiculo - Array Interface
public interface Veiculo {
void andar();
void ligar();
void desligar();
}