Re: Usage of Enforcer Plugin 1.1-SNAPSHOT

2011-11-10 Thread Guo Du
 I wonder why maven uses a SNAPSHOT version of the plugin?
Which maven version you use?

A build log will helps to understand your problem.

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: parent pom resolution problem in maven 3

2011-11-01 Thread Guo Du
 It should work without install on ROOT level.
 You tried that? It certainly does not work for me.

Following commands DOES work for me:

tar -xzvf parent-pom-sample-problem.tar.gz
cd tests
mvn clean
mvn validate
mvn package


-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Build failure control with integration testing

2011-10-31 Thread Guo Du
 My problem is that things can go wrong in pre. When they do, the build
 fails, and then post doesn't run, and the early parts of pre that
 succeed don't get cleaned up.
pre should fail the build and clean it up itself. It might be
difficult if there are multiple mojo binded to pre-integration-test.
In this case, you need write your own mojo to guarantee the clean up
is executed if failed in the middle of setup.

post only clean up the succeeded pre and integration test, not failed pre :)

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: parent pom resolution problem in maven 3

2011-10-31 Thread Guo Du
On Mon, Oct 31, 2011 at 11:10 PM, Rafael Ribeiro rafae...@gmail.com wrote:
 Hilco, I am not saying that it should work without installing common but it
It should work without install on ROOT level.

 fails even after installing common and the reason is cause it sees parent
 as a dependency of common and fails to look it up locally thru relativePath
 resolution (either with default value or forcefully specifying as
This is expected as maven resolve common as dependency while the
dependency in your local repo cannot find the parent in your local
repo. At this point, common doesn't aware of your local source parent
pom.

As a general practice, you should always build your project from root
until you understand how maven and your project dependency
relationship works.

Just a clean up suggestion for your sample poms: you don't need
packagingjar/packaging as it's default, less is more :)

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Work flow for isolated internal repository

2011-01-26 Thread Guo Du
 On Mon, Jan 24, 2011 at 5:41 AM, Anders Hammarand...@hammar.net  wrote:
 We do this by building jars that aggregate our 3rd party dependencies once
 per release so we know exactly what transitive dependencies are going to be
 used by the developers.
If you are running maven for some time, I won't surprised if there are
thousands of jars already in artifacts/plugins repository. I am
interesting to see the flow how you do the building jars that
aggregate our 3rd party dependencies for those production jars if
it's not related to confidential material. Any plugins/tools used to
assistant the process?

 This gives us simple projects and central control over libraries used.
This what I try to achieve. Even central repo is general available and
good quality, but no guarantee of bomb free :)

Thanks Ron!

 -Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Work flow for isolated internal repository

2011-01-24 Thread Guo Du
On Mon, Jan 24, 2011 at 2:31 AM, Ron Wheeler
rwhee...@artifact-software.com wrote:
 1. Developer enables the access to internal repository(Nexus or other).
Internal repository is isolated from external even with nexus. This is
the main point of this work flow. Imaging with transparent proxy to
maven central, developer could download 105GB+ artifacts and will
result been blocked by central server.

 javadoc/sources/license- needs to be done before 2. Why should the developer
 waste time using invalid libraries.
I want to clarify that in #2, only dependency referenced added to pom,
not actual jar files.

 6. Maven/Nexus deploys new dependencies to internal repository
It's ok if those new dependencies are in a staging area.

Thanks!

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Work flow for isolated internal repository

2011-01-24 Thread Guo Du
On Mon, Jan 24, 2011 at 5:41 AM, Anders Hammar and...@hammar.net wrote:
 You could be somewhat aided by the procurement feature of Nexus Pro (the
 commercial edition of the Nexus repo manager):
 http://www.sonatype.com/books/nexus-book/reference/procure.html
Looked at the link, Procured Development Repository[1] is closest to
support the flow.

It could works for a very limited number of new dependency to be added
before #2. For the use case of a new project setup, lots of dependency
could be added and developer may even don't know which library is need
as there are transitive dependencies.

If procurement could store all the new dependencies to a staging area
like a normal release staging repository and reusing existing
approval/release functionality, will make the flow more operational.

 Also, One thing that you might want to have in mind is two have separate
 repositories for dependencies and plugins. For Maven to be useful, you will
 This does not work in Maven 2.x.
A very good practice, this is main reason to choose 3.X. We will leave
the plugins in a different world and have less restriction :)

Thanks all for the thoughts!

-Guo

[1] 
http://www.sonatype.com/books/nexus-book/reference/procure.html#procure-sect-dev

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Work flow for isolated internal repository

2011-01-23 Thread Guo Du
In a commercial software development environment, production code will
rely on artifacts which may come from public domain such as maven
central repository. For those artifacts from external, would be
validated with some process such as
checksum/javadoc/sources/license/lawyer, once passed those check, then
deployed to internal maven repository to build into product. Internal
repository is isolated from external repository for various reason.

A typical work flow will be:
1. Developer enable the access to external repository.
2. Developer add new dependencies as artifacts/plugins which available
from external repository.
3. Developer test the new pom setup and it works on local machine
4. Developer in some how figure out all  (hundreds) new dependencies
need added to internal repository
5. Developer/Administrator/Lawyer valid the new dependencies such as
javadoc/sources/license
6. Developer/Administrator deploy new dependencies to internal repository
7. Developer check in projects pom and it will works on continuous
integration server which only have access to internal repository.

Any question on the work flow?
Is this work flow could be easily supported? (with open
source/commercial repository manager)

Thanks!

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



placeholder in settings repo url doesn't get replaced

2011-01-08 Thread Guo Du
Hi,

I did following testing, and get reproducible result:

$ mvn -gs settings-placeholder-in-central-repo-url.xml -f
pom-without-partent.xml clean
Downloading: 
http://localhost:9001/public/releases/org/apache/maven/plugins/maven-clean-plugin/2.2/maven-clean-plugin-2.2.pom

$ mvn -gs settings-placeholder-in-central-repo-url.xml -f
pom-with-partent.xml clean
Downloading: ${centralRepoUrl}/org/apache/apache/7/apache-7.pom

You can see that the place holder isn't replaced for pom with parent
defined. And in both case, the place holder in localRepository section
never get replaced correctly (you will have a folder named
${project.build.directory} in current build folder).

Do we have the best practice: DO NOT use place holder in repository
management except deployment?


Those xml files are in attachment and you can guess what's inside by
it's name. In the test, maven version is 3.0.1. Maven 2.2.1 has
slightly different but unexpected result as well.


Thanks!

-Guo
?xml version='1.0' encoding='UTF-8'?
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;
	modelVersion4.0.0/modelVersion
	groupIdorg.duguo.maven.community/groupId
	artifactIdpom-without-parent/artifactId
	version1.0.0-SNAPSHOT/version
/project
?xml version='1.0' encoding='UTF-8'?
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;
	modelVersion4.0.0/modelVersion
	parent
		groupIdorg.apache/groupId
		artifactIdapache/artifactId
		version7/version
	/parent
	groupIdorg.duguo.maven.community/groupId
	artifactIdpom-with-parent/artifactId
	version1.0.0-SNAPSHOT/version
/project
?xml version=1.0 encoding=UTF-8?
settings xmlns=http://maven.apache.org/SETTINGS/1.0.0; 
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
  xsi:schemaLocation=http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd;
  localRepository${project.build.directory}/localrepo/localRepository
  profiles
profile
  idalwaysActiveProfile/id
  properties
centralRepoUrlhttp://localhost:9001/public/releases/centralRepoUrl
  /properties
  repositories
repository
  idcentral/id
  url${centralRepoUrl}/url
/repository
  /repositories
  pluginRepositories
pluginRepository
  idcentral/id
  url${centralRepoUrl}/url
/pluginRepository
  /pluginRepositories
/profile
  /profiles
  activeProfiles
activeProfilealwaysActiveProfile/activeProfile
  /activeProfiles
/settings

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Re: maven tries to download wrong pmd version

2011-01-04 Thread Guo Du
On Tue, Jan 4, 2011 at 2:42 PM, Olivier Lamy ol...@apache.org wrote:
 If you use maven3
 See [1] section Version Resolution
 [1] http://maven.apache.org/plugins/maven-site-plugin-3.0-beta-3/maven-3.html

Site plugin is a maven plugin, any reason to resolve with current
repositories, not pluginsRepositories?

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Cleaning a POM file

2011-01-03 Thread Guo Du
1 Delete everything you are not sure.
2 run the desired goals such as install site
3 add back  required stuff until step 2 success
-Guo
On 3 Jan 2011 23:39, ping.sumit ping.su...@gmail.com wrote:

 hi,
 I am new to the Maven and trying to clean a POM file. Please let me know
how
 can I make sure if any plugins, repositories or dependencies are not in
use.

 Thanks in Advance
 --
 View this message in context:
http://maven.40175.n5.nabble.com/Cleaning-a-POM-file-tp3326392p3326392.html
 Sent from the Maven - Users mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org



Best practice for integration testing (IT)?

2011-01-02 Thread Guo Du
Happy New Year everyone,

maven-failsafe-plugin was used in [1] to perform IT. Both [1] and [2]
mentioned src/it/java, in 3.X, what's the current recommended way to
do the IT in terms of layout/plugin?

Thanks!

-Guo

[1] http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
[2] http://docs.codehaus.org/display/MAVEN/best+practices+-+testing+strategies

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: How to setup location of settings.xml NOT by cmdline?

2010-12-26 Thread Guo Du
 I prefer to have Maven auto-detect the settings.xml in its own installation 
 directory.
Looks like you just want put your settings inside M2_HOME/conf/settings.xml

Happy holiday!

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: How to setup location of settings.xml NOT by cmdline?

2010-12-26 Thread Guo Du
On Sun, Dec 26, 2010 at 4:44 PM, benxs bxsto...@yahoo.co.uk wrote:
 ? Does Maven read both or only the first file it finds?
 Which one has priority?
Based on org.apache.maven.settings.building.DefaultSettingsBuilder
implementation, maven read both and merge them on runtime.

userhome/.m2/settings.xml taken priority.

 Where is this fact written?
Saw a discussion [1] but it would be helpful to documented at [2]

-Guo

[1] http://stackoverflow.com/questions/1261215/which-maven-settings-xml-files
[2] http://maven.apache.org/settings.html

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven 3 reports wrong version

2010-12-17 Thread Guo Du
On Fri, Dec 17, 2010 at 2:22 PM, Andre M mougeot.an...@gmail.com wrote:
 being run is indeed maven3.0.1bin\mvn.bat.
Do you have M2_HOME in environment pointed to old version?

-Guo

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org