Port of schuchert.wikispaces.com


tdd_intro.CreatingAnEmptyProject

tdd_intro.CreatingAnEmptyProject

Create a new project

    mvn archetype:generate <<enter>>
    Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 670: <<enter>>
    5: 1.0
    6: 1.1
    Choose a number: 6: <<enter>>
    Define value for property 'groupId': : com.shoe <<enter>>
    Define value for property 'artifactId': : paginator <<enter>>
    Define value for property 'version':  1.0-SNAPSHOT: : <<enter>>
Define value for property 'package':  com.shoe: : com.shoe.paginator <<enter>>
    Confirm properties configuration:
    groupId: com.shoe
    artifactId: paginator
    version: 1.0-SNAPSHOT
    package: com.shoe.paginator
     Y: : <<enter>>

Check the project

    cd paginator <<enter>> 
    mvn test
    <<snip>>
    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running com.shoe.paginator.AppTest
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
    
    Results :
    
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.466 s
    [INFO] Finished at: 2015-10-26T00:40:22-05:00
    [INFO] Final Memory: 14M/166M
    [INFO] ------------------------------------------------------------------------

Modernize the project

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
    mvn test <<enter>>
    find . -name \*.java | xargs rm

Optionally create a git repo out of this directory

    git init
    echo "target" > .gitignore
    git add pom.xml .gitignore
    git commit -m "Initial commit"

You are ready to open pom.xml in an ide

Creating Empty Project


Comments

" Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.