Release vs. Snapshot Repositories

rajeshatbuzz created the topic: Release vs. Snapshot repositories
What is the different between Release vs. Snapshot repositories in maven?

Rajesh

scmuser replied the topic: Re:Release vs. Snapshot repositories
A further segregation of remote repositories is the separation of Release repositories and Snapshot repositories. Note that release vs snapshot repos are always remote, since the local repository has effectively no concept of differentiation between releases and snapshots.

Also note that remote repositories can be set to release both snapshots and releases simultaneously.

Release

Release repositories are designed to hold artifacts that have fixed values and released versions, hence the name. Given the lack of control on artifact version names, a release is effectively any artifact whose version does NOT end in the magic string “-SNAPSHOT”.

A release repository is denoted in by having the releases tag in the repo definition set to true, indicating that a given remote repo is capable of serving releases.

Snapshots

Snapshots are defined as artifacts that whose version ends in “-SNAPSHOT”

in other word…

Release repositories hold releases and Snapshot repositories hold snapshots. In maven a snapshot is defined as an artifact with a version ending in -SNAPSHOT. When deployed, the snapshot is turned into a timestamp. By definition, snapshots are mutable, releases are immutable. This is why Nexus makes you store them separately because usually you don’t care if you lose snapshots, but you will care if you lose releases. It makes snapshot cleanup much easier to deal with that way.

Snapshot repositories are denoted by having their snapshots tag set to true in the repository definition.

Tagged :

Issue Management In Maven?

rajeshatbuzz created the topic: issueManagement in Maven?
Any body provide some notes on issueManagement in Maven/.

Rajesh

scmuser replied the topic: Re:issueManagement in Maven?
issueManagement

Information about the issue tracking (or bug tracking) system used to manage this project.

Element

Description

system

The name of the issue management system, e.g. Bugzilla

url

URL for the issue management system used by the project.

Example:


Trac
trac.videolan.org/vlma

Tagged :

How Maven development started?

scmuser created the topic: How Maven development started?
How Maven development started?

rajeshatbuzz replied the topic: Re:How Maven development started?
Maven, a Yiddish word meaning accumulator of knowledge, was originally started as an attempt to
simplify the build processes in the Jakarta Turbine project. There were several projects each with their
own Ant build files that were all slightly different and JARs were checked into CVS. We wanted a
standard way to build the projects, a clear definition of what the project consisted of, an easy way to
publish project information and a way to share JARs across several projects.

Tagged :

Maven’s Objectives

scmuser created the topic: Maven’s Objectives
What is the maven main objectives?

rajeshatbuzz replied the topic: Re:Maven’s Objectives
Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with:
• Making the build process easy
• Providing a uniform build system
• Providing quality project information
• Providing guidelines for best practices development
• Allowing transparent migration to new features

Making the build process easy
While using Maven doesn’t eliminate the need to know about the underlying mechanisms, Maven does provide a lot of shielding from the details.

Providing a uniform build system
Maven allows a project to build using its project object model (POM) and a set of plugins that are shared by all projects using Maven, providing a uniform build system. Once you familiarize yourself with how one Maven project builds you automatically know how all Maven projects build saving you immense amounts of time when trying to navigate many projects.

Providing quality project information
Maven provides plenty of useful project information that is in part taken from your POM and in part generated from your project’s sources. For example, Maven can provide:
• Change log document created directly from source control
• Cross referenced sources
• Mailing lists
• Dependency list
• Unit test reports including coverage
As Maven improves the information set provided will improve, all of which will be transparent to
users of Maven.
Other products can also provide Maven plugins to allow their set of project information alongside
some of the standard information given by Maven, all still based on the POM.

Providing guidelines for best practices development
Maven aims to gather current principles for best practices development, and make it easy to guide a
project in that direction.
For example, specification, execution, and reporting of unit tests are part of the normal build cycle
using Maven. Current unit testing best practices were used as guidelines:
• Keeping your test source code in a separate, but parallel source tree
• Using test case naming conventions to locate and execute tests
• Have test cases setup their environment and don’t rely on customizing the build for test
preparation.

Maven also aims to assist in project workflow such as release management and issue tracking.
Maven also suggests some guidelines on how to layout your project’s directory structure so that once
you learn the layout you can easily navigate any other project that uses Maven and the same defaults.

Allowing transparent migration to new features
Maven provides an easy way for Maven clients to update their installations so that they can take
advantage of any changes that been made to Maven itself.
Installation of new or updated plugins from third parties or Maven itself has been made trivial for this
reason.

Tagged :

Maven Troubleshooting

rajeshkumar created the topic: Maven troubleshooting
i would like to knpw “Most Common Issues in Maven”?

Any body can focus on this?
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

mnanjala replied the topic: Re:Maven troubleshooting
You may get error with Java Heap Size error.
Solution: set the Environment Variable of MAVEN_OPTS to “-Xms512m -Xmx512m -XX:MaxPermSize=1024m”

mnanjala replied the topic: Re:Maven troubleshooting
2)ArtifactResolutionException

This error generally occurs when Maven could not download dependencies. Possible causes for this error are:

1. The repository you have configured requires authentication and Maven failed to provide the correct credentials to the server. In this case, make sure your ${user.home}/.m2/settings.xml contains a declaration whose matches the of the plugin repository to use. See the Maven Settings Reference for more details.
2. The remote repository in question uses SSL and the JVM running Maven does not trust the certificate of the server.
5. Maven failed to save the files to your local repository.
4. You have configured Maven to perform strict checksum validation and the files to download got corrupted.
3. There is a general network problem that prevents Maven from accessing any remote repository, e.g. a missing proxy configuration.(Communication Issue local box and repo)

mnanjala replied the topic: Re:Maven troubleshooting
3)DuplicateProjectException
This error signals a collision of project identifiers during a reactor build. The coordinates for a project as given by its group id, artifact id and version must be unique within a reactor build. The usual cause for this error is a in one of the POMs so please verify the project coordinates are correctly set and valid.

mnanjala replied the topic: Re:Maven troubleshooting
InternalErrorException

This error indicates a bug in Maven itself.

1. Capture the debug output of the failing build, e.g. by adding the flag -X to the command line and redirecting the console output of Maven to a file:

mvn -X > debug.log

2.If interested report this bug to maven gurus you could submit a ticket in jira.codehaus.org/browse/MNG so we can avoid this bug in future provided bug has been fixed.It is said it is intermittent.

mnanjala replied the topic: Re:Maven troubleshooting
4) InvalidPluginDescriptorException
This error signals incomplete or wrong information in the descriptor for a plugin. The plugin descriptor is a special file in the plugin’s JAR file. An invalid descriptor is usually the result of bad driving while assembling the plugin. Please report this issue to the maintainer of the plugin in question.

Not a bad idea to try out another version of the plugin, there’s not much you as a user can do.

Tagged :

Apache Maven Gets Ready for Enterprise, Eclipse

rajeshkumar created the topic: Apache Maven Gets Ready for Enterprise, Eclipse
It’s exciting times for fans of Apache Maven. Developers who delve into both Java and Eclipse are the target for a new push by Apache Maven and its commercial backer, Sonatype, that aim to produce new tools designed to simplify use and encourage adoption.

The effort will result in the launch of Maven Studio for Eclipse, building on the open source M2Eclipse project. That’s going to be followed by the launch of the Maven Enterprise Suite, which will include an array of tools designed to serve as a one-stop shop for enterprise developers. Developer.com takes a look at the implications.

The Apache Maven project is used by over 3 million Java developers as a project and build management solution. Java developers also widely use the Eclipse IDE. At the intersection of Eclipse and Maven is the new Maven Studio for Eclipse announced this week by Maven commercial backer Sonatype.

“The primary focus of the first version of Maven Studio for Eclipse is what we call developer on-boarding,” Jason Van Zyl, CTO of Sonatype and creator of Maven told InternetNews.com. “What we found is that in a lot of organizations the biggest problem they have is trying to get new developers initialized and working with a new project — what we’ve tried to do is turn it into a one-click operation.”
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Sonatype Introduces Maven Studio for Eclipse(TM)

rajeshkumar created the topic: Sonatype Introduces Maven Studio for Eclipse(TM)
Innovative Development Environment Enables the 3+ Million Maven Java(TM) Developers to Dramatically Improve Productivity

EclipseCon – March 22, 2010 – Sonatype, caretaker of the Maven project and leading provider of enterprise software development infrastructure, today announced Sonatype Maven Studio for Eclipse. The Studio is the only Eclipse Integrated Development Environment specifically optimized for Maven, the de facto standard for Java project and build management used by more than 3 million Java developers worldwide. The Studio accelerates developer productivity through a range of innovations including one-click onboarding — making developers fully productive in minutes rather than hours or even days.

“The process of onboarding new software developers is slow, cumbersome and prone to error,” said Mark Driver, vice president and research director in Gartner Research (NYSE: IT). “Lost productivity due to inadequate and ineffective onboarding processes is a ‘hidden tax’ that causes organizations to waste a great deal of time and money.”

Getting a new developer up and running can take up to a week of trial and error as they assemble a working development environment, struggling with project dependencies, plug-ins, preferences, and more. With one click, Maven Studio automatically installs and configures everything a developer needs to start delivering value to their organization.

With open source M2Eclipse at its core, Maven Studio for Eclipse will also deliver a number of innovations beyond one-click onboarding. These include:

* License management to ensure that all license headers and attribution files are present in the project, making the terms of the license legally enforceable
* Tomcat integration for rapid development of web applications
* Confluence Wiki integration, allowing developers to view and edit wiki content from inside Eclipse
* The ability to launch Hudson builds and monitor Hudson build status within the Eclipse IDE

Maven Studio for Eclipse also provides tight Maven platform integration, including support for Eclipse provisioning and workspace materialization, allowing developers to automatically install the Eclipse IDE, check out the project source and configure preferences. Maven Studio for Eclipse works closely with Nexus Professional and leverages its Eclipse repository support to make one-click onboarding seamless.

“Maven Studio for Eclipse enables a major advance in Java developer productivity, eliminating the wasted time of the typical trial and error process of assembling a working development environment,” said Jason van Zyl, CTO of Sonatype and creator of Maven. “Every organization using Maven and Eclipse will find the Studio indispensable to making a new team member fully productive.”
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Maven failed to resolve repo1.maven.org Inbo

scmuser created the topic: Maven failed to resolve repo1.maven.org Inbo
I installed Maven 2.2.1 on Ubuntu 8.04. When I first tried to run mvn it
didn’t work.
I have a direct connection to internet and I do not have firewall policies
which prohibit
internet access from any program (such as java.exe, as I found in one post)

Looking at the stack-trace it seems like the root of all evil is:

Caused by: java.net.UnknownHostException: repo1.maven.org

I tried to resolve it manually

akshay@lap7:~$ dig repo1.maven.org.

; <<>> DiG 9.4.2-P2.1 <<>> repo1.maven.org.
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2732 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;repo1.maven.org. IN A ;; ANSWER SECTION: repo1.maven.org. 66 IN A 38.97.124.18 ;; Query time: 36 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Fri Jun 18 19:01:52 2010 ;; MSG SIZE rcvd: 49 Please suggest what is wrong with my setup. I've attached the output of mvn here. Thanks in advance. + Error stacktraces are turned on. Apache Maven 2.2.1 (r801777; 2009-08-07 00:46:01+0530) Java version: 1.6.0_03 Java home: /opt/jdk1.6.0_03/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux" version: "2.6.24-27-generic" arch: "i386" Family: "unix" [DEBUG] Building Maven user-level plugin registry from: '/home/akshay/.m2/plugin-registry.xml' [DEBUG] Building Maven global-level plugin registry from: '/home/akshay/opt/apache-maven-2.2.1/conf/plugin-registry.xml' [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins [INFO] org.apache.maven.plugins: checking for updates from central [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [DEBUG] Checking for pre-existing User-Agent configuration. [DEBUG] Adding User-Agent configuration. [DEBUG] Connecting to repository: 'central' with url: ' repo1.maven.org/maven2 '. [DEBUG] Using Wagon implementation lightweight from default mapping for protocol http [WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repo1.maven.org [DEBUG] Exception org.apache.maven.wagon.TransferFailedException: Error transferring file: repo1.maven.org at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143) at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116) at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88) at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61) at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:546) at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(DefaultWagonManager.java:443) at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolve(DefaultRepositoryMetadataManager.java:97) at org.apache.maven.plugin.DefaultPluginMappingManager.loadPluginMappings(DefaultPluginMappingManager.java:103) at org.apache.maven.plugin.DefaultPluginMappingManager.loadPluginMappings(DefaultPluginMappingManager.java:87) at org.apache.maven.plugin.DefaultPluginMappingManager.getByPrefix(DefaultPluginMappingManager.java:61) at org.apache.maven.plugin.DefaultPluginManager.getPluginDefinitionForPrefix(DefaultPluginManager.java:159) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1801) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.net.UnknownHostException: repo1.maven.org at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at sun.net.NetworkClient.doConnect(NetworkClient.java:157) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net. www.http.HttpClient .(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at
org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)
… 25 more
[INFO] Repository ‘central’ will be blacklisted
[DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
[DEBUG] Skipping blacklisted repository central
[DEBUG] Skipping blacklisted repository central
[DEBUG] maven-archetype-plugin: using locally installed snapshot
[DEBUG] Artifact not found – using stub model: Unable to determine the
latest version

org.apache.maven.plugins:maven-archetype-plugin:pom:LATEST

[DEBUG] Using defaults for missing POM
org.apache.maven.plugins:maven-archetype-plugin:pom:LATEST
[DEBUG] maven-archetype-plugin: using locally installed snapshot
[DEBUG] Artifact not found – using stub model: Unable to determine the
release version

org.apache.maven.plugins:maven-archetype-plugin:pom:RELEASE

[DEBUG] Using defaults for missing POM
org.apache.maven.plugins:maven-archetype-plugin:pom:RELEASE
[INFO]
[ERROR] BUILD ERROR
[INFO]
[INFO] The plugin ‘org.apache.maven.plugins:maven-archetype-plugin’ does not
exist or no valid version could be found
[INFO]
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin
‘org.apache.maven.plugins:maven-archetype-plugin’ does not exist or no valid
version could be found
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1569)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1851)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException:
The plugin ‘org.apache.maven.plugins:maven-archetype-plugin’ does not exist
or no valid version could be found
at
org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
at
org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
at
org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:179)
at
org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
… 15 more
[INFO]
[INFO] Total time: 1 second
[INFO] Finished at: Fri Jun 18 15:43:35 GMT+05:30 2010
[INFO] Final Memory: 1M/4M
[INFO]

Tagged :

Run external tasks using maven

scmuser created the topic: Run external tasks using maven
Hi,
Is it possible to run ant tasks which is not connected with any build
lifecycle phase?
In other word I would like to perform some action on demand using maven and
antrun plugin

tpatil replied the topic: Re:Run external tasks using maven
Targets from external ant file can be run using maven-antrun-plugin.

maven-antrun-plugin

test






run


Also, you can execute the external command using maven-exec-plugin.

org.codehaus.mojo
exec-maven-plugin
1.1

compile
exec




svn

info
--xml

target/classes/svninfo.txt

Tagged :

How to set latest P4 CL# into property?

tpatil created the topic: How to set latest P4 CL# into property?
We have CI setup using bamboo, P4 & maven. When I trigger the build from bamboo it gives me the CL# on which the build is done on build results page.

How can I get this value/property in pom.xml? I want to add to this CL# to MANIFEST.MF file.

Thanks,
-Tushar

How to set latest P4 CL# into property?
This may serve your ur purpose…
p4 changes -s submitted -m1

plz refer following articles as well

stackoverflow.com/questions/47007/determ…ynced-to-in-perforce
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

tpatil replied the topic: Re:How to set latest P4 CL# into property?
/**
*Usage in pon.xml
* * test.maven
* maven-p4-plugin
*
*
*
* p4changes
*

*
* //depot/ABC/2/X/...
*

*

*

*
*
* Goal which touches a timestamp file.
*
* @goal p4changes
*
* @phase process-sources
*/
public class P4RevisionMojo extends AbstractMojo {

private Process p;
private Properties prop;
private MavenProject project;
/**
* @parameter expression="${p4.url}" default-value="./..."
* @required
* @since 1.0
*/
private String suffix;
/**
* @parameter expression="${p4.port}" default-value="${env.P4PORT}"
* @optional
* @since 1.0
*/
private String p4port;
/**
* @parameter expression="${p4.client}" default-value="${env.P4CLIENT}"
* @optional
* @since 1.0
*/
private String p4client;
/**
* @parameter expression="${p4.user}" default-value="${env.P4USER}"
* @optional
* @since 1.0
*/
private String p4user;
/**
* @parameter expression="${p4.passwd}" default-value="${env.P4PASSWD}"
* @optional
* @since 1.0
*/
private String p4passwd;

public void execute() throws MojoExecutionException {
try {
String cmd = "p4 changes -m 1 " + url;
this.getLog().info("Executing P4 command: " + cmd);
p = Runtime.getRuntime().exec(cmd);
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = stdInput.readLine();

String property = "p4.revision";
if (suffix != null && suffix.length() > 0) {
property = property.concat("." + suffix);
}

prop.setProperty("buildtstamp", new Date().toString());
prop.setProperty(property, "000000");
while (line != null) {
String[] line_items = line.split(" ");
if (line_items.length >= 1) {
if (line_items[0].equalsIgnoreCase("Change")) {
prop.setProperty(property, line_items[1]);
this.getLog().info("P4 Revision ${" + property + "} :::: " + prop.getProperty(property));
}

}
return;
}

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

Tagged :