Commit 574b4640 authored by LAVENIER's avatar LAVENIER
Browse files

- fix build (clean AND install) on module quadrige2-magicdraw-plugin: option...

 - fix build (clean AND install) on module quadrige2-magicdraw-plugin: option -DfirstBuild not need anymore
 - Add license header

git-svn-id: https://scmforge.ifremer.fr/authscm/lp1ee9d/svn/reefdb/trunk@787 cd918a83-917d-4a2a-92d7-bc1d03929fc5
parent 3ba9e8c2
......@@ -2,14 +2,11 @@ Recompiler le projet
--------------------
Pour reconstuire le projet adagio-core :
ATTENTION: La première fois, vous devez forcer l'installation des libs magicdraw, puis relancer un build normal:
> mvn install -DfirstBuild
Puis
> mvn install
> mvn clean install
ATTENTION: La toute première fois, un message vous indiquera de relancer
que les librairies magicdraw ont été installées dans le repository maven local.
Vous devrez donc relancer la compilation une seconde fois.
Faire une nouvelle version mineure
----------------------------------
......@@ -43,8 +40,7 @@ Génération du schema SQL (Allegro)
Tester le plugin Magicdraw
--------------------------
mvn -pl quadrige2-mda/quadrige2-magicdraw-plugin -Prun -DmagicdrawHome=<MD_HOME>
mvn -pl quadrige2-mda/quadrige2-magicdraw-plugin -Prun -DmagicdrawHome="C:\Program Files\MagicDraw UML"
mvn -pl quadrige2-mda/quadrige2-magicdraw-plugin -Prun -DmagicdrawHome="<MAGIC_DRAW_HOME>"
Install sous eclipse
......@@ -53,7 +49,6 @@ Prérequis : Installation d'eclipse avec les plugins subclipse et m2e
Checkout des projets depuis le svn
Import maven projects
Window>Preferences>Maven>Installations : Ajouter l'installation courante de maven
mvn install -DfirstBuild
mvn install
mvn eclipse:eclipse
......
......@@ -201,6 +201,12 @@
<jmock.version>2.6.0</jmock.version>
<jetty.version>9.2.1.v20140609</jetty.version>
<!-- Last JRE version to use -->
<jreVersion>1.7.51</jreVersion>
<!-- Last obsdeb db and plugin version -->
<dbVersion>2014.01.09</dbVersion>
<!-- release config -->
<autoVersionSubmodules>true</autoVersionSubmodules>
<goals>deploy</goals>
......
......@@ -8,7 +8,6 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import fr.ifremer.adagio.synchro.service.SynchroContext;
import fr.ifremer.adagio.synchro.type.ProgressionModel;
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
public interface ReferentialSynchroService {
......
......@@ -37,7 +37,8 @@ log4j.logger.org.nuiton.converter=WARN
log4j.logger.fr.ifremer=INFO
l#og4j.logger.fr.ifremer.adagio.synchro=DEBUG
#log4j.logger.fr.ifremer.adagio.synchro=DEBUG
#log4j.logger.fr.ifremer.adagio.synchro.dao=TRACE
#log4j.logger.fr.ifremer.adagio.synchro.service=INFO
#log4j.logger.fr.ifremer.quadrige2.synchro=DEBUG
#log4j.logger.fr.ifremer.quadrige2.synchro.service.data.synchro=DEBUG
......
......@@ -15,8 +15,8 @@
#--------------------------------------------------------------------------
quadrige2.persistence.jdbc.driver=oracle.jdbc.driver.OracleDriver
quadrige2.persistence.jdbc.username=Q2BLAVENIE
quadrige2.persistence.jdbc.password=Q2BLAVENIE
quadrige2.persistence.jdbc.username=Q2DBA
quadrige2.persistence.jdbc.password=Q2DBA
quadrige2.persistence.jdbc.url=jdbc:oracle:thin:@192.168.0.6:1521:ORCL
quadrige2.persistence.jdbc.batch-size=40
......
......@@ -101,6 +101,9 @@ public abstract class DatabaseResource implements TestRule {
this.beanFactoryReferenceLocation = beanFactoryReferenceLocation;
this.beanRefFactoryReferenceId = beanRefFactoryReferenceId;
this.writeDb = writeDb;
// TODO : to remove later
System.setProperty("reefdb.persistence.enable", "true");
}
/**
......
......@@ -19,6 +19,7 @@
<url>https://forge.ifremer.fr/svn/reefdb/trunk/adagio/reefdb-mda</url>
</scm>
<modules>
<module>quadrige2-magicdraw-plugin</module>
</modules>
......
......@@ -23,21 +23,14 @@
<magicdrawVersion>17.0.2</magicdrawVersion>
<magicdrawPluginId>fr.ifremer.quadrige2.magicdraw</magicdrawPluginId>
<magicdrawHome>${project.build.directory}/magicdraw</magicdrawHome>
<magicdrawLibsDirectory>${project.build.directory}/magicdraw/lib</magicdrawLibsDirectory>
<!-- Use to avoid dependencies error in the first build -->
<firstBuild>false</firstBuild>
<magicdrawHome>${basedir}/.magicdraw</magicdrawHome>
<magicdrawLibDir>${magicdrawHome}/lib</magicdrawLibDir>
</properties>
<dependencies>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>magicdraw-libs</artifactId>
<version>17.0.2</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
<!-- define in profiles -->
</dependencies>
<build>
......@@ -59,60 +52,6 @@
</resources>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-magicdraw-libs</id>
<phase>validate</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>
${magicdrawLibsDirectory}
</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>com.nomagic</groupId>
<artifactId>magicdraw-libs</artifactId>
<version>${magicdrawVersion}</version>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-dependencies-exists</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>initialize</phase>
<configuration>
<rules>
<requireProperty>
<property>firstBuild</property>
<regex>(false|)</regex>
<message>Magicdraw dependencies has been unpacked. Now please re-run the build without option '-DfirstBuild'
</message>
<regexMessage>Magicdraw dependencies has been unpacked. Now please re-run the build without option '-DfirstBuild'
</regexMessage>
</requireProperty>
</rules>
<ignoreCache>true</ignoreCache>
<failFast>true</failFast>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
......@@ -154,135 +93,292 @@
</build>
<profiles>
<profile>
<id>install-magicdraw-libs</id>
<activation>
<file>
<missing>${basedir}/.magicdraw/lib/md_api.jar</missing>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>magicdraw-libs</artifactId>
<version>${magicdrawVersion}</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-magicdraw-libs</id>
<phase>validate</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>
${magicdrawLibDir}
</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>com.nomagic</groupId>
<artifactId>magicdraw-libs</artifactId>
<version>${magicdrawVersion}</version>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>installing md_api.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic</groupId>
<artifactId>md_api</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/md_api.jar</file>
</configuration>
</execution>
<execution>
<id>installing md.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic</groupId>
<artifactId>md</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/md.jar</file>
</configuration>
</execution>
<execution>
<id>installing uml2.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic</groupId>
<artifactId>uml2</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/uml2.jar</file>
</configuration>
</execution>
<execution>
<id>installing javax_jmi.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic</groupId>
<artifactId>javax_jmi-1_0-fr</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/javax_jmi-1_0-fr.jar</file>
</configuration>
</execution>
<execution>
<id>installing md_foundation.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic</groupId>
<artifactId>md_foundation_1.0</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/md_foundation_1.0.jar</file>
</configuration>
</execution>
<execution>
<id>installing md_common_api.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic</groupId>
<artifactId>md_common_api</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/md_common_api.jar</file>
</configuration>
</execution>
<execution>
<id>installing org.eclipse.emf.ecore.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>org.eclipse.emf</groupId>
<artifactId>emf-ecore</artifactId>
<version>2.7.0.v20110513-1719</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/org.eclipse.emf.ecore_2.7.0.v20110513-1719.jar</file>
</configuration>
</execution>
<execution>
<id>installing org.eclipse.emf.common.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>org.eclipse.emf</groupId>
<artifactId>emf-common</artifactId>
<version>2.7.0.v20110513-1719</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/org.eclipse.emf.common_2.7.0.v20110513-1719.jar</file>
</configuration>
</execution>
<execution>
<id>installing com.nomagic.ci.persistence.jar</id>
<phase>initialize</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.nomagic.ci</groupId>
<artifactId>persistence</artifactId>
<version>${magicdrawVersion}</version>
<packaging>jar</packaging>
<file>${magicdrawLibDir}/com.nomagic.ci.persistence_17.0.1.jar</file>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>enforce-dependencies-exists</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="installSucessMessage">*
*************************************************************************
*
* IMPORTANT:
*
* Magicdraw dependencies successfully installed on [${settings.localRepository}]
* You should now :
* - re-run the build
* This message will not appear again
*
*************************************************************************
</property>
<fail message="${installSucessMessage}">
<condition>
<available file="${magicdrawLibDir}/md_api.jar" />
</condition>
</fail>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>unpacked-dependencies</id>
<id>magicdraw-dependencies</id>
<activation>
<property>
<name>firstBuild</name>
<value>!true</value>
</property>
<file>
<exists>${basedir}/.magicdraw/lib/md_api.jar</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>md_api</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/md_api.jar</systemPath>
</dependency>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>md</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/md.jar</systemPath>
</dependency>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>uml2</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/uml2.jar</systemPath>
</dependency>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>javax_jmi-1_0-fr</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/javax_jmi-1_0-fr.jar</systemPath>
</dependency>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>md_foundation_1.0</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/md_foundation_1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.nomagic</groupId>
<artifactId>md_common_api</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/md_common_api.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>emf-ecore</artifactId>
<version>2.7.0.v20110513-1719</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/org.eclipse.emf.ecore_2.7.0.v20110513-1719.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>emf-common</artifactId>
<version>2.7.0.v20110513-1719</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/org.eclipse.emf.common_2.7.0.v20110513-1719.jar</systemPath>
</dependency>
<dependency>
<dependency>
<groupId>com.nomagic.ci</groupId>
<artifactId>persistence</artifactId>
<version>${magicdrawVersion}</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${magicdrawLibsDirectory}/com.nomagic.ci.persistence_17.0.1.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-dependencies-exists</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>initialize</phase>
<configuration>
<rules>
<requireFilesExist>
<message>For the first build, please add option '-DfirstBuild' to unpack magicdraw dependencies</message>
<files>
<file>${magicdrawLibsDirectory}/md_api.jar</file>
</files>
</requireFilesExist>
</rules>
<ignoreCache>true</ignoreCache>
<failFast>true</failFast>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- use this profile to run the main class -->
<profile>
<id>run</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<exec.mainClass>com.nomagic.magicdraw.Main</exec.mainClass>
<magicdraw.classpath>${magicdrawLibsDirectory}/*;${magicdrawLibsDirectory}/graphics/*;${magicdrawLibsDirectory}/webservice/*</magicdraw.classpath>
<magicdraw.bootclasspath>${magicdrawLibsDirectory}/xalan.jar</magicdraw.bootclasspath>
<magicdraw.classpath>${magicdrawHome}/lib/*;${magicdrawHome}/lib/graphics/*;${magicdrawHome}/lib/webservice/*</magicdraw.classpath>
<magicdraw.bootclasspath>${magicdrawHome}/lib/xalan.jar</magicdraw.bootclasspath>
</properties>
<build>
<defaultGoal>package</defaultGoal>
<plugins>
......@@ -374,8 +470,7 @@
<argument>-XX:MaxPermSize=256M</argument>
<argument>-Dinstall.root=${magicdrawHome}</argument>
<argument>-Dquadrige2-magicdraw-plugin.properties=${project.basedir}/src/main/resources/quadrige2-magicdraw-plugin.properties</argument>
<argument>-Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n</argument>
<!-- argument>-classpath</argument> <argument>${magicdraw.classpath};${project.build.directory}/classes</argument -->
<argument>-Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n</argument>
<argument>${exec.mainClass}</argument>
</arguments>
<workingDirectory>${magicdrawHome}</workingDirectory>
......
......@@ -10,6 +10,6 @@ public interface ReefDbProgramDao {
ProgrammeDTO getProgram(String programCode);
List<ProgrammeDTO> getProgramByCampaign(Integer campaignId);
List<ProgrammeDTO> getProgramByCampaignId(Integer campaignId);
}
......@@ -63,7 +63,7 @@ public class ReefDbProgramDaoImpl extends ProgramDaoImpl implements ReefDbProgra
}
@Override
public List<ProgrammeDTO> getProgramByCampaign(Integer campaignId) {
public List<ProgrammeDTO> getProgramByCampaignId(Integer campaignId) {
List<Object[]> rows = queryList("programByCampaign",
"campaignId", IntegerType.INSTANCE, campaignId);
......
......@@ -22,6 +22,7 @@ import com.google.common.collect.Lists;
import fr.ifremer.quadrige2.core.dao.referential.monitoringLocation.MonitoringLocationDaoImpl;
import fr.ifremer.quadrige2.core.dao.technical.Daos;
import fr.ifremer.reefdb.dao.referential.taxon.ReefDbTaxonGroupDao;
import fr.ifremer.reefdb.dao.referential.taxon.ReefDbTaxonNameDao;
import fr.ifremer.reefdb.dto.psfm.FractionDTO;
import fr.ifremer.reefdb.dto.psfm.FractionDTOs;
import fr.ifremer.reefdb.dto.psfm.MesureDTO;
......@@ -42,7 +43,10 @@ public class ReefDbPmfmDaoImpl extends MonitoringLocationDaoImpl implements Reef
@Resource(name = "reefDbTaxonGroupDao")
private ReefDbTaxonGroupDao taxonGroupDao;
@Resource(name = "reefDbTaxonNameDao")
private ReefDbTaxonNameDao taxonNameDao;
@Autowired
public ReefDbPmfmDaoImpl(SessionFactory sessionFactory) {
super(sessionFactory);
......@@ -64,13 +68,13 @@ public class ReefDbPmfmDaoImpl extends MonitoringLocationDaoImpl implements Reef
@Override
public ParametreDTO getParameter(String parameterCode) {
Preconditions.checkArgument(StringUtils.isNotBlank(parameterCode));
Object[] source = queryUnique("parameterByCode", "parameterCode", StringType.INSTANCE, parameterCode);