From ffe8487350a595013903353c9640499637f00f46 Mon Sep 17 00:00:00 2001 From: mbarto Date: Mon, 27 Mar 2017 15:10:04 +0200 Subject: [PATCH] Updated maven build for the projects (#1643) * Updated maven build for the projects * Added build bash script --- project/build.sh | 7 + project/pom.xml | 254 ------------------ project/prod-webpack.config.js | 3 +- project/web/pom.xml | 169 ++++++------ .../webapp/WEB-INF/applicationContext.xml | 16 -- .../webapp/WEB-INF/mvc-dispatcher-servlet.xml | 35 --- project/web/src/main/webapp/WEB-INF/web.xml | 74 +++-- project/webpack.config.js | 2 +- 8 files changed, 123 insertions(+), 437 deletions(-) create mode 100644 project/build.sh delete mode 100644 project/web/src/main/webapp/WEB-INF/applicationContext.xml delete mode 100644 project/web/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml diff --git a/project/build.sh b/project/build.sh new file mode 100644 index 0000000000..92f9f11a6a --- /dev/null +++ b/project/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +npm install +npm run compile +npm run lint +mvn clean install diff --git a/project/pom.xml b/project/pom.xml index 4f9ea57b3f..e0519a9064 100644 --- a/project/pom.xml +++ b/project/pom.xml @@ -10,268 +10,14 @@ UTF-8 - - 3.0.5.RELEASE - 3.0.5.RELEASE - 1.7.2 - 1.2.14 - 2.5 - 1.2 - 1.9.10 - 2.2.3 - 2.5.3 - - 4.8.1 - 1.9.5 - - - - - geosolutions - GeoSolutions Repository - http://maven.geo-solutions.it - - true - - - - - - osgeo - OsGEO Repository - http://download.osgeo.org/webdav/geotools/ - - - boundless - Boundless Maven Repository - http://repo.boundlessgeo.com/main - - true - - - - - - - - - - - log4j - log4j - ${log4j.version} - - - org.slf4j - slf4j-log4j12 - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.slf4j - slf4j-api - ${slf4j.version} - - - - - - - javax.servlet - servlet-api - ${servlet-api.version} - provided - - - jstl - jstl - ${jstl.version} - - - - - - - - - org.springframework - spring-core - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - org.springframework - spring-context-support - ${spring.version} - - - org.springframework - spring-web - ${spring.version} - - - org.springframework - spring-webmvc - ${spring.version} - - - org.springframework - spring-remoting - ${spring.version} - - - org.springframework - spring-test - ${spring.version} - - - - - - org.springframework.security - spring-security-core - ${spring.security.version} - - - org.springframework.security - spring-security-web - ${spring.security.version} - - - org.springframework.security - spring-security-config - ${spring.security.version} - - - - org.codehaus.jackson - jackson-mapper-asl - ${jackson.version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson.annotations-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.databind-version} - - - - - - junit - junit - test - ${junit.version} - - - org.mockito - mockito-core - ${mockito.version} - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.2 - - 1.7 - 1.7 - UTF-8 - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.6 - - UTF-8 - - - - - true - org.apache.maven.plugins - maven-source-plugin - 2.4 - - true - - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - 2.4.2 - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - - test-jar - - - - - - - - geostore - - - MapStore2/geostore/src - - - - - - proxy - - - MapStore2/http-proxy - - - - - web - backend diff --git a/project/prod-webpack.config.js b/project/prod-webpack.config.js index aafd99c648..d2e7317ffa 100644 --- a/project/prod-webpack.config.js +++ b/project/prod-webpack.config.js @@ -5,7 +5,6 @@ var ParallelUglifyPlugin = require("webpack-parallel-uglify-plugin"); var DefinePlugin = require("webpack/lib/DefinePlugin"); var NormalModuleReplacementPlugin = require("webpack/lib/NormalModuleReplacementPlugin"); const extractThemesPlugin = require('./MapStore2/themes.js').extractThemesPlugin; -var assign = require('object-assign'); var CopyWebpackPlugin = require('copy-webpack-plugin'); webpackConfig.plugins = [ @@ -17,7 +16,7 @@ webpackConfig.plugins = [ options: { postcss: { plugins: [ - require('postcss-prefix-selector')({prefix: '.__PROJECTNAME__', exclude: ['.__PROJECTNAME__']}) + require('postcss-prefix-selector')({prefix: '.__PROJECTNAME__', exclude: ['.__PROJECTNAME__', '.ms2']}) ] }, context: __dirname diff --git a/project/web/pom.xml b/project/web/pom.xml index 423188a04f..ca79e4baa5 100644 --- a/project/web/pom.xml +++ b/project/web/pom.xml @@ -16,21 +16,13 @@ - - - - - it.geosolutions.__PROJECTNAME__ - __PROJECTNAME__-backend - ${project.version} - it.geosolutions.geostore geostore-webapp - 1.3-SNAPSHOT + 1.4-SNAPSHOT war runtime @@ -45,85 +37,32 @@ junit junit + test + 4.4 + + + + org.mockito + mockito-all + 1.9.5 + test + + + + javax.servlet + servlet-api + 2.5 __PROJECTNAME__ - - com.github.eirslett - frontend-maven-plugin - 0.0.24 - - - - install node and npm - - install-node-and-npm - - - v0.12.4 - 2.10.1 - .. - - - - - npm install - - npm - - - - install - .. - - - - - npm run compile - - npm - - - - run compile - .. - - - - - npm run lint - - npm - - test - - - run lint - .. - - - - - npm test - - npm - - test - - - run mvntest - .. - - - - maven-resources-plugin + 2.6 html, configuration files and images @@ -138,9 +77,10 @@ ${basedir}/.. - *.html - *.json - img/* + **/*.html + **/*.json + **/img/* + **/*.less MapStore2/* @@ -219,18 +159,10 @@ it.geosolutions.geostore geostore-webapp - - WEB-INF/lib/commons-logging-* - proxy http_proxy - - WEB-INF/lib/commons-codec-* - WEB-INF/lib/commons-logging-* - WEB-INF/lib/log4j-* - @@ -257,4 +189,63 @@ + + + + geosolutions + GeoSolutions Repository + http://maven.geo-solutions.it + + true + + + + + + maven2-repository.dev.java.net + Java.net Repository for Maven + http://download.java.net/maven/2/ + default + + false + + + + + + jboss-repo + JBoss Maven2 Repository + http://repository.jboss.com/maven2 + + false + + + + + + spring-release + Spring Portfolio Release Repository + http://maven.springframework.org/release + + false + + + + spring-external + Spring Portfolio External Repository + http://maven.springframework.org/external + + false + + + + + osgeo + Open Source Geospatial Foundation Repository + http://download.osgeo.org/webdav/geotools/ + + true + + + diff --git a/project/web/src/main/webapp/WEB-INF/applicationContext.xml b/project/web/src/main/webapp/WEB-INF/applicationContext.xml deleted file mode 100644 index a786c041b4..0000000000 --- a/project/web/src/main/webapp/WEB-INF/applicationContext.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/project/web/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml b/project/web/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml deleted file mode 100644 index e27a4c8eca..0000000000 --- a/project/web/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/project/web/src/main/webapp/WEB-INF/web.xml b/project/web/src/main/webapp/WEB-INF/web.xml index 7efaf48deb..4e299460db 100644 --- a/project/web/src/main/webapp/WEB-INF/web.xml +++ b/project/web/src/main/webapp/WEB-INF/web.xml @@ -1,7 +1,15 @@ - + + + + + contextConfigLocation + + classpath*:applicationContext.xml + + __PROJECTDESCRIPTION__ - Web App webAppRootKey @@ -15,19 +23,27 @@ - org.springframework.web.context.ContextLoaderListener + org.springframework.web.util.Log4jConfigListener - - mvc-dispatcher - org.springframework.web.servlet.DispatcherServlet - 1 - + + + org.springframework.web.context.ContextLoaderListener + - - mvc-dispatcher - /services/* - + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + springSecurityFilterChain + /rest/* + @@ -51,31 +67,9 @@ /proxy/* - - - contextConfigLocation - /WEB-INF/applicationContext.xml - - - - - springSecurityFilterChain - org.springframework.web.filter.DelegatingFilterProxy - - - springSecurityFilterChain - /rest/* - - - - - - - - - - - - + + + index.html + - \ No newline at end of file + diff --git a/project/webpack.config.js b/project/webpack.config.js index 4e26ebcbaa..726ed2d9a4 100644 --- a/project/webpack.config.js +++ b/project/webpack.config.js @@ -28,7 +28,7 @@ module.exports = { options: { postcss: { plugins: [ - require('postcss-prefix-selector')({prefix: '.__PROJECTNAME__', exclude: ['.__PROJECTNAME__']}) + require('postcss-prefix-selector')({prefix: '.__PROJECTNAME__', exclude: ['.ms2', '.__PROJECTNAME__']}) ] }, context: __dirname