Skip to content

Commit

Permalink
Merge branch 'release-1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusBernalBermudez committed Sep 27, 2017
2 parents 10714e2 + d88ce9f commit 25c1e77
Show file tree
Hide file tree
Showing 27 changed files with 174 additions and 91 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ services:
before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS forge;'
script:
#Test unitario y de integracion en develop
- mvn verify --settings settings.xml
- mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify --settings settings.xml
- mvn sonar:sonar -Dsonar.organization=miw-upm-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR --settings settings.xml
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Forja
#### Asignatura: *Ingeniería Web: Visión General*
#### [Máster en Ingeniería Web por la U.P.M.](http://miw.etsisi.upm.es)
> Este proyecto pretende ser un ejemplo de preparación de una forja para el desarrollo de software colaborativo
> ##### [Máster en Ingeniería Web por la Universidad Politécnica de Madrid (miw-upm)](http://miw.etsisi.upm.es)
> ##### Asignatura: *Ingeniería Web: Visión General*
### Estado del código

[![Build Status](https://travis-ci.org/miw-upm/IWVG-forge.svg?branch=develop)](https://travis-ci.org/miw-upm/IWVG-forge)

[![Quality Gate](https://sonarcloud.io/api/badges/gate?key=es.upm.miw:IWVG-forge)](https://sonarcloud.io/dashboard/index/es.upm.miw:IWVG-forge)

[![codebeat badge](https://codebeat.co/badges/72a87b0f-0ada-4895-9fcb-1d10a392bdaf)](https://codebeat.co/projects/github-com-miw-upm-iwvg-forge-develop)

### Tecnologías necesarias
* Java
* Maven
* Eclipse
* GitHub

### Descripción
Este proyecto pretende ser un ejemplo de preparación de una forja para el desarrollo de software colaborativo

* Travis-ci
* Sonarcloud
* Codebeat
Binary file modified docs/maven.zip
Binary file not shown.
18 changes: 18 additions & 0 deletions docs/maven/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: java
jdk:
- oraclejdk8
branches:
only:
- master
- develop
notifications:
email:
recipients:
- [email protected]
services:
- mysql
before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS bd;'
script:
#Test unitario y de integracion en develop
- mvn verify --settings settings.xml
16 changes: 16 additions & 0 deletions docs/maven/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Forja
#### Asignatura: *Ingeniería Web: Visión General*
#### [Máster en Ingeniería Web por la U.P.M.](http://miw.etsisi.upm.es)

### Tecnologías necesarias
* Java
* Maven
* Eclipse
* GitHub

### Descripción
Este proyecto pretende ser una plantilla maven para crear un proyecto
1.- Descomprimir en la carpeta de trabajo
1.- Editar el pom.xml y cambiarle el nombre del proyecto
1.- Desde Eclipse, importar el proyecto como un proyecto de maven existente

14 changes: 7 additions & 7 deletions docs/maven/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<artifactId>maven</artifactId>
<artifactId>IWVG.Forge</artifactId>
<groupId>es.upm.miw</groupId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}.${project.artifactId}</name>
Expand All @@ -21,7 +21,7 @@
<project.resources.sourceEncoding>${encoding}</project.resources.sourceEncoding>
<jdk.version>1.8</jdk.version>
<!-- Maven -->
<maven.compiler.version>3.3</maven.compiler.version>
<maven.compiler.version>3.5</maven.compiler.version>
<!-- Maven. Test de Integración -->
<maven.failsafe.version>2.19.1</maven.failsafe.version>
<!-- Pruebas -->
Expand Down Expand Up @@ -159,9 +159,9 @@

<developers>
<developer>
<name>Nombre y Apellidos</name>
<id>***</id>
<email>***@alumnos.upm.es</email>
<name>Name</name>
<id>Id</id>
<email>[email protected]</email>
<organization>MIW UPM</organization>
<roles>
<role>Architect</role>
Expand Down
40 changes: 40 additions & 0 deletions docs/maven/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- $HOME/.m2/settings.xml We set 3 profiles: develop, preproduction and production
To check active profiles, in a project folder we run mvn help:active-profiles
Now in our pom.xml we can add profiles with their own properties like database
settings -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>develop</id>
<activation>
<!-- develop is active by default, so doing 'mvn install' will apply this -->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<environment.type>develop</environment.type>
</properties>
</profile>
<profile>
<id>preproduction</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<environment.type>preproduction</environment.type>
</properties>
</profile>
<profile>
<id>production</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<environment.type>production</environment.type>
</properties>
</profile>
</profiles>
</settings>
6 changes: 6 additions & 0 deletions docs/maven/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#DB properties:
dataSource.driverClassName=${database.driver}
dataSource.url=${database.url}
dataSource.username=${database.user}
dataSource.password=${database.password}
17 changes: 12 additions & 5 deletions docs/maven/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@
<PatternLayout
pattern="[%-5level] %d{dd/MMM HH:mm:ss} %-30.30c{2} --> %msg%n" />
</Console>
<File name="File" fileName="target/logs/logs.txt">
<PatternLayout
pattern="[%-5level] %d{dd-MMM HH:mm:ss} %-30.30c{2} --> %msg%n" />
</File>
<RollingFile name="RollingFile" fileName="target/logs/iwvg.log"
filePattern="target/logs/iwvg-%d{yyyy-MM-dd.HH}-%i.log">
<PatternLayout>
<pattern>[%-5level] %d{dd-MMM HH:mm:ss} %-30.30c{2} --> %msg%n
</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="1 MB" />
</Policies>
</RollingFile>
</appenders>
<loggers>
<root level="${logs.level.root}">
<AppenderRef ref="Console" />
<appenderRef ref="File" />
<appenderRef ref="RollingFile" />
</root>
</loggers>
</configuration>
7 changes: 3 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<artifactId>IWVG.Forge</artifactId>
<artifactId>IWVG-forge</artifactId>
<groupId>es.upm.miw</groupId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
Expand All @@ -21,7 +21,7 @@
<project.resources.sourceEncoding>${encoding}</project.resources.sourceEncoding>
<jdk.version>1.8</jdk.version>
<!-- Maven -->
<maven.compiler.version>3.3</maven.compiler.version>
<maven.compiler.version>3.5</maven.compiler.version>
<!-- Maven. Test de Integración -->
<maven.failsafe.version>2.19.1</maven.failsafe.version>
<!-- Pruebas -->
Expand All @@ -30,11 +30,10 @@
<log4j.version>2.3</log4j.version>
<!-- Data Base -->
<database.driver>com.mysql.jdbc.Driver</database.driver>
<database.url>jdbc:mysql://localhost:3306/eco</database.url>
<database.url>jdbc:mysql://localhost:3306/forge</database.url>
</properties>

<profiles>
<!-- Maven will apply this by default as we set in $HOME/.m2/settings.xml -->
<!-- Default: -Denvironment.type=develop -->
<profile>
<id>develop</id>
Expand Down
6 changes: 3 additions & 3 deletions scripts/0.version.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@echo off
::set se definen variables
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG.Forge
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG-forge
::Las variables de entorno se pueden configurar directamente en Windows cuando se tienen los permisos necesarios
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.3.3
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.5.0
:: %var% se accede a una variable
set PATH=%PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin
::echo saca por pantalla un mensaje
echo -----------------------------------------
echo . (C) MIW
echo . (C) MIW - UPM
echo -----------------------------------------
echo .
echo Workspace --- %workspace%
Expand Down
10 changes: 5 additions & 5 deletions scripts/1.mvnAllUnitTest.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@echo off
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG.Forge
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG-forge
::Las variables de entorno se pueden configurar directamente en Windows cuando se tienen los permisos necesarios
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.3.3
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.5.0
set PATH=%PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin
echo -----------------------------------------
echo . (C) MIW
echo . (C) MIW - UPM
echo -----------------------------------------
echo .
echo Workspace --- %workspace%
echo JAVA_HOME --- %JAVA_HOME%
echo M2_HOME --- %M2_HOME%
echo .
cd %workspace%
echo ============ mvn clean test (profile: develop) =======================================================
echo ============ mvn clean test --settings settings.xml (profile: develop) =====================================
echo .
call mvn clean test --settings settings.xml
call mvn clean test --settings settings.xml
pause

10 changes: 5 additions & 5 deletions scripts/2.mvnAllTest.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@echo off
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG.Forge
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG-forge
::Las variables de entorno se pueden configurar directamente en Windows cuando se tienen los permisos necesarios
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.3.3
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.5.0
set PATH=%PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin
echo -----------------------------------------
echo . (C) MIW
echo . (C) MIW - UPM
echo -----------------------------------------
echo .
echo Workspace --- %workspace%
Expand All @@ -14,8 +14,8 @@ echo M2_HOME --- %M2_HOME%
echo .
cd %workspace%

echo ============ mvn clean test (profile: develop) =======================================================
echo ============ mvn clean verify (profile: develop) =======================================================
echo .
call mvn verify test --settings settings.xml
call mvn clean verify --settings settings.xml
pause

12 changes: 6 additions & 6 deletions scripts/3.mvnVeriryPreproduction.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@echo off
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG.Forge
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG-forge
::Las variables de entorno se pueden configurar directamente en Windows cuando se tienen los permisos necesarios
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.3.3
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.5.0
set PATH=%PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin
echo -----------------------------------------
echo . (C) MIW
echo . (C) MIW - UPM
echo -----------------------------------------
echo .
echo Workspace --- %workspace%
Expand All @@ -14,15 +14,15 @@ echo M2_HOME --- %M2_HOME%
echo .
cd %workspace%

:: -ff, --fail-fast. Stop at first failure in reactorized builds. Línea de comentario
:: -ff, --fail-fast. Stop at first failure in reactorized builds
echo ============ mvn -ff clean test --settings settings.xml (profile: develop) ==================================
echo .
call mvn -ff clean test --settings settings.xml
if errorLevel 1 goto errorDevelop

echo .
:: -Dmaven.test.skip=true. To skip running the tests for a particular project
echo ============ call mvn -Dmaven.test.skip=true veriry -Denvironment.type=preproduction --settings settings.xml (profile: preproduction) ======
echo ============ call mvn -Dmaven.test.skip=true verify -Denvironment.type=preproduction --settings settings.xml ======
echo .
call mvn -Dmaven.test.skip=true verify -Denvironment.type=preproduction --settings settings.xml
pause
Expand All @@ -32,5 +32,5 @@ exit
echo .
echo .
echo .
echo ######## ERRORES...
echo >>>>>>>>>>>>>>>>>>> ERRORES!!!!!!!!!!!!!!
pause
23 changes: 23 additions & 0 deletions scripts/4.sonar-cloud.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@echo off
set workspace=C:\DatosJBB\WorkSpaces\Oxygen\IWVG-forge
::Las variables de entorno se pueden configurar directamente en Windows cuando se tienen los permisos necesarios
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
set M2_HOME=C:\Archivos_de_programa\apache-maven-3.5.0
set PATH=%PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin
echo -----------------------------------------
echo . (C) MIW -UPM
echo -----------------------------------------
echo .
echo Workspace --- %workspace%
echo JAVA_HOME --- %JAVA_HOME%
echo M2_HOME --- %M2_HOME%
echo .
cd %workspace%
echo ============ mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify --settings settings.xml ... ==================
echo . Se prepara cobertura
call mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify --settings settings.xml

echo ============ mvn sonar:sonar ... =======================================================
echo . Se analiza y sube a sonar cloud
call mvn sonar:sonar -Dsonar.organization=miw-upm-github -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=2c0fb8373ef9b9e73ffad70e23f1a77158fb0e37 --settings settings.xml
pause
30 changes: 0 additions & 30 deletions scripts/Package.sh

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/Test.sh → scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#echo off
export workspace=/home/gonzalo/Escritorio/master/workspace/gonzalo.gutierrez.ecp1.miw.upm.es
#set PATH=%PATH%C:\Program Files (x86)\Java\jre1.8.0_51\bin;C:\Users\bm0827\Desktop\apache-maven-3.3.3\bin
#set PATH=%PATH%C:\Program Files (x86)\Java\jre1.8.0_51\bin;C:\Users\bm0827\Desktop\apache-maven-3.5.0\bin
#set JAVA_HOME=C:\Program Files (x86)\Java\jre1.8.0_51
echo -----------------------------------------
echo ".(C) MIW"
Expand Down
Loading

0 comments on commit 25c1e77

Please sign in to comment.