mvn clean install site -Pintegration
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
+mvn site
mvn sonar:sonar -Dsonar.host.url=http://172.17.0.3:9091/sonarqube
</description>
<organization>
<name>Gustavo Martin Morcuende</name>
- <url>http://www.gumartinm.name</url>
+ <url>https://www.gumartinm.name</url>
</organization>
<scm>
- <developerConnection>scm:git:http://git.gumartinm.name/JavaForFun</developerConnection>
- <url>http://git.gumartinm.name/JavaForFun</url>
+ <developerConnection>scm:git:https://git.gumartinm.name/JavaForFun</developerConnection>
+ <url>https://git.gumartinm.name/JavaForFun</url>
</scm>
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.version>4.3.0.RELEASE</spring.version>
<querydsl.version>4.1.3</querydsl.version>
+ <maven.javadoc.version>2.10.4</maven.javadoc.version>
+ <maven.source.version>3.0.1</maven.source.version>
<!-- Be careful these two paths must match the ones configured in SONARQUBE JaCoCo plugin -->
<jacoco.it.execution.data.file>${project.basedir}/target/jacoco-it.exec</jacoco.it.execution.data.file>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.11</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.5.1</version>
+ <dependencies>
+ <dependency><!-- add support for ssh/scp -->
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ <version>2.10</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</pluginManagement>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-descriptor</id>
+ <goals>
+ <goal>attach-descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${maven.javadoc.version}</version>
+ <configuration>
+ <quiet>true</quiet>
+ <docencoding>${project.build.sourceEncoding}</docencoding>
+ <charset>${project.build.sourceEncoding}</charset>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <additionalparam>-Xdoclint:none</additionalparam>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>${maven.source.version}</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.4</version>
+ <version>${maven.javadoc.version}</version>
<reportSets>
<reportSet>
<id>html</id>
<configuration>
- <!-- default value is http://localhost:9000 -->
+
<doctitle>API for ${project.name} ${project.version}</doctitle>
<windowtitle>API for ${project.name} ${project.version}</windowtitle>
</configuration>
import de.spring.example.persistence.domain.AdDescription;
/**
- * By default <code>org.springframework.data.jpa.repository.support.SimpleJpaRepository<code>
+ * By default <code>org.springframework.data.jpa.repository.support.SimpleJpaRepository</code>
* will be the implementation for this interface.
*
* Be careful with <code>@Transactional</code>. SimpleJpaRepository has annotated methods.
import de.spring.example.persistence.domain.Ad;
/**
- * By default <code>org.springframework.data.jpa.repository.support.SimpleJpaRepository<code>
+ * By default <code>org.springframework.data.jpa.repository.support.SimpleJpaRepository</code>
* will be the implementation for this interface.
*
* Be careful with <code>@Transactional</code>. SimpleJpaRepository has annotated methods.
/**
* Returns a {@link Page} of revisions for the entity with the given id
*
+ * @param id The identifier of the resource to find.
* @param page Page number starting from 0. default to 0
* @param size Number of resources by pages. default to 10
* @param direction Optional sort direction, could be "asc" or "desc"
- * @param properties Ordered list of comma separeted properies used for sorting resulats. At least one property should be provided if direction is specified
+ * @param properties Ordered list of comma separated properties used for sorting results. At least one property should be provided if direction is specified
* @return OK http status code if the request has been correctly processed, with the a paginated collection of all resource enclosed in the body.
*/
@RequestMapping(value="{id}/revisions/", method = RequestMethod.GET)
/**
* Abstract REST controller using a repository implementation
- * <p/>
* <p>
* You should extend this class when you want to use a 2 layers pattern : Repository and Controller. This is the default
* controller implementation to use if you have no service (also called business) layer. You will be able to transform
*
* <p>Default implementation uses "id" field (usually a Long) in order to identify resources in web request.
* If your want to identity resources by a slug (human readable identifier), your should override findById() method with for example :
- *
+ * </p>
* <pre>
* <code>
{@literal @}Override
public interface RestController<T, ID extends Serializable> {
/**
- * Create a new resource<br />
- * REST webservice published : POST /
+ * Create a new resource<br>
+ * REST webservice published : <code>POST /</code>
*
* @param resource The resource to create
* @return CREATED http status code if the request has been correctly processed, with updated resource enclosed in the body, usually with and additional identifier automatically created by the database
T create(@RequestBody T resource);
/**
- * Update an existing resource<br/>
- * REST webservice published : PUT /{id}
+ * Update an existing resource<br>
+ * REST webservice published : <code>PUT /{id}</code>
*
* @param id The identifier of the resource to update, usually a Long or String identifier. It is explicitely provided in order to handle cases where the identifier could be changed.
* @param resource The resource to update
* @return OK http status code if the request has been correctly processed, with the updated resource enclosed in the body
- * @throws NotFoundException
+ * @throws NotFoundException when resource <code>id</code> does not exist.
*/
@RequestMapping(value = "{id}", method = RequestMethod.PUT)
@ResponseBody
T update(@PathVariable ID id, @RequestBody T resource);
/**
- * Find all resources, and return the full collection (plain list not paginated)<br/>
- * REST webservice published : GET /?page=no
+ * Find all resources, and return the full collection (plain list not paginated)<br>
+ * REST webservice published : <code>GET /?page=no</code>
*
* @return OK http status code if the request has been correctly processed, with the list of all resource enclosed in the body.
* Be careful, this list should be big since it will return ALL resources. In this case, consider using paginated findAll method instead.
Iterable<T> findAll();
/**
- * Find all resources, and return a paginated and optionaly sorted collection<br/>
- * REST webservice published : GET /search?page=0&size=20 or GET /search?page=0&size=20&direction=desc&properties=name
+ * Find all resources, and return a paginated and optionaly sorted collection<br>
+ * REST webservice published : <code>GET /search?page=0&size=20 or GET /search?page=0&size=20&direction=desc&properties=name</code>
*
* @param page Page number starting from 0. default to 0
* @param size Number of resources by pages. default to 10
@RequestParam(value = "properties", required = false) String properties);
/**
- * Find a resource by its identifier<br/>
- * REST webservice published : GET /{id}
+ * Find a resource by its identifier<br>
+ * REST webservice published : <code>GET /{id}</code>
*
* @param id The identifier of the resouce to find
* @return OK http status code if the request has been correctly processed, with resource found enclosed in the body
- * @throws NotFoundException
+ * @throws NotFoundException when resource <code>id</code> does not exist.
*/
@RequestMapping(value = "{id}", method = RequestMethod.GET)
@ResponseBody
T findById(@PathVariable ID id);
/**
- * Find multiple resources by their identifiers<br/>
- * REST webservice published : GET /?ids[]=
- * <p/>
- * example : /?ids[]=1&ids[]=2&ids[]=3
+ * Find multiple resources by their identifiers<br>
+ * REST webservice published : <code>GET /?ids[]=</code>
+ * <p>
+ * example : <code>/?ids[]=1&ids[]=2&ids[]=3</code>
+ * </p>
*
* @param ids List of ids to retrieve
* @return OK http status code with list of retrieved resources. Not found resources are ignored:
Iterable<T> findByIds(@RequestParam(value = "ids[]") Set<ID> ids);
/**
- * Delete all resources<br/>
- * REST webservice published : DELETE /<br/>
- * Return No Content http status code if the request has been correctly processed
+ * Delete all resources<br>
+ * REST webservice published : <code>DELETE /</code><br>
+ * Return <code>No Content</code> http status code if the request has been correctly processed
*/
@RequestMapping(method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
void delete();
/**
- * Delete a resource by its identifier<br />
- * REST webservice published : DELETE /{id}<br />
+ * Delete a resource by its identifier<br>
+ * REST webservice published : <code>DELETE /{id}</code><br>
* Return No Content http status code if the request has been correctly processed
*
* @param id The identifier of the resource to delete
- * @throws NotFoundException
+ * @throws NotFoundException when resource <code>id</code> does not exist.
*/
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)
/**
* Abstract REST controller using a service implementation
- * <p/>
- * <p>You should extend this class when you want to use a 3 layers pattern : Repository, Service and Controller
- * If you don't have a real service (also called business layer), consider using RepositoryBasedRestController</p>
- * <p/>
- * <p>Default implementation uses "id" field (usually a Long) in order to identify resources in web request.
+ *
+ * <p>
+ * You should extend this class when you want to use a 3 layers pattern : Repository, Service and Controller
+ * If you don't have a real service (also called business layer), consider using RepositoryBasedRestController
+ * </p>
+ * <p>
+ * Default implementation uses "id" field (usually a Long) in order to identify resources in web request.
* If your want to identity resources by a slug (human readable identifier), your should override findById() method with for example :
- * <p/>
+ * </p>
* <pre>
* <code>
* {@literal @}Override
* Returns a {@link Page} of revisions for the entity with the given id.
*
* @param id must not be {@literal null}.
- * @param pageable
- * @return
+ * @param pageable page request.
+ * @return a new {@link Page} with the content of the current one mapped by the given {@link Pageable}.
*/
Page<Revision<Integer, AdDescription>> findRevisions(Long id, Pageable pageable);
}
* Returns a {@link Page} of revisions for the entity with the given id.
*
* @param id must not be {@literal null}.
- * @param pageable
- * @return
+ * @param pageable page request.
+ * @return a new {@link Page} with the content of the current one mapped by the given {@link Pageable}.
*/
Page<Revision<N, T>> findRevisions(ID id, Pageable pageable);
}
void delete(ID id);
/**
- * Delete all existing resource. Do not use cascade remove (not a choice -> JPA specs)
+ * Delete all existing resource. Do not use cascade remove (not a choice -> JPA specs)
*/
void deleteAll();
/**
* Find all resources (pageable).
*
- * @param pageRequest page request
- * @return resources
+ * @param pageRequest page request.
+ * @return a new {@link Page} with the content of the current one mapped by the given {@link Pageable}.
*/
Page<T> findAll(Pageable pageRequest);