branch feature/7494 created (now b65d39b)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7494 in repository observe. See http://git.codelutin.com/observe.git at b65d39b Mise en place du boot de l'application web (configuration, mapping, ...) (See 7494) This branch includes the following new commits: new 0ef9322 Réactivitation des modules reset et de l'application web + Suppression d'objets non utiles et mise à jur de l'api de configuration pour les services rest new 1c7955d Rendre fermables les usines de services new b65d39b Mise en place du boot de l'application web (configuration, mapping, ...) (See 7494) The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit b65d39b7c8cfed17ee12c31cdc0b7e9671cbd8d6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 30 09:37:17 2015 +0200 Mise en place du boot de l'application web (configuration, mapping, ...) (See 7494) commit 1c7955d20cec577a1ad011233c26ad0a32a4810d Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 29 16:07:50 2015 +0200 Rendre fermables les usines de services commit 0ef9322a16f08204fff12502db2a98394fdc0bad Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 29 13:56:08 2015 +0200 Réactivitation des modules reset et de l'application web + Suppression d'objets non utiles et mise à jur de l'api de configuration pour les services rest -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7494 in repository observe. See http://git.codelutin.com/observe.git commit 0ef9322a16f08204fff12502db2a98394fdc0bad Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 29 13:56:08 2015 +0200 Réactivitation des modules reset et de l'application web + Suppression d'objets non utiles et mise à jur de l'api de configuration pour les services rest --- .../ObserveDataSourceConfigurationRest.java | 23 +++++++++++ .../services/ObserveServiceContextRest.java | 47 ---------------------- .../ird/observe/services/ObserveServiceRest.java | 20 --------- pom.xml | 8 ++-- 4 files changed, 27 insertions(+), 71 deletions(-) diff --git a/observe-services-configuration-rest/src/main/java/fr/ird/observe/services/configuration/ObserveDataSourceConfigurationRest.java b/observe-services-configuration-rest/src/main/java/fr/ird/observe/services/configuration/ObserveDataSourceConfigurationRest.java index 50226ce..1f637fc 100644 --- a/observe-services-configuration-rest/src/main/java/fr/ird/observe/services/configuration/ObserveDataSourceConfigurationRest.java +++ b/observe-services-configuration-rest/src/main/java/fr/ird/observe/services/configuration/ObserveDataSourceConfigurationRest.java @@ -9,6 +9,13 @@ import java.net.URL; */ public class ObserveDataSourceConfigurationRest implements ObserveDataSourceConfiguration { + private static final long serialVersionUID = 1L; + + /** + * Le libellé de la data source. + */ + protected String label; + /** * L'url du serveur à utiliser. */ @@ -19,6 +26,15 @@ public class ObserveDataSourceConfigurationRest implements ObserveDataSourceConf */ protected String authenticationToken; + @Override + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + public URL getServerUrl() { return serverUrl; } @@ -34,4 +50,11 @@ public class ObserveDataSourceConfigurationRest implements ObserveDataSourceConf public void setAuthenticationToken(String authenticationToken) { this.authenticationToken = authenticationToken; } + + @Override + public boolean datasourceExists() { + //TODO + return false; + } + } diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceContextRest.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceContextRest.java deleted file mode 100644 index 926a7dc..0000000 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceContextRest.java +++ /dev/null @@ -1,47 +0,0 @@ -package fr.ird.observe.services; - -import fr.ird.observe.services.configuration.ObserveDataSourceConfigurationRest; -import fr.ird.observe.services.dto.constants.ReferentialLocale; - -import java.net.URL; -import java.util.Date; - -/** - * Created on 16/08/15. - * - * @author Tony Chemit - chemit@codelutin.com - */ -public class ObserveServiceContextRest implements ObserveServiceContext { - - protected ObserveServiceApplicationContext applicationContext; - - protected ObserveDataSourceConfigurationRest dataSourceConfiguration; - - @Override - public ReferentialLocale getReferentialLocale() { - return applicationContext.getReferentialLocale(); - } - - @Override - public Date now() { - return new Date(); - } - - public void setDataSourceConfiguration(ObserveDataSourceConfigurationRest dataSourceConfiguration) { - this.dataSourceConfiguration = dataSourceConfiguration; - } - - public void setApplicationContext(ObserveServiceApplicationContext applicationContext) { - this.applicationContext = applicationContext; - } - - public URL getServicesRemoteBaseUrl() { - return dataSourceConfiguration.getServerUrl(); - } - - public String getAuthenticationToken() { - return dataSourceConfiguration.getAuthenticationToken(); - } - - -} diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRest.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRest.java deleted file mode 100644 index 4a9b000..0000000 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRest.java +++ /dev/null @@ -1,20 +0,0 @@ -package fr.ird.observe.services; - -/** - * Created on 16/08/15. - * - * @author Tony Chemit - chemit@codelutin.com - */ -public class ObserveServiceRest implements ObserveService { - - protected ObserveServiceContextRest serviceContext; - - public void setServiceContext(ObserveServiceContextRest serviceContext) { - this.serviceContext = serviceContext; - } - - @Override - public void setServiceContext(ObserveServiceContext serviceContext) { - - } -} diff --git a/pom.xml b/pom.xml index 32c0ab1..56b2d70 100644 --- a/pom.xml +++ b/pom.xml @@ -89,10 +89,10 @@ <!--<module>observe-validation</module>--> <module>observe-services-configuration-topia</module> <module>observe-services-topia</module> - <!--<module>observe-services-configuration-rest</module>--> - <!--<module>observe-services-rest</module>--> - <!--<module>observe-services-runner</module>--> - <!--<module>observe-application-web</module>--> + <module>observe-services-configuration-rest</module> + <module>observe-services-rest</module> + <module>observe-services-runner</module> + <module>observe-application-web</module> <!--<module>observe-application-swing</module>--> </modules> <!--scm> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7494 in repository observe. See http://git.codelutin.com/observe.git commit 1c7955d20cec577a1ad011233c26ad0a32a4810d Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 29 16:07:50 2015 +0200 Rendre fermables les usines de services --- .../java/fr/ird/observe/services/ObserveServiceFactory.java | 6 +++++- .../fr/ird/observe/services/ObserveServiceFactoryRest.java | 5 +++++ .../fr/ird/observe/services/ObserveServiceMainFactory.java | 12 ++++++++++-- .../fr/ird/observe/services/ObserveServiceFactoryTopia.java | 3 +-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/observe-services-api/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java b/observe-services-api/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java index 9ec36b0..b5ab0e5 100644 --- a/observe-services-api/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java +++ b/observe-services-api/src/main/java/fr/ird/observe/services/ObserveServiceFactory.java @@ -2,15 +2,19 @@ package fr.ird.observe.services; import fr.ird.observe.services.configuration.ObserveDataSourceConfiguration; +import java.io.Closeable; + /** * Created on 5/4/15. * * @author Tony Chemit - chemit@codelutin.com */ -public interface ObserveServiceFactory { +public interface ObserveServiceFactory extends Closeable { <S extends ObserveService> boolean accept(ObserveDataSourceConfiguration dataSourceConfiguration, Class<S> serviceType); <S extends ObserveService> S newService(ObserveServiceApplicationContext applicationContext, ObserveDataSourceConfiguration dataSourceConfiguration, Class<S> serviceType); + @Override + void close(); } diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java index 11fc3d3..292c0c9 100644 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java @@ -58,6 +58,11 @@ public class ObserveServiceFactoryRest extends ObserveServiceFactorySupport { } + @Override + public void close() { + //TODO Voir ce qu'il faut nettoyer, normalement pas grand chose + } + protected <S extends ObserveService> S newRemoteProxyServiceInstance(Class<S> serviceType, ObserveDataSourceConfigurationRest dataSourceConfigurationRest) { String authenticationToken = dataSourceConfigurationRest.getAuthenticationToken(); diff --git a/observe-services-runner/src/main/java/fr/ird/observe/services/ObserveServiceMainFactory.java b/observe-services-runner/src/main/java/fr/ird/observe/services/ObserveServiceMainFactory.java index eb2d31d..3d3c462 100644 --- a/observe-services-runner/src/main/java/fr/ird/observe/services/ObserveServiceMainFactory.java +++ b/observe-services-runner/src/main/java/fr/ird/observe/services/ObserveServiceMainFactory.java @@ -6,6 +6,7 @@ import fr.ird.observe.services.configuration.ObserveDataSourceConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.io.Closeable; import java.util.ServiceLoader; /** @@ -13,7 +14,7 @@ import java.util.ServiceLoader; * * @author Tony Chemit - chemit@codelutin.com */ -public class ObserveServiceMainFactory implements ObserveServiceFactory { +public class ObserveServiceMainFactory implements ObserveServiceFactory, Closeable { /** Logger. */ private static final Log log = LogFactory.getLog(ObserveServiceMainFactory.class); @@ -58,6 +59,14 @@ public class ObserveServiceMainFactory implements ObserveServiceFactory { } + @Override + public void close() { + + for (ObserveServiceFactory delegateFactory : delegateFactories) { + delegateFactory.close(); + } + } + protected ObserveServiceMainFactory() { if (log.isInfoEnabled()) { log.info("Init MainServiceFactory."); @@ -88,5 +97,4 @@ public class ObserveServiceMainFactory implements ObserveServiceFactory { return result; } - } \ No newline at end of file diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveServiceFactoryTopia.java b/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveServiceFactoryTopia.java index 3b015e3..c25033f 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveServiceFactoryTopia.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveServiceFactoryTopia.java @@ -13,7 +13,6 @@ import fr.ird.observe.services.spi.Write; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.io.Closeable; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -24,7 +23,7 @@ import java.util.Set; * * @author Tony Chemit - chemit@codelutin.com */ -public class ObserveServiceFactoryTopia extends ObserveServiceFactorySupport implements Closeable { +public class ObserveServiceFactoryTopia extends ObserveServiceFactorySupport { /** Logger. */ private static final Log log = LogFactory.getLog(ObserveServiceFactoryTopia.class); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7494 in repository observe. See http://git.codelutin.com/observe.git commit b65d39b7c8cfed17ee12c31cdc0b7e9671cbd8d6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Aug 30 09:37:17 2015 +0200 Mise en place du boot de l'application web (configuration, mapping, ...) (See 7494) --- observe-application-web/pom.xml | 86 ++++++++- .../src/jetty/jetty-context.xml | 10 + .../web/ObserveWebApplicationContext.java | 48 +++-- .../web/ObserveWebApplicationContextInjector.java | 53 ++++++ .../web/ObserveWebApplicationListener.java | 7 +- .../application/web/ObserveWebMotionRender.java | 4 +- .../ObserveWebApplicationConfiguration.java | 208 +++++++++++++++++++++ ...veWebApplicationConfigurationInitException.java | 19 ++ .../ObserveWebApplicationConfigurationOption.java | 110 +++++++++++ ...ObserveWebApplicationConfigurationProvider.java | 39 ++++ .../web/controller/v1/DocController.java | 41 ++++ .../org.nuiton.config.ApplicationConfigProvider | 1 + .../src/main/resources/log4j.properties | 13 ++ observe-application-web/src/main/resources/mapping | 38 +++- .../src/main/resources/observeweb-log4j.conf | 21 +++ .../src/main/resources/observeweb.conf | 4 + pom.xml | 100 +++++++--- 17 files changed, 742 insertions(+), 60 deletions(-) diff --git a/observe-application-web/pom.xml b/observe-application-web/pom.xml index de1c0da..ed03924 100644 --- a/observe-application-web/pom.xml +++ b/observe-application-web/pom.xml @@ -14,7 +14,14 @@ <name>ObServe :: Application Web</name> <description>ObServe Application Web</description> + <packaging>war</packaging> + <properties> + + <!-- Webapp configuration --> + <defaultWebContextPath>observeweb</defaultWebContextPath> + + </properties> <dependencies> <!-- sibling dependencies --> @@ -108,14 +115,24 @@ <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> <artifactId>slf4j-jcl</artifactId> - <scope>runtime</scope> + <scope>test</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - <scope>runtime</scope> + <scope>compile</scope> </dependency> <!-- test dependencies --> @@ -125,8 +142,71 @@ <artifactId>junit</artifactId> </dependency> - </dependencies> + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>observeweb.conf</include> + <include>mapping</include> + </includes> + <filtering>true</filtering> + </resource> + <resource> + <directory>src/main/resources</directory> + <excludes> + <exclude>observeweb.conf</exclude> + </excludes> + </resource> + </resources> + + <plugins> + + </plugins> + + <pluginManagement> + <plugins> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <configuration> + <stopKey>B</stopKey> + <stopPort>1270</stopPort> + <contextXml>${basedir}/src/jetty/jetty-context.xml</contextXml> + <webAppConfig> + <contextPath>/${defaultWebContextPath}</contextPath> + </webAppConfig> + <!--systemProperties> + <systemProperty> + <name>testDirectory</name> + <value>${defaultLogDir}</value> + </systemProperty> + <systemProperty> + <name>pollen.data.directory</name> + <value>${defaultDbDir}</value> + </systemProperty> + </systemProperties--> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.tomcat.maven</groupId> + <artifactId>tomcat7-maven-plugin</artifactId> + <configuration> + <path>/${defaultWebContextPath}</path> + <!--systemProperties> + <pollen.data.directory>${defaultDbDir}</pollen.data.directory> + <pollen.log.dir>${defaultLogDir}</pollen.log.dir> + </systemProperties--> + <uriEncoding>UTF-8</uriEncoding> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + </build> + </project> \ No newline at end of file diff --git a/observe-application-web/src/jetty/jetty-context.xml b/observe-application-web/src/jetty/jetty-context.xml new file mode 100644 index 0000000..164ccdd --- /dev/null +++ b/observe-application-web/src/jetty/jetty-context.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> + +<Configure class="org.eclipse.jetty.webapp.WebAppContext"> + <Call name="setAttribute"> + <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg> + <Arg>.*/.*webmotion.*[^/]\.jar$</Arg> + </Call> +</Configure> \ No newline at end of file diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContext.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContext.java index cd39ff0..1e8dbab 100644 --- a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContext.java +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContext.java @@ -1,6 +1,7 @@ package fr.ird.observe.application.web; import com.google.common.base.Preconditions; +import fr.ird.observe.application.web.configuration.ObserveWebApplicationConfiguration; import fr.ird.observe.services.ObserveServiceApplicationContext; import fr.ird.observe.services.ObserveServiceFactory; import fr.ird.observe.services.ObserveServiceMainFactory; @@ -8,11 +9,12 @@ import fr.ird.observe.services.dto.gson.ObserveDtoGsonSupplier; import org.debux.webmotion.server.call.HttpContext; import javax.servlet.ServletContext; +import java.io.Closeable; /** * @author Tony Chemit : chemit@codelutin.com */ -public class ObserveWebApplicationContext extends ObserveServiceApplicationContext { +public class ObserveWebApplicationContext extends ObserveServiceApplicationContext implements Closeable { public static final String APPLICATION_CONTEXT_PARAMETER = ObserveWebApplicationContext.class.getName(); @@ -24,6 +26,8 @@ public class ObserveWebApplicationContext extends ObserveServiceApplicationConte protected ObserveServiceFactory serviceFactory; + protected ObserveWebApplicationConfiguration applicationConfiguration; + protected static ObserveWebApplicationContext getApplicationContext(HttpContext context) { ServletContext servletContext = context.getServletContext(); @@ -37,42 +41,29 @@ public class ObserveWebApplicationContext extends ObserveServiceApplicationConte } -// protected ObserveServiceConfig serviceConfig; -// -// protected ObserveTopiaApplicationContext rootContext; - public void init() { - gsonSupplier = new ObserveDtoGsonSupplier(); + // init configuration + applicationConfiguration = new ObserveWebApplicationConfiguration(); + applicationConfiguration.init(); + + boolean devMode = applicationConfiguration.isDevMode(); + gsonSupplier = new ObserveDtoGsonSupplier(devMode); //FIXME Demander a la main factory directement la factory de topia serviceFactory = ObserveServiceMainFactory.get(); -// ObserveServiceConfig config = new ObserveServiceConfig(null); -// serviceConfig = config; -// Properties rootProperties = serviceConfig.getFlatOptions(); -// rootProperties.setProperty(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, ObserveEntityEnum.getImplementationClassesAsString()); -// -// rootContext = TopiaApplicationContextCache.getContext(rootProperties, ObserveConfigurationHelper.getCreateTopiaContextFunction(config)); } -// public ObserveServiceConfig getServiceConfig() { -// return serviceConfig; -// } + @Override + public void close() { -// public ObserveTopiaPersistenceContext newTransaction() { -// ObserveTopiaPersistenceContext persistenceContext = rootContext.newPersistenceContext(); -// return persistenceContext; -// } + // Supprimer le cache des sessions + //TODO - public void close() { -// if (rootContext != null) { -// rootContext.closeContext(); -// } - } + // Fermer l'usine de services + serviceFactory.close(); - public boolean isDevMode() { - return true; } public ObserveServiceFactory getServiceFactory() { @@ -82,4 +73,9 @@ public class ObserveWebApplicationContext extends ObserveServiceApplicationConte public ObserveDtoGsonSupplier getGsonSupplier() { return gsonSupplier; } + + public ObserveWebApplicationConfiguration getApplicationConfiguration() { + return applicationConfiguration; + } + } diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContextInjector.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContextInjector.java new file mode 100644 index 0000000..f585e23 --- /dev/null +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationContextInjector.java @@ -0,0 +1,53 @@ +package fr.ird.observe.application.web; + +/* + * #%L + * Pollen :: Rest Api + * %% + * Copyright (C) 2009 - 2014 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import org.debux.webmotion.server.call.Call; +import org.debux.webmotion.server.call.HttpContext; +import org.debux.webmotion.server.handler.ExecutorParametersInjectorHandler; +import org.debux.webmotion.server.mapping.Mapping; + +import java.lang.reflect.Type; + +/** + * Created on 5/23/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 2.0 + */ +public class ObserveWebApplicationContextInjector implements ExecutorParametersInjectorHandler.Injector { + + @Override + public ObserveWebApplicationContext getValue(Mapping m, Call call, String name, Class type, Type generic) { + + ObserveWebApplicationContext result = null; + if (ObserveWebApplicationContext.class.isAssignableFrom(type)) { + + HttpContext httpContext = call.getContext(); + result = ObserveWebApplicationContext.getApplicationContext(httpContext); + + } + + return result; + + } +} diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationListener.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationListener.java index 52f984d..b304cee 100644 --- a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationListener.java +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebApplicationListener.java @@ -18,15 +18,18 @@ public class ObserveWebApplicationListener implements WebMotionServerListener { @Override public void onStart(Mapping mapping, ServerContext context) { - if (log.isInfoEnabled()) { log.info("Initializing " + ObserveWebApplicationListener.class.getName()); } + context.addInjector(new ObserveWebApplicationContextInjector()); + context.addInjector(new ObserveServiceInjector()); + applicationContext = new ObserveWebApplicationContext(); applicationContext.init(); - context.addInjector(new ObserveServiceInjector()); + context.getServletContext().setAttribute( + ObserveWebApplicationContext.APPLICATION_CONTEXT_PARAMETER, applicationContext); } diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebMotionRender.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebMotionRender.java index f50f873..e1784d1 100644 --- a/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebMotionRender.java +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/ObserveWebMotionRender.java @@ -39,9 +39,7 @@ public class ObserveWebMotionRender<T> extends Render { // response.setStatus(HttpServletResponse.SC_BAD_REQUEST); // // } - - boolean devMode = applicationContext.isDevMode(); - + applicationContext.getGsonSupplier(); Gson gson = applicationContext.getGsonSupplier().get(); diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfiguration.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfiguration.java new file mode 100644 index 0000000..315596d --- /dev/null +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfiguration.java @@ -0,0 +1,208 @@ +package fr.ird.observe.application.web.configuration; + +import com.google.common.base.Charsets; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.log4j.LogManager; +import org.apache.log4j.PropertyConfigurator; +import org.nuiton.config.ApplicationConfig; +import org.nuiton.config.ApplicationConfigHelper; +import org.nuiton.config.ApplicationConfigProvider; +import org.nuiton.config.ArgumentsParserException; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +/** + * La configuration de l'application web. + * + * Created on 29/08/15. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class ObserveWebApplicationConfiguration { + + /** Logger. */ + private static Log log = LogFactory.getLog(ObserveWebApplicationConfiguration.class); + + protected static final String DEFAULT_OBSERVE_WEB_CONF = "observeweb.conf"; + + private final ApplicationConfig applicationConfig; + + private File baseDirectory; + + + public ObserveWebApplicationConfiguration() { + this(DEFAULT_OBSERVE_WEB_CONF); + } + + public ObserveWebApplicationConfiguration(String confFileName) { + applicationConfig = new ApplicationConfig(); + applicationConfig.setEncoding(Charsets.UTF_8.name()); + applicationConfig.setConfigFileName(confFileName); + ApplicationConfigProvider applicationConfigProvider = ApplicationConfigHelper.getProvider(getClass().getClassLoader(), ObserveWebApplicationConfigurationProvider.OBSERVE_WEB_CONFIGURATION_PROVIDER_NAME); + applicationConfig.loadDefaultOptions(applicationConfigProvider.getOptions()); + + if (isDevMode()) { + + // on utilise un répertoire temporaire comme basedir + File basedir; + + try { + Set<PosixFilePermission> posixFilePermissions = PosixFilePermissions.fromString("rwxr-x---"); + FileAttribute<Set<PosixFilePermission>> fileAttribute = PosixFilePermissions.asFileAttribute(posixFilePermissions); + basedir = Files.createTempDirectory("observeweb", fileAttribute).toFile(); + } catch (IOException e) { + throw new ObserveWebApplicationConfigurationInitException("could not create temporary basedir", e); + } + if (log.isInfoEnabled()) { + log.info("Dev mode detected, use temporary basedir: " + basedir); + } + applicationConfig.setOption(ObserveWebApplicationConfigurationOption.BASE_DIRECTORY.getKey(), basedir.getAbsolutePath()); + + } + } + + public boolean isDevMode() { + return applicationConfig.getOptionAsBoolean(ObserveWebApplicationConfigurationOption.DEV_MODE.getKey()); + } + + public File getBaseDirectory() { + return applicationConfig.getOptionAsFile(ObserveWebApplicationConfigurationOption.BASE_DIRECTORY.getKey()); + } + + public File getTemporaryDirectory() { + return applicationConfig.getOptionAsFile(ObserveWebApplicationConfigurationOption.TEMPORARY_DIRECTORY.getKey()); + } + + public File getDatabasesConfigurationFile() { + return applicationConfig.getOptionAsFile(ObserveWebApplicationConfigurationOption.DATABASES_CONFIGURATION_FILE.getKey()); + } + + public File getUsersConfigurationFile() { + return applicationConfig.getOptionAsFile(ObserveWebApplicationConfigurationOption.USERS_CONFIGURATION_FILE.getKey()); + } + + public int getSessionExpirationDelay() { + return applicationConfig.getOptionAsInt(ObserveWebApplicationConfigurationOption.SESSION_EXPIRATION_DELAY.getKey()); + } + + public void init(String... args) { + + if (log.isInfoEnabled()) { + log.info("Starts to init ObserVeWeb configuration..."); + } + + try { + applicationConfig.parse(args); + } catch (ArgumentsParserException e) { + throw new ObserveWebApplicationConfigurationInitException("could not parse configuration", e); + } + + if (log.isInfoEnabled()) { + String message = getConfigurationDescription(); + log.info(message); + } + + File applicationBaseDirectory = getBaseDirectory(); + try { + createDirectory(applicationBaseDirectory); + } catch (IOException e) { + throw new ObserveWebApplicationConfigurationInitException("Impossible de créer le répertoire principal de l'application (" + applicationBaseDirectory + ")", e); + } + File temporaryDirectory = getTemporaryDirectory(); + try { + createDirectory(temporaryDirectory); + } catch (IOException e) { + throw new ObserveWebApplicationConfigurationInitException("Impossible de créer le répertoire temporaire de l'application (" + temporaryDirectory + ")", e); + } + + if (!isDevMode()) { + initLog(); + } + + } + + public String getConfigurationDescription() { + StringBuilder builder = new StringBuilder(); + builder.append("\n====================================================================================================================="); + builder.append("\n=== Observe Web configuration ======================================================================================="); + builder.append(String.format("\n=== %1$-40s = %2$s", "Filename", applicationConfig.getConfigFileName())); + for (ObserveWebApplicationConfigurationOption option : ObserveWebApplicationConfigurationOption.orderedByNameValues()) { + builder.append(String.format("\n=== %1$-40s = %2$s", option.getKey(), applicationConfig.getOption(option))); + } + builder.append("\n====================================================================================================================="); + return builder.toString(); + } + + protected void createDirectory(File directory) throws IOException { + Set<PosixFilePermission> posixFilePermissions = PosixFilePermissions.fromString("rwxrwx---"); + FileAttribute<Set<PosixFilePermission>> fileAttribute = PosixFilePermissions.asFileAttribute(posixFilePermissions); + Files.createDirectories(directory.toPath(), fileAttribute); + } + + protected void initLog() { + + String logFilePath = applicationConfig.getOption(ObserveWebApplicationConfigurationOption.LOG4J_CONFIGURATION_FILE.getKey()); + + URL resource; + if (logFilePath.startsWith("classpath:")) { + resource = getClass().getResource(logFilePath.substring(10)); + + } else { + File logFile = applicationConfig.getOptionAsFile(ObserveWebApplicationConfigurationOption.LOG4J_CONFIGURATION_FILE.getKey()); + + if (!logFile.exists()) { + throw new ObserveWebApplicationConfigurationInitException("Le fichier de configuration des logs (" + logFile + ") n'existe pas"); + } + + try { + resource = logFile.toURI().toURL(); + } catch (MalformedURLException e) { + + throw new ObserveWebApplicationConfigurationInitException("L'url du fichier de configuration des logs (" + logFile + ") est malformée", e); + + } + + } + + if (log.isInfoEnabled()) { + log.info("Chargement du fichier de de log4j depuis " + resource); + } + + Properties finalLogConfigurationProperties = new Properties(); + try (InputStream inputStream = resource.openStream()) { + + Properties logConfigurationProperties = new Properties(); + logConfigurationProperties.load(inputStream); + + for (Map.Entry<Object, Object> entry : logConfigurationProperties.entrySet()) { + String key = (String) entry.getKey(); + String value = (String) entry.getValue(); + String newValue = applicationConfig.getOption(value); + finalLogConfigurationProperties.setProperty(key, newValue); + } + } catch (IOException e) { + throw new ObserveWebApplicationConfigurationInitException("Impossible de charger le fichier de configuration des logs", e); + } + + LogManager.resetConfiguration(); + PropertyConfigurator.configure(finalLogConfigurationProperties); + + log = LogFactory.getLog(ObserveWebApplicationConfiguration.class); + if (log.isInfoEnabled()) { + log.info("Initialisation de log4j terminées depuis " + logFilePath); + } + + } +} diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationInitException.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationInitException.java new file mode 100644 index 0000000..084fbd4 --- /dev/null +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationInitException.java @@ -0,0 +1,19 @@ +package fr.ird.observe.application.web.configuration; + +/** + * Created on 29/08/15. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class ObserveWebApplicationConfigurationInitException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public ObserveWebApplicationConfigurationInitException(String message) { + super(message); + } + + public ObserveWebApplicationConfigurationInitException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationOption.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationOption.java new file mode 100644 index 0000000..b863bc8 --- /dev/null +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationOption.java @@ -0,0 +1,110 @@ +package fr.ird.observe.application.web.configuration; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.NotImplementedException; +import org.nuiton.config.ConfigOptionDef; +import org.nuiton.util.version.Version; + +import java.io.File; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import static org.nuiton.i18n.I18n.n; + +/** + * La configuration de l'application web. + * + * Created on 29/08/15. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public enum ObserveWebApplicationConfigurationOption implements ConfigOptionDef { + + BUILD_VERSION("observeweb.build.version", n("observeweb.build.version.description"), "", Version.class), + BUILD_DATE("observeweb.build.date", n("observeweb.build.date.description"), "", String.class), + BUILD_NUMBER("observeweb.build.number", n("observeweb.build.number.description"), "", String.class), + + DEV_MODE("observeweb.devMode", n("observeweb.devMode.description"), "true", boolean.class), + BASE_DIRECTORY("observeweb.baseDirectory", n("observeweb.baseDirectory.description"), "/var/local/observeweb", File.class), + TEMPORARY_DIRECTORY("observeweb.temporaryDirectory", n("observeweb.temporaryDirectory.description"), "${observeweb.baseDirectory}/temp", File.class), + LOG4J_CONFIGURATION_FILE("observeweb.log4jConfigurationFile", n("observeweb.log4jConfigurationFile.description"), "${observeweb.baseDirectory}/observeweb-log4j.conf", String.class), + DATABASES_CONFIGURATION_FILE("observeweb.databasesConfigurationFile", n("observeweb.databasesConfigurationFile.description"), "${observeweb.baseDirectory}/databases.yml", File.class), + USERS_CONFIGURATION_FILE("observeweb.usersConfigurationFile", n("observeweb.usersConfigurationFile.description"), "${observeweb.baseDirectory}/users.yml", File.class), + SESSION_EXPIRATION_DELAY("observeweb.sessionExpirationDelay", n("observeweb.sessionExpirationDelay.description"), "60" /* en minutes */, int.class); + + ObserveWebApplicationConfigurationOption(String key, String description, String defaultValue, Class<?> type) { + this.key = key; + this.description = description; + this.defaultValue = defaultValue; + this.type = type; + } + + private final String key; + + private final String description; + + private final String defaultValue; + + private final Class<?> type; + + @Override + public String getKey() { + return key; + } + + @Override + public Class<?> getType() { + return type; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public String getDefaultValue() { + return defaultValue; + } + + @Override + public boolean isTransient() { + return false; + } + + @Override + public boolean isFinal() { + return true; + } + + @Override + public void setDefaultValue(String defaultValue) { + throw new NotImplementedException("Can't invoke setDefaultValue method"); + } + + @Override + public void setTransient(boolean isTransient) { + throw new NotImplementedException("Can't invoke setTransient method"); + } + + @Override + public void setFinal(boolean isFinal) { + throw new NotImplementedException("Can't invoke setFinal method"); + } + + public static ImmutableList<ObserveWebApplicationConfigurationOption> orderedByNameValues() { + + List<ObserveWebApplicationConfigurationOption> values = Lists.newArrayList(values()); + Collections.sort(values, new Comparator<ObserveWebApplicationConfigurationOption>() { + + @Override + public int compare(ObserveWebApplicationConfigurationOption o1, ObserveWebApplicationConfigurationOption o2) { + return o1.getKey().compareTo(o2.getKey()); + } + }); + return ImmutableList.copyOf(values); + + } +} diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationProvider.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationProvider.java new file mode 100644 index 0000000..629ebe9 --- /dev/null +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/configuration/ObserveWebApplicationConfigurationProvider.java @@ -0,0 +1,39 @@ +package fr.ird.observe.application.web.configuration; + +import org.nuiton.config.ApplicationConfigProvider; +import org.nuiton.config.ConfigActionDef; +import org.nuiton.config.ConfigOptionDef; + +import java.util.Locale; + +import static org.nuiton.i18n.I18n.l; + +/** + * Created on 29/08/15. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class ObserveWebApplicationConfigurationProvider implements ApplicationConfigProvider { + + public static final String OBSERVE_WEB_CONFIGURATION_PROVIDER_NAME = "observeWeb"; + + @Override + public String getName() { + return OBSERVE_WEB_CONFIGURATION_PROVIDER_NAME; + } + + @Override + public String getDescription(Locale locale) { + return l(locale, "observeweb.configuration.description"); + } + + @Override + public ConfigOptionDef[] getOptions() { + return ObserveWebApplicationConfigurationOption.values(); + } + + @Override + public ConfigActionDef[] getActions() { + return new ConfigActionDef[0]; + } +} diff --git a/observe-application-web/src/main/java/fr/ird/observe/application/web/controller/v1/DocController.java b/observe-application-web/src/main/java/fr/ird/observe/application/web/controller/v1/DocController.java new file mode 100644 index 0000000..821819b --- /dev/null +++ b/observe-application-web/src/main/java/fr/ird/observe/application/web/controller/v1/DocController.java @@ -0,0 +1,41 @@ +package fr.ird.observe.application.web.controller.v1; + +import fr.ird.observe.application.web.ObserveWebApplicationContext; +import org.apache.commons.io.IOUtils; +import org.debux.webmotion.server.WebMotionController; +import org.debux.webmotion.server.render.Render; + +import java.io.IOException; +import java.io.InputStream; + +/** + * Created on 8/30/15. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class DocController extends WebMotionController { + + public Render mapping() { + + InputStream mappingUrl = getClass().getResourceAsStream("/mapping"); + + try { + + String content = IOUtils.toString(mappingUrl); + return renderContent(content, "text/plain"); + + } catch (IOException e) { + + throw new RuntimeException(e); + + } + + } + + public Render configuration(ObserveWebApplicationContext applicationContext) { + + String content = applicationContext.getApplicationConfiguration().getConfigurationDescription(); + return renderContent(content, "text/plain"); + + } +} diff --git a/observe-application-web/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider b/observe-application-web/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider new file mode 100644 index 0000000..e923a49 --- /dev/null +++ b/observe-application-web/src/main/resources/META-INF/services/org.nuiton.config.ApplicationConfigProvider @@ -0,0 +1 @@ +fr.ird.observe.application.web.configuration.ObserveWebApplicationConfigurationProvider \ No newline at end of file diff --git a/observe-application-web/src/main/resources/log4j.properties b/observe-application-web/src/main/resources/log4j.properties new file mode 100644 index 0000000..869ef14 --- /dev/null +++ b/observe-application-web/src/main/resources/log4j.properties @@ -0,0 +1,13 @@ + +# Global logging configuration +log4j.rootLogger=WARN, stdout + +# Console output... +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%c:%L) %M - %m%n + +# levels +log4j.logger.fr.ird.observe=DEBUG +log4j.logger.org.nuiton=INFO +log4j.logger.org.debux=INFO diff --git a/observe-application-web/src/main/resources/mapping b/observe-application-web/src/main/resources/mapping index 0aa5db6..51e97da 100644 --- a/observe-application-web/src/main/resources/mapping +++ b/observe-application-web/src/main/resources/mapping @@ -1,15 +1,45 @@ +### +# #%L +# ObServe :: Web Application +# %% +# Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/gpl-3.0.html>. +# #L% +### + +# +# Application Version ${project.version} +# Build Date ${buildDate} +# Build Number ${buildNumber} +# + [config] -package.base=fr.ird.observe.application.web.controller +package.filters=fr.ird.observe.application.web package.actions=fr.ird.observe.application.web.controller.v1 package.errors=fr.ird.observe.application.web.controller.v1 server.controller.scope=request -server.listener.class=fr.ird.observe.services.rest.wm.ObserveServerListener +server.listener.class=fr.ird.observe.application.web.ObserveWebApplicationListener default.render=fr.ird.observe.application.web.ObserveWebMotionRender [filters] -* /* ObserveWebMotionFilter.inject +* /* ObserveWebMotionFilter.inject [actions] -GET,POST /api/v1/referential/{method} action:ReferentialServiceController.{method} + +GET /api/v1/doc/{method} DocController.{method} +GET,POST /api/v1/referential/{method} ReferentialServiceController.{method} diff --git a/observe-application-web/src/main/resources/observeweb-log4j.conf b/observe-application-web/src/main/resources/observeweb-log4j.conf new file mode 100644 index 0000000..2d6733f --- /dev/null +++ b/observe-application-web/src/main/resources/observeweb-log4j.conf @@ -0,0 +1,21 @@ + +# Global logging configuration +log4j.rootLogger=WARN, stdout, file + +# Console output... +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%c:%L) %M - %m%n + +# file output... +log4j.appender.file=org.apache.log4j.RollingFileAppender +log4j.appender.file.File=${observeweb.baseDirectory}/log/observeweb-${observeweb.version}.log +log4j.appender.file.MaxFileSize=10MB +log4j.appender.file.MaxBackupIndex=4 +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %5p [%t] (%c:%L) %M - %m%n + +# levels + +log4j.logger.fr.ird.observe=INFO +log4j.logger.org.nuiton.topia.migration=INFO diff --git a/observe-application-web/src/main/resources/observeweb.conf b/observe-application-web/src/main/resources/observeweb.conf new file mode 100644 index 0000000..0284992 --- /dev/null +++ b/observe-application-web/src/main/resources/observeweb.conf @@ -0,0 +1,4 @@ +observeweb.devMode=${devMode} +observeweb.build.version=${project.version} +observeweb.build.date=${buildDate} +observeweb.build.number=${buildNumber} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 56b2d70..21929c6 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,8 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --> -<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"> +<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> <parent> @@ -95,13 +96,13 @@ <module>observe-application-web</module> <!--<module>observe-application-swing</module>--> </modules> -<!--scm> - <url>https://svn.mpl.ird.fr/osiris/observe/trunk</url> - <connection>scm:svn:https://svn.mpl.ird.fr/osiris/observe/trunk</connection> - <developerConnection> - scm:svn:https://svn.mpl.ird.fr/osiris/observe/trunk - </developerConnection> - </scm--> + <!--scm> + <url>https://svn.mpl.ird.fr/osiris/observe/trunk</url> + <connection>scm:svn:https://svn.mpl.ird.fr/osiris/observe/trunk</connection> + <developerConnection> + scm:svn:https://svn.mpl.ird.fr/osiris/observe/trunk + </developerConnection> + </scm--> <scm> <url>https://gitweb.codelutin.com/observe.git</url> <connection>scm:git:http://git.codelutin.com/observe.git</connection> @@ -146,6 +147,10 @@ <!-- Site configuration --> <locales>fr</locales> + <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> + <buildDate>${maven.build.timestamp}</buildDate> + <devMode>true</devMode> + </properties> <repositories> @@ -250,12 +255,6 @@ </dependency> <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.17</version> - </dependency> - - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> @@ -597,6 +596,21 @@ <!-- logging --> <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.17</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${sl4jVersion}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${sl4jVersion}</version> + </dependency> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jcl</artifactId> <version>${sl4jVersion}</version> @@ -636,6 +650,26 @@ </dependencyManagement> <build> + + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>create</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + <configuration> + <doCheck>false</doCheck> + <doUpdate>false</doUpdate> + </configuration> + </plugin> + </plugins> + <pluginManagement> <plugins> @@ -692,6 +726,12 @@ </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <version>1.3</version> + </plugin> + + <plugin> <groupId>com.thoughtworks.paranamer</groupId> <artifactId>paranamer-maven-plugin</artifactId> <version>${paranamerVersion}</version> @@ -716,6 +756,19 @@ <profiles> <profile> + <id>no-devmode</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <properties> + <devMode>false</devMode> + </properties> + </profile> + + <profile> <id>central-safe</id> <activation> <property> @@ -773,13 +826,14 @@ <configuration> <!-- TODO chemit 2011-02-24 Change to 'target' when using ant-run 1.6 in mavenpom4labs... --> <tasks> - <echo message="Copy model to site" /> - <copy verbose="${maven.verbose}" failonerror="false" overwrite="true" todir="${project.reporting.outputDirectory}/model"> + <echo message="Copy model to site"/> + <copy verbose="true" failonerror="false" overwrite="true" + todir="${project.reporting.outputDirectory}/model"> <fileset dir="${basedir}/doc/modelisation"> - <include name="**/*.pdf" /> + <include name="**/*.pdf"/> </fileset> <fileset dir="${basedir}/observe-entities/src/main/xmi"> - <include name="**/*.zargo" /> + <include name="**/*.zargo"/> </fileset> </copy> </tasks> @@ -794,9 +848,10 @@ <phase>pre-site</phase> <configuration> <tasks> - <copy todir="${project.reporting.outputDirectory}" verbose="${maven.verbose}" failonerror="false" overwrite="false"> + <copy todir="${project.reporting.outputDirectory}" verbose="true" failonerror="false" + overwrite="false"> <fileset dir="observe-validation/src/main/java"> - <include name="**/*-validation.xml" /> + <include name="**/*-validation.xml"/> </fileset> </copy> </tasks> @@ -811,9 +866,10 @@ <phase>pre-site</phase> <configuration> <tasks> - <copy todir="${project.reporting.outputDirectory}" verbose="${maven.verbose}" failonerror="false" overwrite="false"> + <copy todir="${project.reporting.outputDirectory}" verbose="true" failonerror="false" + overwrite="false"> <fileset dir="observe-validation/src/main/resources"> - <include name="validators.xml" /> + <include name="validators.xml"/> </fileset> </copy> </tasks> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm