Re: mvn release is failing with git

2011-08-05 Thread Mark Derricutt
It sounds like the main thing you want to do is work offline, usually with git 
I favour using the following release plugin settings:

pushChangesfalse/pushChanges
localCheckouttrue/localCheckout

This tells the release plugin to NOT push during the release, and to checkout 
from the local repository.  Leaving ME to do push to which ever upstream 
repository when I want/can.

Mark



On 4/08/2011, at 1:46 PM, erwin.muel...@deventm.org wrote:

I have them in properties because I like to change them without to touch 
 the pom.xml. Sometimes I work at home, there I have a good internet 
 connection, but sometimes I work with my laptop with no/bad connection. So I 
 setup a git repository and Archiva on localhost.
 
git pull and git push works, and mvn deploy works, too. mvn scm update 
 works, too. So I don't understand, if I use the ssh protocol in the URLs, mvn 
 release works just fine. Is it an issue with the git protocol?
 


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



Re: How to Convert Ant Project to MAVEN

2011-08-05 Thread Barrie Treloar
On Fri, Aug 5, 2011 at 9:17 AM, Daivish Shah daivish.s...@gmail.com wrote:
 Hi,

 I have some questions for your guys. As i am starting converting projects
 from ANT to MAVEN.

Your questions are answered by reading the maven books, freely
available at http://maven.apache.org/articles.html.
Or you could purchase consulting.

Your questions require too much detail to responded too in an email
when your technical level needs improving.
The books are the best way.

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



Maven build issue

2011-08-05 Thread javafan2011
I have multi module project where one project contains excel spreadsheet and
it is being dropped in the target folder when maven build the project. Now
when I do a mvn clean install, sometime maven throws an error that it can
not delete the abc.xls file. So I started using maven-clean-plugin and
trying to exclude this file. Still I am getting the same error. Strange
problem is, if i close my eclipse and do the build from command line then it
works fine. But for that everytime i want to do clean build I have to close
my eclipse. Also I am using M2ECLIPSE plugin for my project. Here is my
maven-clean-plugin looks like


maven-clean-plugin
2.4.1




${basedir}/target/classes/

**/*.xls






Any insight would be helpful.

Thanks

--
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-build-issue-tp4669414p4669414.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: Maven build issue

2011-08-05 Thread Jörg Schaible
javafan2011 wrote:

 I have multi module project where one project contains excel spreadsheet
 and it is being dropped in the target folder when maven build the project.
 Now when I do a mvn clean install, sometime maven throws an error that it
 can not delete the abc.xls file. So I started using maven-clean-plugin
 and trying to exclude this file. Still I am getting the same error.
 Strange problem is, if i close my eclipse and do the build from command
 line then it works fine. But for that everytime i want to do clean build I
 have to close my eclipse. Also I am using M2ECLIPSE plugin for my project.
 Here is my maven-clean-plugin looks like
 
 
 maven-clean-plugin
 2.4.1
 
 
 
 
 ${basedir}/target/classes/
 
 **/*.xls
 
 
 
 
 
 
 Any insight would be helpful.

In short: Write proper tests!

You're actually working on Windows and that file is created/opened during a 
unit test, but the OutputStream/InputStream is not properly closed i.e. 
Windows has an open file handle. Unless this file handle exists, you cannot 
delete the file. Closing Eclipse will obviously terminate the parent process 
of the file handle.

- Jörg


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



Re: mvn release is failing with git

2011-08-05 Thread Erwin Mueller
Hi,

I tried with 

activeProfiles
activeProfilerepository-root-urls-local/activeProfile
activeProfilerepository-proxy-local/activeProfile
/activeProfiles

and it works ony partial. Why is the release plugin only using git push 
*git://localhost/~devent* rssconjava-parent-2.2? Where is the rest of the URL? 
In the previous invocation it is using the full URL 
git://localhost/~devent/rssconjava.git
Here is the log:

[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
  git add -- pom.xml 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-api/pom.xml
 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-native/pom.xml
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
  git status
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
  git commit --verbose -F /tmp/maven-scm-119610202.commit pom.xml 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-api/pom.xml
 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-native/pom.xml
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
  git symbolic-ref HEAD
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
  git push git://localhost/~devent/rssconjava.git master:master
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava/rssconjava-parent
[INFO] Tagging release with the label rssconjava-parent-2.2...
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava  git tag -F 
/tmp/maven-scm-729109272.commit rssconjava-parent-2.2
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava
[INFO] Executing: /bin/sh -c cd 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava  *git push 
git://localhost/~devent rssconjava-parent-2.2*
[INFO] Working directory: 
/mnt/read/projects/com.globalscalingsoftware/rsscon/rssconjava
...
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on 
project rssconjava-parent: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: The remote end hung up unexpectedly
[ERROR] - [Help 1]

In the release.properties file it have the full URL:

#release configuration
#Fri Aug 05 20:39:50 PHT 2011
project.dev.com.globalscalingsoftware.rsscon\:rssconjava-native=2.3-SNAPSHOT
scm.commentPrefix=[maven-release-plugin] 
project.scm.com.globalscalingsoftware.rsscon\:rssconjava-parent.tag=HEAD
project.dev.com.globalscalingsoftware.rsscon\:rssconjava-api=2.3-SNAPSHOT
scm.tag=rssconjava-parent-2.2
project.rel.com.globalscalingsoftware.rsscon\:rssconjava-api=2.2
remoteTagging=true
exec.additionalArguments=-Dmaven.test.skip\=true -P 
repository-root-urls-local,repository-proxy-local
project.scm.com.globalscalingsoftware.rsscon\:rssconjava-parent.url=scm\:git\:git\://localhost/~devent/rssconjava.git
project.scm.com.globalscalingsoftware.rsscon\:rssconjava-native.empty=true
scm.url=scm\:git\:git\://localhost/~devent/rssconjava.git
project.scm.com.globalscalingsoftware.rsscon\:rssconjava-parent.connection=scm\:git\:git\://localhost/~devent/rssconjava.git
project.scm.com.globalscalingsoftware.rsscon\:rssconjava-api.empty=true
preparationGoals=clean verify
project.rel.com.globalscalingsoftware.rsscon\:rssconjava-parent=2.2
project.scm.com.globalscalingsoftware.rsscon\:rssconjava-parent.developerConnection=scm\:git\:git\://localhost/~devent/rssconjava.git
project.dev.com.globalscalingsoftware.rsscon\:rssconjava-parent=2.3-SNAPSHOT
project.rel.com.globalscalingsoftware.rsscon\:rssconjava-native=2.2
completedPhase=scm-commit-release

Kind regards, Erwin.


- Ansgar Konermann ansgar.konerm...@googlemail.com wrote:

 Am 05.08.2011 03:05, schrieb Erwin Mueller:
  Hi,
 
  Maybe I need to activate the profile from the command line?
 
 Either that or use activeProfiles in your settings.xml instead of
 activeByDefault. The latter is is *only* relevant if no other
 profiles
 are activated (as the release plugin does). This is documented
 behaviour
 according to [1].
 
 Best regards,
 
 Ansgar
 
 [1]
 

Re: mvn release is failing with git

2011-08-05 Thread Erwin Mueller
Hi,

yes, I want to work offline. But I want to automate all as much as 
possible, that's why I'm using the release plugin.

Thank you, Erwin.


- Mark Derricutt m...@talios.com wrote:

 It sounds like the main thing you want to do is work offline, usually
 with git I favour using the following release plugin settings:
 
 pushChangesfalse/pushChanges
 localCheckouttrue/localCheckout
 
 This tells the release plugin to NOT push during the release, and to
 checkout from the local repository.  Leaving ME to do push to which
 ever upstream repository when I want/can.
 
 Mark
 
 
 
 On 4/08/2011, at 1:46 PM, erwin.muel...@deventm.org wrote:
 
 I have them in properties because I like to change them without
 to touch the pom.xml. Sometimes I work at home, there I have a good
 internet connection, but sometimes I work with my laptop with no/bad
 connection. So I setup a git repository and Archiva on localhost.
  
 git pull and git push works, and mvn deploy works, too. mvn scm
 update works, too. So I don't understand, if I use the ssh protocol in
 the URLs, mvn release works just fine. Is it an issue with the git
 protocol?
  
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org

-- 
Erwin Mueller, erwin.muel...@deventm.org
http://www.global-scaling-institute.de/
http://www.deventm.org

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



test-classes not used as classpath

2011-08-05 Thread Michel Jung
Hi

My test-classes folder is not in the classpath - neither in eclipse, nor
when running the application with maven.
I created a new sample app, like this:

src/main/java/com/example/Main:

public static void main(final String[] args) {
System.out.println(Main.class.getResourceAsStream(/file.txt));
}

And a file:
src/test/resources/file.txt

This was tested on two different computers with different eclipse
installations. The output is always the same: null.
What's wrong? I thought I already had such code working. It's also described
in
http://maven.apache.org/guides/getting-started/index.html#How_do_I_add_resources_to_my_JAR

Thanks in advance.
Michel


Re: test-classes not used as classpath

2011-08-05 Thread Baptiste MATHUS
Hi,

This is expected behaviour.
Test-sources see main-sources, not the contrary, and it's a very good thing.

Compiled test-sources logically don't get packaged inside the resulting
archive (say jar, war...).

If you want a resources accessible from main-sources, put them inside
src/main/resources, not src/test/resources.

Cheers

2011/8/5 Michel Jung michel.jun...@gmail.com

 Hi

 My test-classes folder is not in the classpath - neither in eclipse, nor
 when running the application with maven.
 I created a new sample app, like this:

 src/main/java/com/example/Main:

public static void main(final String[] args) {
System.out.println(Main.class.getResourceAsStream(/file.txt));
}

 And a file:
 src/test/resources/file.txt

 This was tested on two different computers with different eclipse
 installations. The output is always the same: null.
 What's wrong? I thought I already had such code working. It's also
 described
 in

 http://maven.apache.org/guides/getting-started/index.html#How_do_I_add_resources_to_my_JAR

 Thanks in advance.
 Michel




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


Re: Maven build issue

2011-08-05 Thread javafan2011
yes I am working on windows machine, but i didnt run even unit test inside
this project. As someone else is working on this project. Also my project is
dependent on this module but even in my unit test I am not referring to
claases from this project, so how come it will keep the handle in windows
file system. I was reading about maven-clean-plugin and saw the
excludeDefaultDirectoriestrue/excludeDefaultDirectories option not
sure it is a good idea to use this option to ignore as in future i might
need to compile the project



--
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-build-issue-tp4669414p4669689.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



Plugin stanza: inherited element? What exactly does it do?

2011-08-05 Thread Laird Nelson
I have a common-sense idea (possibly wrong) of what the plugin element's
inherited child element does, but I was hoping for a very clear
explanation.

I'm sure I'm just looking in the wrong place, but I didn't see anything in
the POM reference that explains what the inherited element does.

I am sure that it must govern whether a plugin's configuration is passed on
down to sub-poms that inherit from the pom inside of which the relevant
plugin declaration is found.  But can it also prevent the plugin stanza
itself from being inherited?

I have a multi-module project set up with a root pom that is both an
aggregator and a parent.  (I know, I know, let's leave that one alone for
now.)

I'd like to set up a plugin declaration to use the maven-assembly-plugin to
put together a kind of standalone uber-distribution from the root.  But I
don't want this plugin--any aspect of it, at all--to be inherited by the
children.  That is, when I run mvn assembly:single from the root, I want it
to run only once, and not to run for the child projects.  Perhaps this is
impossible.  Perhaps this is possible only with mvn -N assembly:single from
the root.

Any tips are gratefully (as always) appreciated.

Best,
Laird


Re: Maven build issue

2011-08-05 Thread Baptiste MATHUS
By default clean plugin just deletes target. So excluding something inside
is unlikely to work well.

If I were you, I'd install and use a small software for Windows called
unlocker. If your build fails cleaning, try to unlock target directory.
You should see what is using the directory and you'll almost be done.

It could be something both simple and nasty like the search indexer of
windows... Been there myself...

HTH

Cheers
Le 5 août 2011 16:30, javafan2011 javafan2...@gmail.com a écrit :
 yes I am working on windows machine, but i didnt run even unit test inside
 this project. As someone else is working on this project. Also my project
is
 dependent on this module but even in my unit test I am not referring to
 claases from this project, so how come it will keep the handle in windows
 file system. I was reading about maven-clean-plugin and saw the
 excludeDefaultDirectoriestrue/excludeDefaultDirectories option not
 sure it is a good idea to use this option to ignore as in future i might
 need to compile the project



 --
 View this message in context:
http://maven.40175.n5.nabble.com/Maven-build-issue-tp4669414p4669689.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



Relation between reporting plugins and build plugins / pluginManagment in Maven 3?

2011-08-05 Thread ziesemer
I have a Maven parent POM that contains
org.apache.maven.plugins:maven-javadoc-plugin:2.8 under pluginManagement/. 
Under build/plugins/plugin, I have
org.apache.maven.plugins:maven-site-plugin:3.0 , with a
configuration/reportPlugins/plugin for 
org.apache.maven.plugins:maven-javadoc-plugin - along with several other
reporting plugins.

This works great for most of my child projects.  However, I have at least
one project where I need to add a link to
http://download.oracle.com/javaee/5/api/ (using configuration/links/link). 
This works great for building the Javadoc jar (javadoc:jar), but the links
are not being added for the Javadocs being generated for the site.

There are a number of related issues going on here, so I apologize that I'm
not exactly sure where to start.

As I mentioned, the javadoc:jar is working exactly as expected. 
Additionally, when generating the site, it shows:

[INFO] Skipped JavaDocs report, file apidocs/index.html already exists
for the English version.

However, a few lines later, it continues to re-generate the JavaDocs anyway:

[INFO] Generating JavaDocs report--- maven-javadoc-plugin:2.8

When it does this, it does not use the additional links that were configured
in the plugin.

Now granted, the Java EE Javadocs are probably common enough that I could
probably just add the link to the parent - but what if this was a unique
Javadoc dependency that only impacted a given child project, or if I didn't
have access to update the parent?

I tried moving my link configuration from build/plugins/plugin to
build/pluginManagement/plugins/plugin .  This still worked for the
javadoc:jar, but not for the reporting goal.

I then tried to extend the reporting configuration in my child project.  I
added a build/plugin for org.apache.maven.plugins:maven-site-plugin:3.0,
just as in the parent, and added a configuration/reportPlugins/plugin for
the javadoc plugin, with a repeated configuration for the links to be used. 
This worked great, as the links were then made within the site Javadocs -
but then all other site plugins were no longer being executed.  It seems by
re-defining reportPlugins/, the plugin list was overwritten instead of
appended to?

I'm using the latest Maven versions of everything.

Please let me know if this is a known issue (possibly related to the
reporting / site overhaul that appears to have happened for Maven 3), if
additional details or examples are needed, or if this should be a candidate
for a bug report.

Thanks!!

--
Mark A. Ziesemer

--
View this message in context: 
http://maven.40175.n5.nabble.com/Relation-between-reporting-plugins-and-build-plugins-pluginManagment-in-Maven-3-tp4670353p4670353.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



xmlbeans-maven-plugin can't find javac

2011-08-05 Thread David Hoffer
When I use the default configuration for xmlbeans-maven-plugin it fails
because its looking for javac in the current directory (where the pom is).
If I add the configuration below then it works.  How can I make this work in
a portable way?

 configuration
compilerC:/Program Files
(x86)/Java/jdk1.6.0_26/bin/javac.exe/compiler
...

-Dave


Re: Maven build issue

2011-08-05 Thread javafan2011
Hmm, Looks like a good tool to release a lock but I would have loved if some
config would have been available in maven

--
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-build-issue-tp4669414p4670423.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



Re: Relation between reporting plugins and build plugins / pluginManagment in Maven 3?

2011-08-05 Thread ziesemer
Somewhat answered my own question.  After some additional searching, I found
http://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Inheritance_of_reports
and http://jira.codehaus.org/browse/MSITE-596 .  This explains the
overridden reportPlugins/ that I mentioned.

What are any recommended workarounds, if any?  Following the core concepts
of Maven, I'd expect to have a solution that doesn't require
copying-and-pasting of the link URLs for Javadoc within a project (inherited
or not), as well as not needing to copy reporting plugins between parent and
child.

This could also work if the javadoc plugin just re-used the existing
generated Javadocs during site-generation, without re-generating them with
its own configuration...

--
View this message in context: 
http://maven.40175.n5.nabble.com/Relation-between-reporting-plugins-and-build-plugins-pluginManagment-in-Maven-3-tp4670353p4670575.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



Re: Plugin stanza: inherited element? What exactly does it do?

2011-08-05 Thread Anders Hammar
 I'd like to set up a plugin declaration to use the maven-assembly-plugin to
 put together a kind of standalone uber-distribution from the root.


In my opinion it's much better to put this in a separate module.


 But I
 don't want this plugin--any aspect of it, at all--to be inherited by the
 children. That is, when I run mvn assembly:single from the root, I want it
 to run only once, and not to run for the child projects.  Perhaps this is
 impossible.  Perhaps this is possible only with mvn -N assembly:single from
 the root.


When executing assembly:single you will not be executing the build lifecycle
(and thus building all modules) but just execute that plugin goal. Shouldn't
be any problem then, but understand that it's probably not the Maven way as
the assembly artifact being built will not be deployed to the repo.

/Anders


Re: Relation between reporting plugins and build plugins / pluginManagment in Maven 3?

2011-08-05 Thread ziesemer
See also: http://jira.codehaus.org/browse/MSITE-516 and
http://jira.codehaus.org/browse/MSITE-523

--
View this message in context: 
http://maven.40175.n5.nabble.com/Relation-between-reporting-plugins-and-build-plugins-pluginManagment-in-Maven-3-tp4670353p4670622.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



Re: Plugin stanza: inherited element? What exactly does it do?

2011-08-05 Thread Laird Nelson
On Fri, Aug 5, 2011 at 3:23 PM, Anders Hammar and...@hammar.net wrote:

  I'd like to set up a plugin declaration to use the maven-assembly-plugin
 to
  put together a kind of standalone uber-distribution from the root.

 In my opinion it's much better to put this in a separate module.


I sort of see what you are talking about, but if I want the distribution to
include (say) source code from all of the aggregator's modules, how would
the separate module come up with a list of modules?  Wouldn't I be repeating
the list of modules somewhere?

 When executing assembly:single you will not be executing the build
 lifecycle
 (and thus building all modules) but just execute that plugin goal.


I see.


 Shouldn't
 be any problem then, but understand that it's probably not the Maven way as
 the assembly artifact being built will not be deployed to the repo.


Oh!  OK; I didn't see an assembly:deploy or anything like that.  What would
you suggest?

Thanks,
Laird


Re: Plugin stanza: inherited element? What exactly does it do?

2011-08-05 Thread Anders Hammar
I guess [1] could give you some help. You would then do this in the
aggregator project.

If you want it as part of the build you need to bind the plugin goal to the
Maven lifecycle. Basic Maven stuff, Google or a Maven book is your friend.
Then just execute mvn deploy and the source archive will be deployed if
you configure the assembly plugin correctly.

/Anders

[1]
http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-source-inclusion-simple.html

On Fri, Aug 5, 2011 at 21:57, Laird Nelson ljnel...@gmail.com wrote:

 On Fri, Aug 5, 2011 at 3:23 PM, Anders Hammar and...@hammar.net wrote:

   I'd like to set up a plugin declaration to use the
 maven-assembly-plugin
  to
   put together a kind of standalone uber-distribution from the root.
 
  In my opinion it's much better to put this in a separate module.
 

 I sort of see what you are talking about, but if I want the distribution to
 include (say) source code from all of the aggregator's modules, how would
 the separate module come up with a list of modules?  Wouldn't I be
 repeating
 the list of modules somewhere?

  When executing assembly:single you will not be executing the build
  lifecycle
  (and thus building all modules) but just execute that plugin goal.


 I see.


  Shouldn't
  be any problem then, but understand that it's probably not the Maven way
 as
  the assembly artifact being built will not be deployed to the repo.
 

 Oh!  OK; I didn't see an assembly:deploy or anything like that.  What would
 you suggest?

 Thanks,
 Laird



Re: Plugin stanza: inherited element? What exactly does it do?

2011-08-05 Thread Laird Nelson
On Fri, Aug 5, 2011 at 4:11 PM, Anders Hammar and...@hammar.net wrote:

 I guess [1] could give you some help. You would then do this in the
 aggregator project.


Right, which is what I think you were saying was to be discouraged.  But
that page says that it is common practice.  From the cited link:

It is common practice to create an assembly using the parent POM of a
 multimodule build. At times, you may want to ensure that this assembly also
 includes the source code from one or more of the modules in this build.


Which is it?  :-)


 If you want it as part of the build you need to bind the plugin goal to the
 Maven lifecycle. Basic Maven stuff, Google or a Maven book is your friend.


Sure; I understand this part.


 Then just execute mvn deploy and the source archive will be deployed if
 you configure the assembly plugin correctly.


Oh, so the assembly plugin will take care of marking the artifacts it
produces in some magic way so that deploy will know about them?  That would
be handy indeed.

Thanks,
Laird


Re: Maven 3 and cargo plugin

2011-08-05 Thread bluewhale
Hi Benjamin,

mvn carg2:help works. I got some successful maven downloads with this
command.

Now I run into the next problem, where cargo tells me that it find no
glassfish plugin,
as im trying to deploy to a locally installed glassfish:

[ERROR] No plugin found for prefix 'glassfish' in the current project and in
the plugin groups [org.codehaus.cargo, org.apache.maven.plugins,
org.codehaus.mojo] available from the repositories [local
(d:\dev\maven-3.0.3\repository), central (http://repo1.maven.org/maven2)] -
[Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin
found for prefix 'glassfish' in the current project and in the plugin groups
[org.codehaus.cargo, org.apache.maven.plugins, org.codehaus.mojo] available
from the repositories [local (d:\dev\maven-3.0.3\repository), central
(http://repo1.maven.org/maven2)]
at
org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:92)

Mabe this is another problem with the release. I will check with the cargo
list.

Thanks for your reply.

Stefan



--
View this message in context: 
http://maven-users.828.n2.nabble.com/Maven-3-and-cargo-plugin-tp6007841p6657911.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



Re: Plugin stanza: inherited element? What exactly does it do?

2011-08-05 Thread Anders Hammar
  I guess [1] could give you some help. You would then do this in the
  aggregator project.

 Right, which is what I think you were saying was to be discouraged.  But
 that page says that it is common practice.  From the cited link:

 It is common practice to create an assembly using the parent POM of a
  multimodule build. At times, you may want to ensure that this assembly
 also
  includes the source code from one or more of the modules in this build.
 

 Which is it?  :-)


I believe I wrote that *I* think that creating a separate module is better.
I did not write that page. :-)
Anyhow, I would say that normally it's better to create a separate module.
But sometimes that would not work, which it doesn't I think for your use
case. Maven's artifacts are per project, but your working on the full tree
of modules/projects which calls for hacks...

Oh, so the assembly plugin will take care of marking the artifacts it
 produces in some magic way so that deploy will know about them?


Yes. There's a configuration option for this which is true (attach as
artifacts) by default. Convention over configuration...

/Anders


Re: How can a plugin become aware of its environment (e.g. properties)?

2011-08-05 Thread Mark H. Wood
On Thu, Aug 04, 2011 at 04:05:10PM -0400, Mark H. Wood wrote:
 Back to topic:  I'm writing a plugin that needs access to the
 project's properties.  Nothing environmental is passed to a mojo, and
 fishing through the Javadocs for static methods that look promising
 has turned up nothing so far.  What *should* I be reading?

Well, after more hours of fishing, it looks like people are cobbling
this together by declaring a @readonly @parameter
default-value=${project} and calling getSomething() on the injected
object.  It seems to work, but is this officially documented anywhere?

-- 
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
Asking whether markets are efficient is like asking whether people are smart.


pgpR2iBzAKZtv.pgp
Description: PGP signature


Re: Multimodule distribution

2011-08-05 Thread glenh
Have you tried using filesets?  You can include/exclude files/directories in
your assembly descriptor.

--
View this message in context: 
http://maven.40175.n5.nabble.com/Multimodule-distribution-tp4574067p4670472.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



How can we avoid checking for updates for jars we already have?

2011-08-05 Thread Trent Larson
Our Maven builds suddenly started failing a few days ago, apparently because
our chosen mirror (for repo1.maven.org/maven2) is no longer accessible.

Here is the output:

[INFO] artifact org.springframework:spring-core: checking for updates from
central
[WARNING] repository metadata for: 'artifact
org.springframework:spring-core' could not be retrieved from repository:
central due to an error: Error transferring file
[INFO] Repository 'central' will be blacklisted
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

No versions are present in the repository for the artifact with a range
[2.5.2,3)
  org.springframework:spring-core:jar:null


I can think of a few solutions:

- Let's just avoid downloading jars we already have!  We've got the
following in our .m2/repository:
org/springframework/spring-core/2.5.5/spring-core-2.5.5.jar

This seems like the simplest solution... I guess I don't understand why
Maven is checking external repos for something it already has.  BTW, we
don't depend on spring-core directly, so I assume it's due to a transitive
dependency from this:
   dependency
  groupIdorg.springframework/groupId
  artifactIdspring/artifactId
  version2.5.5/version
/dependency

- Maybe there's a metadata setting for those Spring artifacts where I can
force it to stop going external.  (I tried specifying spring-core directly
so it won't look elsewhere, to no avail.)  It looks like it's seeking some
range of versions for some reason.  Maybe there's a way to specify the
version of this transitive dependency in some other dependency somewhere.
But I don't see any way to do those things.  (How can I see which other
thing is including this particular spring-core?)

- If we can get to repo1.maven.org/maven2, that would be nice, but we
cannot.  (At least, it doesn't come up in my browser.)  And we used to use a
mirror, but now we can't get to any of the known mirrors, either.  Someone
just mentioned that there have been issues due to the recent IP
changeshttp://www.sonatype.com/people/2011/07/the-central-repository-is-getting-faster-are-you-ready-for-the-new-ips/,
and that seems to say that repo1 is still available... but shouldn't it come
up in my browser?

Thanks for any ideas.
Trent