Maven local settings
C:\Users\jupiter\.m2
Maven Global settings
C:\apache-maven\conf
Copy C:\apache-maven\conf\settings into C:\Users\jupiter\.m2
Edit and add in settings.xml
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>x.x.x.x</host>
<port>8080</port>
</proxy>
</proxies>
Friday, April 10, 2015
working with properties in pom.xml
pom.xml file
<!-- organizing properties for grouping purposes -->
<properties>
<spring.security.version>3.2.0.RELEASE</spring.security.version>
</properties>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${spring.security.version}</version>
</dependency>
<!-- organizing properties for grouping purposes -->
<properties>
<spring.security.version>3.2.0.RELEASE</spring.security.version>
</properties>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${spring.security.version}</version>
</dependency>
how to Versions Maven Plugin
Versions Maven Plugin
The Versions Plugin is used when you want to manage the versions of artifacts in a project's POM
pom.xml, right click
Run As -> Maven build...
Goals:versions:display-plugin-updates
versions:display-plugin-updates
Displays all plugins that have newer versions available.
[INFO] Require Maven 2.0.1 to use the following plugin updates:
[INFO] maven-war-plugin .............................................. 2.0.2
[INFO]
[INFO] Require Maven 2.0.2 to use the following plugin updates:
[INFO] maven-site-plugin ........................................ 2.0-beta-7
[INFO]
[INFO] Require Maven 2.0.6 to use the following plugin updates:
[INFO] maven-clean-plugin .............................................. 2.5
[INFO] maven-deploy-plugin ........................................... 2.8.1
[INFO] maven-install-plugin .......................................... 2.5.1
[INFO] maven-resources-plugin .......................................... 2.6
[INFO] maven-site-plugin ............................................. 2.0.1
[INFO] maven-surefire-plugin ......................................... 2.4.3
[INFO] maven-war-plugin ................................................ 2.4
[INFO]
[INFO] Require Maven 2.0.9 to use the following plugin updates:
[INFO] maven-compiler-plugin ........................................... 3.1
[INFO] maven-surefire-plugin .......................................... 2.17
[INFO]
[INFO] Require Maven 2.1.0 to use the following plugin updates:
[INFO] maven-site-plugin ............................................. 2.1.1
[INFO]
[INFO] Require Maven 2.2.0 to use the following plugin updates:
[INFO] maven-site-plugin ............................................... 3.0
[INFO]
[INFO] Require Maven 2.2.1 to use the following plugin updates:
[INFO] maven-clean-plugin ............................................ 2.6.1
[INFO] maven-compiler-plugin ........................................... 3.3
[INFO] maven-deploy-plugin ........................................... 2.8.2
[INFO] maven-install-plugin .......................................... 2.5.2
[INFO] maven-resources-plugin .......................................... 2.7
[INFO] maven-site-plugin ............................................... 3.4
[INFO] maven-surefire-plugin ........................................ 2.18.1
[INFO] maven-war-plugin ................................................ 2.6
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:11 min
[INFO] Finished at: 2015-04-10T21:01:09+02:00
[INFO] Final Memory: 9M/21M
[INFO] ------------------------------------------------------------------------
versions:display-dependency-updates
scans a project's dependencies and produces a report of those dependencies which have newer versions available.
versions:use-latest-releases
searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the latest release version.
pom.xml, right click
Run As -> Maven build
choose run options
http://mojo.codehaus.org/versions-maven-plugin/index.html
The Versions Plugin is used when you want to manage the versions of artifacts in a project's POM
pom.xml, right click
Run As -> Maven build...
Goals:versions:display-plugin-updates
versions:display-plugin-updates
Displays all plugins that have newer versions available.
[INFO] Require Maven 2.0.1 to use the following plugin updates:
[INFO] maven-war-plugin .............................................. 2.0.2
[INFO]
[INFO] Require Maven 2.0.2 to use the following plugin updates:
[INFO] maven-site-plugin ........................................ 2.0-beta-7
[INFO]
[INFO] Require Maven 2.0.6 to use the following plugin updates:
[INFO] maven-clean-plugin .............................................. 2.5
[INFO] maven-deploy-plugin ........................................... 2.8.1
[INFO] maven-install-plugin .......................................... 2.5.1
[INFO] maven-resources-plugin .......................................... 2.6
[INFO] maven-site-plugin ............................................. 2.0.1
[INFO] maven-surefire-plugin ......................................... 2.4.3
[INFO] maven-war-plugin ................................................ 2.4
[INFO]
[INFO] Require Maven 2.0.9 to use the following plugin updates:
[INFO] maven-compiler-plugin ........................................... 3.1
[INFO] maven-surefire-plugin .......................................... 2.17
[INFO]
[INFO] Require Maven 2.1.0 to use the following plugin updates:
[INFO] maven-site-plugin ............................................. 2.1.1
[INFO]
[INFO] Require Maven 2.2.0 to use the following plugin updates:
[INFO] maven-site-plugin ............................................... 3.0
[INFO]
[INFO] Require Maven 2.2.1 to use the following plugin updates:
[INFO] maven-clean-plugin ............................................ 2.6.1
[INFO] maven-compiler-plugin ........................................... 3.3
[INFO] maven-deploy-plugin ........................................... 2.8.2
[INFO] maven-install-plugin .......................................... 2.5.2
[INFO] maven-resources-plugin .......................................... 2.7
[INFO] maven-site-plugin ............................................... 3.4
[INFO] maven-surefire-plugin ........................................ 2.18.1
[INFO] maven-war-plugin ................................................ 2.6
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:11 min
[INFO] Finished at: 2015-04-10T21:01:09+02:00
[INFO] Final Memory: 9M/21M
[INFO] ------------------------------------------------------------------------
versions:display-dependency-updates
scans a project's dependencies and produces a report of those dependencies which have newer versions available.
versions:use-latest-releases
searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the latest release version.
pom.xml, right click
Run As -> Maven build
choose run options
http://mojo.codehaus.org/versions-maven-plugin/index.html
how to update apache maven
installed maven version 3.1.0
update maven version is 3.3.1
maven.apache.org
rename apache-maven.bck
C:\Downloads\apache-maven
extract apache-maven-3.3.1-bin.zip
under
C:\Downloads\apache-maven
eclipse luna configuration
Windows > Preferences > Installations > Add
Installation home :C:\Downloads\apache-maven
Tick new maven config
Apply > OK
update maven version is 3.3.1
maven.apache.org
rename apache-maven.bck
C:\Downloads\apache-maven
extract apache-maven-3.3.1-bin.zip
under
C:\Downloads\apache-maven
eclipse luna configuration
Windows > Preferences > Installations > Add
Installation home :C:\Downloads\apache-maven
Tick new maven config
Apply > OK
how to log4j configuration for spring
web.xml file
<!--
log4j config
for spring -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>file:/C:/Users/jupiter/workspace/webapp4_custformdbbcryptcond2/src/main/resources/welcome/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
log4j.properties file
#
Root logger option
log4j.rootLogger=debug,
file,
stdout
#log4j.rootLogger=debug,
stdout
#
Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=C:/logs/log.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{dd
MMM
yyyy
HH:mm:ss}
----%5p----
#
how to define minimum maven version in pom.xml
<properties>
....
....
</properties>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
how to install j2ee
jdk-8u20-windows-x64
java_ee_sdk-7-windows-ml
eclipse-jee-luna-R-win32-x86_64
run command prompt
do not forget parantheses for jdk
installation path
java_ee_sdk-7-windows-ml -j "C:\Program
Files\Java\jdk1.8.0_20"
Subscribe to:
Posts (Atom)