[ANN] Apache Maven Patch Plugin Version 1.2 Released

2015-03-10 Thread Karl Heinz Marbaise
The Apache Maven team is pleased to announce the release of the 
Apache Maven Patch Plugin, version 1.2

The Patch Plugin is used to apply patches to source files.

http://maven.apache.org/plugins/maven-patch-plugin/

plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-patch-plugin/artifactId
  version1.2/version
/plugin

Release Notes - Maven Patch Plugin - Version 1.2

Improvement:

 * [MPATCH-17] - Make Plugin only 2.2.1 compatible - get rid of Maven 2.0

New Feature:

 * [MPATCH-15] - Expose the binary option as a parameter

Task:

 * [MPATCH-14] - use maven-plugin-tools' java 5 annotations

Enjoy,

- The Apache Maven team

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



[ANN] Apache Maven Jar Plugin Version 2.6 Released

2015-03-10 Thread Karl Heinz Marbaise
The Apache Maven team is pleased to announce the release of the 
Apache Maven Jar Plugin, version 2.6

This plugin provides the capability to build jars.

http://maven.apache.org/plugins/maven-jar-plugin/

plugin
  groupIdorg.apache.maven.plugins/groupId
  artifactIdmaven-jar-plugin/artifactId
  version2.6/version
/plugin

Release Notes - Maven JAR Plugin - Version 2.6

Bugs:

 * [MJAR-135] - encoding problem with folder-names
 * [MJAR-151] - Error assembling JAR on OS X
 * [MJAR-179] - Adding empty files to jar failed with a ZipException : bad CRC 
checksum
 * [MJAR-185] - Update version of plexus-archiver to 2.7.1
 * [MJAR-188] - maven-jar-plugin is very slow on machines with slow Unix group 
lookups
 * [MJAR-189] - Upgrade plexus-archiver dependency to v2.9

Improvements:

 * [MJAR-178] - Change information on site
 * [MJAR-180] - Upgrade to Maven 2.2.1 compatiblity
 * [MJAR-181] - MavenProject/MavenSession Injection as a paremeter instead as a 
component.
 * [MJAR-182] - Update version of plexus-archiver to 2.6.3
 * [MJAR-184] - Update version of plexus-archiver to 2.7
 * [MJAR-186] - Upgrade maven-plugins-testing-harness from 1.2 to 1.3
 * [MJAR-187] - Upgrade maven-archiver to 2.6
 * [MJAR-190] - Upgrade to maven-plugins version 25 to 26
 * [MJAR-191] - Upgrade to maven-plugins parent version 27

Enjoy,

- The Apache Maven team

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



Re: Why would maven download a pom and not a jar?

2015-03-10 Thread Ron Wheeler
I am not sure that it matters since Maven can always get whatever it 
needs when it needs it.


It is an intriguing question nonetheless.

You might trace back the reason for the pom to be downloaded.
This might give you a hint as to what Maven need the pom for.

oro is unlikely to be a provided or system dependency but a bit of 
digging into your dependency hierarchy might shed some light.


You may want to reread the section in the doc on transitive dependencies 
to focus your investigation.


Ron

On 10/03/2015 10:22 AM, D C wrote:

I am trying to download all dependencies from a pom file.  My steps are:
1. delete .m2/repository
2. mvn dependency:tree pom.xml

Everything looks good, however as I browse the .m2 directory I can see that
for some artifacts  maven only downloaded the pom file, and did not
download the associated jar.  I then repeat the process on another pom
file.  This time the jar file is present for that same artifact.

There are multiple artifacts that this happens on, but for troubleshooting
I'm just focusing on oro-2.0.8.   Neither of my poms declare oro, so this
is a sub-dependency somewhere down the chain.  The process can be
reproduced every time,  and I can see from the output that the oro-2.0.8
pom file is downloaded from the same location (local artifactory) in both
cases.


Does anyone know why maven would download a pom file, and then not attempt
to download the associated jar?


Thanks,
Dan




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



What does my application actually require?

2015-03-10 Thread D C
I was going to tag this onto my previous post, but I figured the issue is
unique enough to be a different topic.


When I run dependency:tree (with an empty .m2),  I get a nice tree graph
showing 49 items.   I would expect then my .m2/repository to have 49 items
in it.  In actuality, my .m2 now has 251 artifacts.

I want to collect only the artifacts that my application needs to run.
Would I be safe if I just package up the 49 items listed in the dependency
tree output?

This would also be useful to reduce because I create my class path like so:
$ find ~/.m2/repository/ -name *.jar | xargs | sed 's/ /;/g'

The more I can remove from there, the better.


Thanks,
Dan


Why would maven download a pom and not a jar?

2015-03-10 Thread D C
I am trying to download all dependencies from a pom file.  My steps are:
1. delete .m2/repository
2. mvn dependency:tree pom.xml

Everything looks good, however as I browse the .m2 directory I can see that
for some artifacts  maven only downloaded the pom file, and did not
download the associated jar.  I then repeat the process on another pom
file.  This time the jar file is present for that same artifact.

There are multiple artifacts that this happens on, but for troubleshooting
I'm just focusing on oro-2.0.8.   Neither of my poms declare oro, so this
is a sub-dependency somewhere down the chain.  The process can be
reproduced every time,  and I can see from the output that the oro-2.0.8
pom file is downloaded from the same location (local artifactory) in both
cases.


Does anyone know why maven would download a pom file, and then not attempt
to download the associated jar?


Thanks,
Dan


Re: Why would maven download a pom and not a jar?

2015-03-10 Thread Baptiste Mathus
Well, in that case, since you're asking for the dependency:tree I'm even
surprised there's any jar downloaded. Maven would only need pom to compute
that. Downloading Jars is only done when needed (say for compiling, etc.)

Btw, do you really type mvn dependency:tree pom.xml ? What do you expect?
The pom.xml part is gonna lead to an error since pom.xml is not a goal
and that's what's supposed to be listed after mvn.

As for your question: I suppose oro is a transitive dependency of one of
the things you depend on. mvn dependency:tree should generally show it btw.

Cheers

2015-03-10 15:22 GMT+01:00 D C dc12...@gmail.com:

 I am trying to download all dependencies from a pom file.  My steps are:
 1. delete .m2/repository
 2. mvn dependency:tree pom.xml

 Everything looks good, however as I browse the .m2 directory I can see that
 for some artifacts  maven only downloaded the pom file, and did not
 download the associated jar.  I then repeat the process on another pom
 file.  This time the jar file is present for that same artifact.

 There are multiple artifacts that this happens on, but for troubleshooting
 I'm just focusing on oro-2.0.8.   Neither of my poms declare oro, so this
 is a sub-dependency somewhere down the chain.  The process can be
 reproduced every time,  and I can see from the output that the oro-2.0.8
 pom file is downloaded from the same location (local artifactory) in both
 cases.


 Does anyone know why maven would download a pom file, and then not attempt
 to download the associated jar?


 Thanks,
 Dan




-- 
Baptiste Batmat MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !


Re: Maven phase that runs before dependency resolution

2015-03-10 Thread Karl Heinz Marbaise

Hi,

On 3/10/15 5:03 PM, richard_senior wrote:

There is currently no phase in which you can run a plugin that is before
dependency resolution.


Hm...The question is what exactly would you like to solve?


I believe this is a problem for Maven.


Not really..there are some very rare special circumstances...which might 
be improved...



Imagine I wanted to create a plugin which could be used by the whole
company, and enforced a particular version naming strategy.


If you really want to force a whole company the correct location would 
be the repository manager and not the build tool...cause everything will 
be deployed to the repository...


The naming rules can be supported by some kind of plugin for your build 
tools (whatever build tool you use)...In Maven sounds like a job for 
maven-enforcer...(creating your own rule) or using the existing ones...



So take Spring for example, they are using an RC and RELEASE naming
convention.


It can also being handled just simply by doing release via CI solution 
which does not allow to change the versions and follow a particular rule 
set...(automation is the keyword).



Imagine I wanted to allow people to name their artifacts _BRANCH_5.
What do you exactly mean? Are we talking about groupId, artifactId, 
version (classifiers etc.) ?


In a corporate environment they are not allowed to do what they like 
they have to follow rules (as defined)...



My plugin with find that and realise that a repository named
'http://blah/blah/BRANCH_5' should be added to the repositories list (before
resolution obviously).


Now you are talking about repositories? Something completely different...


Also, I can now get my plugin to add a different distrubutionManagement
section allowing the artifacts to be deployed to
http://blah/blah/BRANCH_5.


In a corporate environment having different repositories will cause many 
headaches...and has no benefit instead of a single repository (despite 
the fact of SNAPSHOT/Releases etc.)...


Apart from that you can define some properties in distributionManagment 
which can be defined on command line...and defaults can be picked up 
from settings.xml file (on CI)




By the simple act of naming artifacts I can now manage multiple workstreams
in my pipeline with ease, and without requiring special settings files or
parent POM's.


What kind of things are you talking ?
Can you give an example?

Branches?



While I'm on the subject of Maven deficiencies, why is it not possible to
specify distrubutionManagement in settings?


Cause it's defined (xsd http://maven.apache.org/xsd/settings-1.0.0.xsd) 
that way...if it's a good idea that's a different story...It might 
belong into the settings.xml on the first glance..but settings.xml is 
also not the best idea...see http://jira.codehaus.org/browse/MNG-5657


Furthermore there are differences between project and system 
configuration parts...


And currently i see distributionManagement as project parts...which can 
be defined in a corporate parent pom



In fact.. it doesn't matter why... it's wrong.


In some rare situations it looks like being wrong


Sometimes ... just sometimes.. I do believe I might try Gradle.


Just try Gradle...but not all that glitters is gold...

So the conclusion of your post?

Kind regards
Karl Heinz Marbaise

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



Re: What does my application actually require?

2015-03-10 Thread Adrien Rivard
appassembler-maven-plugin is also worth looking at.

(Ron your blog is currently inaccessible from here (France) , sounds like
dns problem).

On Tue, Mar 10, 2015 at 3:54 PM, Jörg Schaible joerg.schai...@swisspost.com
 wrote:

 Hi Dan,

 D C wrote:

  I was going to tag this onto my previous post, but I figured the issue is
  unique enough to be a different topic.
 
 
  When I run dependency:tree (with an empty .m2),  I get a nice tree graph
  showing 49 items.   I would expect then my .m2/repository to have 49
 items
  in it.  In actuality, my .m2 now has 251 artifacts.

 Well, yes. Maven and the plugins in use have also dependencies.

  I want to collect only the artifacts that my application needs to run.
  Would I be safe if I just package up the 49 items listed in the
 dependency
  tree output?

 Use the dependency plugin to copy the dependencies.

 http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-project-dependencies.html

  This would also be useful to reduce because I create my class path like
  so: $ find ~/.m2/repository/ -name *.jar | xargs | sed 's/ /;/g'
 
  The more I can remove from there, the better.

 Leave the local repository alone. It is not of use for your task.

 Cheers,
 Jörg


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




-- 
Adrien Rivard


Help with warning: 'Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo'

2015-03-10 Thread Charles Chan
We have a Maven project using the maven-source-plugin. When building the
project on Jenkins, it shows the following warning:

[INFO] *--- maven-jar-plugin:2.4:jar (default-jar) @ test-project ---
*[INFO] Building jar:
/home/jenkins/workspace/test-project/target/test-project-1.0.0-SNAPSHOT.jar[WARNING]
Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo


I tested with maven-source-plugin 2.2.1, 2.3, and 2.4 and all of these
versions exhibit the same problem. Does anyone know where it is coming from
and/or how to get rid of the warning?

Thank you,
Charles

---
I found a similar in the mailing list archive [1], but there was no answer
back then.
There is also this thread [2] on stackoverflow, but the suggestions didn't
appear work.

[1]
http://mail-archives.apache.org/mod_mbox/maven-users/201309.mbox/%3coff445bca1.9545b829-on85257bf1.004db657-85257bf1.004e0...@loomissayles.com%3E

[2]
http://stackoverflow.com/questions/28476924/maven-sourcejar-task-results-in-warnings


Re: Help with warning: 'Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo'

2015-03-10 Thread Charles Chan
Thanks for the pointers, here are my reply.

On Tue, Mar 10, 2015 at 8:43 AM, Karl Heinz Marbaise wrote:

 Hi,


 Do you have other warnings in your build? About missing artifacts etc. ?


Other than this particular message. There are no other warnings in the
console log.


 The class is part ofr maven-sources-plugin which is weird, cause a single
 class can't be access if the plugin has been loaded...?


Not sure what to look for to answer this question.

Check the log output of your build ...in particular start a clean
 build...remove the local repository from your jenkins build...and check the
 logging output carefullyusually this is caused by not correctly
 downloaded or missing artifacts in corporate repository managers...


Tried:
1. Delete the Jenkins workspace (clean checkout)
2. Remove .m2 from Jenkins slave
3. Rebuild  same warning


 BTW: How is Maven called ? Which Maven version do you use?


Maven 3.0.5 is called by Jenkins via Maven project plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Maven+Project+Plugin).

The configuration:
* Root POM: pom.xml
* Goals and options: source:jar
* Maven validation level: default
* Settings file: Use default maven settings
* Global settings file: Use default maven global settings

I also tried to add '--debug' to the MAVEN_OPTS, but it didn't show any
more details regarding the warning.
I also try to change validation level (default, minimal, 2.0, 3.0, 3.1,
strict) and they all show the same error.

Note: We only see this problem when compiling on Jenkin. There are no
problem when building the project from NetBeans or command line.



 Kind regards
 Karl Heinz Marbaise



Re: Does doxia site renderer have any feature to pick up and include artifacts from a pre-defined source folder/directory into output html?

2015-03-10 Thread Krishnamurthy Nagarajan
Hi
Yes! That's what I am looking for. I will check it out tomorrow and get back if 
I have any problem. Thanks!
best regards,Nagarajan
  From: Hervé BOUTEMY herve.bout...@free.fr
 To: Maven Users List users@maven.apache.org 
 Sent: Tuesday, March 10, 2015 4:23 AM
 Subject: Re: Does doxia site renderer have any feature to pick up and include 
artifacts from a pre-defined source folder/directory into output html?
   
Hi,

Is src/site/resources [1] what you are looking for?

Regards,

Hervé

[1] 
http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Adding_Extra_Resources



Le lundi 9 mars 2015 14:17:36 Krishnamurthy Nagarajan a écrit :
 Hi,
 Doxia site renderer, which is built on top of doxia, has several built-in
 features, such as automatic inclusion of auto-generated reports into the
 output html artifacts (e.g. javadocs, reports created by PMD, checkstyle
 etc.) as per the specs given in pom.xml (assuming I am using maven for site
 building).
 
 I can specify such directives in site.xml. Similarly, is there a way by
 which I can direct doxia site renderer to automatically insert  in the
 output html (e.g. index.html for which the source is index.apt) hyperlinks
 to artifacts (not auto-generated like the 'reports', but created by other
 developers) that are placed in a pre-defined folder/directory (such as
 'resources')?
 
 Thanks!
 Nagarajan


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


  

Re: What does my application actually require?

2015-03-10 Thread Jörg Schaible
Hi Dan,

D C wrote:

 I was going to tag this onto my previous post, but I figured the issue is
 unique enough to be a different topic.
 
 
 When I run dependency:tree (with an empty .m2),  I get a nice tree graph
 showing 49 items.   I would expect then my .m2/repository to have 49 items
 in it.  In actuality, my .m2 now has 251 artifacts.

Well, yes. Maven and the plugins in use have also dependencies.

 I want to collect only the artifacts that my application needs to run.
 Would I be safe if I just package up the 49 items listed in the dependency
 tree output?

Use the dependency plugin to copy the dependencies.
http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-project-dependencies.html

 This would also be useful to reduce because I create my class path like
 so: $ find ~/.m2/repository/ -name *.jar | xargs | sed 's/ /;/g'
 
 The more I can remove from there, the better.

Leave the local repository alone. It is not of use for your task.

Cheers,
Jörg


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



Re: What does my application actually require?

2015-03-10 Thread Ron Wheeler
http://blog.artifact-software.com/tech/?p=121 describes how we 
approached the problem of reducing the number of jars on the classpath 
while simplifying the development process and speeding up builds.


It is a bit different from what you are trying to do tactically but I 
think that it may address your ultimate problem from a strategic point 
of view.


Ron

On 10/03/2015 10:33 AM, D C wrote:

I was going to tag this onto my previous post, but I figured the issue is
unique enough to be a different topic.


When I run dependency:tree (with an empty .m2),  I get a nice tree graph
showing 49 items.   I would expect then my .m2/repository to have 49 items
in it.  In actuality, my .m2 now has 251 artifacts.

I want to collect only the artifacts that my application needs to run.
Would I be safe if I just package up the 49 items listed in the dependency
tree output?

This would also be useful to reduce because I create my class path like so:
$ find ~/.m2/repository/ -name *.jar | xargs | sed 's/ /;/g'

The more I can remove from there, the better.


Thanks,
Dan




--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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



Re: Help with warning: 'Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo'

2015-03-10 Thread Karl Heinz Marbaise

Hi,


Do you have other warnings in your build? About missing artifacts etc. ?

The class is part ofr maven-sources-plugin which is weird, cause a 
single class can't be access if the plugin has been loaded...?


Check the log output of your build ...in particular start a clean 
build...remove the local repository from your jenkins build...and check 
the logging output carefullyusually this is caused by not correctly 
downloaded or missing artifacts in corporate repository managers...


BTW: How is Maven called ? Which Maven version do you use?

Kind regards
Karl Heinz Marbaise


On 3/10/15 4:31 PM, Charles Chan wrote:

We have a Maven project using the maven-source-plugin. When building the
project on Jenkins, it shows the following warning:

[INFO] *--- maven-jar-plugin:2.4:jar (default-jar) @ test-project ---
*[INFO] Building jar:
/home/jenkins/workspace/test-project/target/test-project-1.0.0-SNAPSHOT.jar[WARNING]
Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo


I tested with maven-source-plugin 2.2.1, 2.3, and 2.4 and all of these
versions exhibit the same problem. Does anyone know where it is coming from
and/or how to get rid of the warning?

Thank you,
Charles

---
I found a similar in the mailing list archive [1], but there was no answer
back then.
There is also this thread [2] on stackoverflow, but the suggestions didn't
appear work.

[1]
http://mail-archives.apache.org/mod_mbox/maven-users/201309.mbox/%3coff445bca1.9545b829-on85257bf1.004db657-85257bf1.004e0...@loomissayles.com%3E

[2]
http://stackoverflow.com/questions/28476924/maven-sourcejar-task-results-in-warnings





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



Maven phase that runs before dependency resolution

2015-03-10 Thread richard_senior
There is currently no phase in which you can run a plugin that is before
dependency resolution.
I believe this is a problem for Maven.
Imagine I wanted to create a plugin which could be used by the whole
company, and enforced a particular version naming strategy.
So take Spring for example, they are using an RC and RELEASE naming
convention.
Imagine I wanted to allow people to name their artifacts _BRANCH_5.
My plugin with find that and realise that a repository named
'http://blah/blah/BRANCH_5' should be added to the repositories list (before
resolution obviously).
Also, I can now get my plugin to add a different distrubutionManagement
section allowing the artifacts to be deployed to
http://blah/blah/BRANCH_5.

By the simple act of naming artifacts I can now manage multiple workstreams
in my pipeline with ease, and without requiring special settings files or
parent POM's.

While I'm on the subject of Maven deficiencies, why is it not possible to
specify distrubutionManagement in settings?
In fact.. it doesn't matter why... it's wrong.
Sometimes ... just sometimes.. I do believe I might try Gradle.



--
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-phase-that-runs-before-dependency-resolution-tp5828729.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