October Speed Topic Links and Resources

12 views
Skip to first unread message

Josh Hamit

unread,
Oct 18, 2012, 9:19:36 PM10/18/12
to spring-d...@googlegroups.com
I'll be sure to post Bruce's and Samaresh's resources once they are received. But, since we have the other three now, here they are:

Josh Hamit - Configurable page instances in Geb:

Dennis Kubes - Singly API for java Spring:
GitHub Example: https://github.com/Singly/singly-java
Main singly website: singly.com

Brian Hurley - Maven archetype to start up a spring app quickly:
Presentation Notes:
Steps to create the archetype

1. Create a project to use as a template, you will want to store this into your versioning system just as you do another project so you can keep this updated with the latest jars and images as needed.

2. Create the base archetype project.

mkdir -p src/main/resources/archetype-resources
mkdir -p src/main/resources/META-INF/maven


.
└── src
    └── main
        └── resources
            ├── META-INF
            │   └── maven
            └── archetype-resources


6 directories




3. Create pom.xml, update groupId, artifactId and version as needed.

  <modelVersion>4.0.0</modelVersion>

  <groupId>com</groupId>
  <artifactId>fooArchetype</artifactId>
  <version>1.0.1-RELEASE</version>
  <name>Archetype - springArchetype</name>


  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
      </plugin>
    </plugins>
  </build>
</project>





Now you should have a tree like this...


.
├── pom.xml
└── src
    └── main
        └── resources
            ├── META-INF
            │   └── maven
            │       └── archetype-metadata.xml
            └── archetype-resources
  

37 directories, 48 files




4. Copy example project to archetype resources area

cp -R ../demoproject/src src/main/resources/archetype-resources/



5. Don't forget to copy the pom.xml for the existing project also.  However, you don't want to copy any unnecessary files that you don't want duplicated into the new projects like the target directory.

cp ../demoproject/src/pom.xml src/main/resources/archetype-resources/



6. Edit the pom.xml for the archetype-resources and update the groupId, artifactId, version and name with replacement attributes


<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>war</packaging>

<name>${artifactId}</name>




7. create archetype-metadata.xml

<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="basic">

  <fileSets>
    <!-- Sources -->
    <fileSet filtered="true" packaged="true">
      <directory>src/main/java</directory>
      <includes>
        <include>**/*.java</include>
      </includes>
    </fileSet>
    <fileSet filtered="true" packaged="false">
      <directory>src/main/resources</directory>
      <includes>
        <include>*.properties</include>
      </includes>
    </fileSet>
    <!-- WebApp resources -->
    <fileSet filtered="true" packaged="false">
      <directory>src/main/webapp</directory>
      <includes>
        <include>**/*.xml</include>
      </includes>
    </fileSet>
    <fileSet filtered="false" packaged="false">
      <directory>src/main/webapp</directory>
      <includes>
        <include>**/*</include>
      </includes>
      <excludes>
        <exclude>**/*.xml</exclude>
      </excludes>
    </fileSet>
    <!-- Test sources -->
    <fileSet filtered="true" packaged="true">
      <directory>src/test/java</directory>
      <includes>
        <include>**/*.java</include>
      </includes>
    </fileSet>
    <!-- Test resources -->
    <fileSet filtered="true" packaged="false">
      <directory>src/test/resources</directory>
      <includes>
        <include>**/*.xml</include>
      </includes>
    </fileSet>
  </fileSets>
</archetype-descriptor>



8. run mvn install 


9. cd to another directory to try the configuration and run...  If you changed the groupId, artifactId or version in step 3 then update this command accordingly. 


mvn -B archetype:generate -DarchetypeGroupId=com -DarchetypeArtifactId=fooArchetype -DarchetypeVersion=1.0.1-RELEASE -DgroupId=com.mycompany -DartifactId=app -Dversion=1.0.0 -Dpackage=com.mycompany.app


Note: The -B option runs maven in batch mode.  In this mode it will not ask you questions.




Final tree

.
└── src
    └── main
        └── resources
            ├── META-INF
            │   └── maven
            └── archetype-resources
                └── src
                    ├── main
                    │   ├── java
                    │   │   └── com
                    │   │       └── foo
                    │   │           └── demoproject
                    │   ├── resources
                    │   └── webapp
                    │       ├── WEB-INF
                    │       │   ├── config
                    │       │   ├── jsp
                    │       │   │   └── common
                    │       │   ├── messages
                    │       │   └── tiles
                    │       │       ├── defs
                    │       │       └── layouts
                    │       ├── bootstrap
                    │       │   ├── css
                    │       │   ├── img
                    │       │   └── js
                    │       ├── css
                    │       │   └── smoothness
                    │       │       └── images
                    │       ├── image
                    │       └── js
                    └── test
                        ├── java
                        │   └── com
                        │       └── foo
                        │           └── demoproject
                        └── resources

37 directories

Josh Hamit

unread,
Oct 22, 2012, 9:52:17 AM10/22/12
to spring-d...@googlegroups.com
Samaresh Panda has been kind enough to share his October slides on Spring Data and JPA. They are attached as a PDF.

Regards,
   - Josh
Spring data - jpa.pdf

Steve I.

unread,
Oct 22, 2012, 10:18:17 AM10/22/12
to spring-d...@googlegroups.com
Thanks

--
You received this message because you are subscribed to the Google Groups "Spring Dallas UG" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spring-dallas-ug/-/peAb8_lcLWIJ.
To post to this group, send email to spring-d...@googlegroups.com.
To unsubscribe from this group, send email to spring-dallas-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spring-dallas-ug?hl=en.



--
Steve Iboubi
Reply all
Reply to author
Forward
0 new messages