AW: Failsafe Plugin: How to get resource dependencies for integration-tests?

2012-07-30 Thread Markus Karg
Thanks to all for all the kind help!

In fact I made it work, and the solution is as simple as using the dependency 
plugin:

plugin
artifactIdmaven-dependency-plugin/artifactId
version2.4/version
executions
execution
idcopy/id
phaseintegration-test/phase
goals
goalcopy/goal
/goals
configuration
artifactItems
artifactItem
groupIdG/groupId
artifactIdA/artifactId
versionV/version
typedb/type

destFileNamemyDbFile.db/destFileName
/artifactItem
/artifactItems
/configuration
/execution
/executions
/plugin

Regards
Markus

-Ursprüngliche Nachricht-
Von: Laird Nelson [mailto:ljnel...@gmail.com] 
Gesendet: Freitag, 27. Juli 2012 17:31
An: Maven Users List
Betreff: Re: Failsafe Plugin: How to get resource dependencies for 
integration-tests?

On Fri, Jul 27, 2012 at 7:27 AM, Martin Gainty mgai...@hotmail.com wrote:

 Marcus
 you can copy applicable resources with maven-resources-plugin 
 http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.htmljustremember
  to hook the phase you want to bind to e.g.
 phasevalidate/phasemaven phases are listed here:
 http://maven.apache.org/guides/introduction/introduction-to-the-lifecy
 cle.html


You might also find this helpful:
http://maven.apache.org/plugins/maven-remote-resources-plugin/

Best,
Laird

--
http://about.me/lairdnelson

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


aspectj-maven-plugin:compile complianceLevel vs source

2012-07-30 Thread Mikhail Kalkov
Hi,

I was looking for complianceLevel option for maven-eclipse-plugin the other 
day, and there was none. My intention was to set JDT preferences in a generated 
Eclipse project as follows:
  org.eclipse.jdt.core.compiler.source=1.5
  org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
  org.eclipse.jdt.core.compiler.compliance=1.6
This way I would be able to build software for Java 5 yet still use @Override 
annotation on interface implementations, which was not allowed until Java 6. 
One valid question that somebody on this list asked me was what exactly 
compliance level means, and I was unable to answer it apart from the fact that 
it solves my problem and a couple guesses.

Now I've discovered that aspectj-maven-plugin's compile mojo already has a 
complianceLevel parameter [1]! Can somebody who used it explain the difference 
between it and source parameter or provide a docs reference? What happens if 
one parameter is set to 1.5 and another one to 1.6?

[1] http://mojo.codehaus.org/aspectj-maven-plugin/compile-mojo.html

Kind regards,
Mikhail Kalkov

Purple Scout AB
Software Developer

Address: Östra Hamngatan 31, SE- 41110 Gothenburg, Sweden
Phone:   +46 (0) 732 - 051405
E-mail:  mikhail.kal...@purplescout.se
Web: www.purplescout.se

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



Re: Failsafe Plugin: How to get resource dependencies for integration-tests?

2012-07-30 Thread Stephen Connolly
I suggest binding to the pre-integration-test phase as there is no
guarantee that the dependency plugin will always execute before failsafe if
you are binding to the integration-test phase

On 30 July 2012 11:12, Markus Karg k...@quipsy.de wrote:

 Thanks to all for all the kind help!

 In fact I made it work, and the solution is as simple as using the
 dependency plugin:

 plugin
 artifactIdmaven-dependency-plugin/artifactId
 version2.4/version
 executions
 execution
 idcopy/id
 phaseintegration-test/phase
 goals
 goalcopy/goal
 /goals
 configuration
 artifactItems
 artifactItem
 groupIdG/groupId
 artifactIdA/artifactId
 versionV/version
 typedb/type

 destFileNamemyDbFile.db/destFileName
 /artifactItem
 /artifactItems
 /configuration
 /execution
 /executions
 /plugin

 Regards
 Markus

 -Ursprüngliche Nachricht-
 Von: Laird Nelson [mailto:ljnel...@gmail.com]
 Gesendet: Freitag, 27. Juli 2012 17:31
 An: Maven Users List
 Betreff: Re: Failsafe Plugin: How to get resource dependencies for
 integration-tests?

 On Fri, Jul 27, 2012 at 7:27 AM, Martin Gainty mgai...@hotmail.com
 wrote:

  Marcus
  you can copy applicable resources with maven-resources-plugin
 
 http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.htmljustrememberto
  hook the phase you want to bind to e.g.
  phasevalidate/phasemaven phases are listed here:
  http://maven.apache.org/guides/introduction/introduction-to-the-lifecy
  cle.html


 You might also find this helpful:
 http://maven.apache.org/plugins/maven-remote-resources-plugin/

 Best,
 Laird

 --
 http://about.me/lairdnelson

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



RE: Using ant-contrib in ant based plugin development

2012-07-30 Thread Lyons, Roy
Excellent!  That explains why I had so much trouble with the 'for' task.  I 
will give this method a try with the xml instead.  I very much appreciate your 
reply on this.

-Original Message-
From: Aurélien Girardeau [mailto:aurelien.girard...@gmail.com] 
Sent: Saturday, July 28, 2012 8:26 AM
To: Maven Users List; manf...@mosabuam.com
Subject: Re: Using ant-contrib in ant based plugin development

Hi Roy,

I use ant-contrib in a Ant-based Mojo and it works fine for me.

Here is my ant-contrib declaration in my build.xml:

taskdef resource=net/sf/antcontrib/antlib.xml
classpath
pathelement location=${ant-contrib-jar} /
/classpath
/taskdef

Note that antcontrib.properties doesn't contain for declaration. Prefer 
antlib.xml.

and here is my mojos.xml for ${ant-contrib-jar} parameter:

parameter
nameant-contrib-jar/name
propertyant-contrib-jar/property
requiredtrue/required
expression${ant-contrib-jar}/expression
defaultValue${project.build.directory}/antcontrib/
ant-contrib-1.0b3.jar/defaultValue
typejava.lang.String/type
description/description
/parameter

Note that I don't use a antcontrib artifact deployed in my local repo, but a 
antcontrib jar installed in my ${project.build.directory}. I dont't think it 
change anything.

Did you try an echo on your  ${settings.localRepository}  or  ${user.home} to 
check they are correcty loaded at Maven runtime?

Hope it can help,

Aurélien


2012/7/27 Manfred Moser manf...@mosabuam.com

 Why are you not implementing your plugin in Java or even Groovy?


 http://www.sonatype.com/books/mcookbook/reference/writing-plugins-alte
 rnative-sect-writing-groovy.html

 Shell script seems like a bad idea to me if you want it to run everywhere..

 manfred

 On Fri, July 27, 2012 2:26 pm, Lyons, Roy wrote:
  Update:
 
  Not hearing anything made me give up on pure ant...  I was able to 
  get things working with the shellscript shell=ksh task, and just
 embedding
  kornshell.  That, of course, defeats the usual idea of a plugin 
  since it is platform specific...  but later on, I can add in support 
  for windows
 by
  doing a similar shellscript directive with cmd based on the osfamily
 task.
   Interestingly, I was able to use both of those from ant-contrib...  but
  not for   or if
 
  Odd.
 
 
  I am still interested in possibilities of using ant in its pure 
  form, so any responses to this thread are still welcome.
 
  Thanks,
 
  Roy
  
  From: Lyons, Roy
  Sent: Friday, July 27, 2012 12:16 PM
  To: Maven Users List
  Subject: RE: Using ant-contrib in ant based plugin development
 
  my webmail made me login again, and I didnt see part of my message 
  was missing.  here is the full thing:
 
 
  Maven User List,
 
  I waited in sending to this list until after I had exhausted my 
  other resources, including google searching, documentation, and 
  experimentation of my own.
 
  As such, I hope that your collective minds can take on this challenge.
 
 
  So here is the problem:
 
  [INFO]task-segment: [com.cme.plugins:cme-packaging:cme-packaging]
  (aggregator-style)
  [INFO]
  
   [INFO] [cme-packaging:cme-packaging {execution: default-cli}]
 
  cmepackage:
   [echo] We are in UNIX
  [INFO]
  
  
  [ERROR] BUILD ERROR
  [INFO]
  
   [INFO] Failed to execute: Executing Ant script: 
  package.build.xml
  [cmepackage]: Failed to execute.
 
  Could not create task or type of type: for.
 
  Ant could not find the task or a class this task relies upon.
 
  This is common and has a number of causes; the usual solutions are 
  to read the manual pages then download and install needed JAR files, 
  or fix the build file:
   - You have misspelt 'for'.
 Fix: check your spelling.
   - The task needs an external JAR file to execute
   and this is not found at the right place in the classpath.
 
 
  What is extremely interesting to me is the fact that it can use the 
  task definition for osfamily, but not for the for task.  Also of 
  interest to me is the fact that I can use this script with ant -f 
  without a problem.
 
  Before I get suggestions that I should use java instead, I need to
 confess
  that I am only now just learning java.  My job in configuration
 management
  uses a whole lot more in perl and ksh than anything...
 
  Also, my research showed lots of ways to cope with it in antrun, 
  with an inline script -- but that won't do so much for me as I am 
  trying to make
 a
  plugin...
 
  Here is my declaration in my pom:
 
  build
  plugins
plugin
  artifactIdmaven-plugin-plugin/artifactId
  version2.5/version
  !-- Add the Ant plugin tools --
  dependencies
dependency
  

RE: Failsafe Plugin: How to get resource dependencies for integration-tests?

2012-07-30 Thread Markus KARG
Good point! :-)

 -Original Message-
 From: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com]
 Sent: Montag, 30. Juli 2012 16:11
 To: Maven Users List
 Subject: Re: Failsafe Plugin: How to get resource dependencies for
 integration-tests?
 
 I suggest binding to the pre-integration-test phase as there is no
 guarantee that the dependency plugin will always execute before
 failsafe if you are binding to the integration-test phase
 
 On 30 July 2012 11:12, Markus Karg k...@quipsy.de wrote:
 
  Thanks to all for all the kind help!
 
  In fact I made it work, and the solution is as simple as using the
  dependency plugin:
 
  plugin
  artifactIdmaven-dependency-plugin/artifactId
  version2.4/version
  executions
  execution
  idcopy/id
  phaseintegration-test/phase
  goals
  goalcopy/goal
  /goals
  configuration
  artifactItems
  artifactItem
  groupIdG/groupId
 
 artifactIdA/artifactId
  versionV/version
  typedb/type
 
  destFileNamemyDbFile.db/destFileName
  /artifactItem
  /artifactItems
  /configuration
  /execution
  /executions
  /plugin
 
  Regards
  Markus
 
  -Ursprüngliche Nachricht-
  Von: Laird Nelson [mailto:ljnel...@gmail.com]
  Gesendet: Freitag, 27. Juli 2012 17:31
  An: Maven Users List
  Betreff: Re: Failsafe Plugin: How to get resource dependencies for
  integration-tests?
 
  On Fri, Jul 27, 2012 at 7:27 AM, Martin Gainty mgai...@hotmail.com
  wrote:
 
   Marcus
   you can copy applicable resources with maven-resources-plugin
  
  http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-
 resources.htmljustrememberto hook the phase you want to bind to e.g.
   phasevalidate/phasemaven phases are listed here:
   http://maven.apache.org/guides/introduction/introduction-to-the-
 life
   cy
   cle.html
 
 
  You might also find this helpful:
  http://maven.apache.org/plugins/maven-remote-resources-plugin/
 
  Best,
  Laird
 
  --
  http://about.me/lairdnelson
 
  -
  To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
  For additional commands, e-mail: users-h...@maven.apache.org
 


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



RE: failsafe report displays no results

2012-07-30 Thread Rodriguez, John
Any words of wisdom from the community? :)

-Original Message-
From: John Rodriguez [mailto:john.rodrig...@gmail.com] 
Sent: Thursday, July 26, 2012 9:00 PM
To: users@maven.apache.org
Subject: failsafe report displays no results

I just started using maven-failsafe-plugin and maven-surefire-report-plugin 
so my apologies in advance...

For starters, I've configured maven-failsafe-plugin and 
maven-surefire-report-plugin as such (respectively):

build
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-failsafe-plugin/artifactId
version2.12/version
executions
execution
goals
goalintegration-test/goal
goalverify/goal
/goals
/execution
/executions
/plugin
...
reporting
plugins
  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-surefire-report-plugin/artifactId
version2.12/version
reportSets
reportSet
idintegration-tests/id
reports
reportfailsafe-report-only/report
/reports
/reportSet
/reportSets
  /plugin
/plugins
/reporting
...

I have two test cases defined in /src/test/java/.../GameResourceIT.java like so:

public class GameResourceIT extends TestCase {
public static final String LOCAL_SERVER_URL_ROOT = 
http://localhost:8080/gameservice;;
public static final String GAMES_RESOURCE_URI = /games;

public void testGetGamesForDate_20120603_status200Expected()
throws Exception {
String date = 06-03-2012;
Client client = Client.create();
WebResource webResource =
client.resource(LOCAL_SERVER_URL_ROOT + GAMES_RESOURCE_URI + / + date);
ClientResponse response =
webResource.accept(application/json).get(ClientResponse.class);
assertEquals(Failed : status =  + response.getStatus() + , body =  
+ response.getEntity(String.class),
response.getStatus(), Status.OK.getStatusCode());
}

public void testGetGamesForDate_20120608_status404Expected()
throws Exception {
String date = 06-08-2012;
Client client = Client.create();
WebResource webResource =
client.resource(LOCAL_SERVER_URL_ROOT + GAMES_RESOURCE_URI + / + date);
ClientResponse response =
webResource.accept(application/json).get(ClientResponse.class);
assertEquals(Failed : status =  + response.getStatus() + , body =  
+ response.getEntity(String.class),
response.getStatus(), Status.NOT_FOUND.getStatusCode());
}
}

...

When I run mvn verify, I get the following:

[INFO] --- maven-failsafe-plugin:2.12:integration-test (default) @ gameservice 
--- [INFO] Failsafe report directory: ...\gameservice\target\failsafe-reports
---
 T E S T S
---
Running GameResourceIT
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.938 sec  
FAILURE!

Results :
Failed tests:
testGetGamesForDate_20120608_status404Expected(...GameResourceIT):
Failed : status = 200, body = null expected:200 but was:404 Tests run: 2, 
Failures: 1, Errors: 0, Skipped: 0

[INFO] --- maven-failsafe-plugin:2.12:verify (default) @ gameservice --- [INFO] 
Failsafe report directory:...\gameservice\target\failsafe-reports
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 13.753s
[INFO] Finished at: Thu Jul 26 20:39:44 EDT 2012
2012-07-26 20:39:44.644::INFO:  Shutdown hook complete [INFO] Final Memory: 
21M/52M [INFO] 

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-failsafe-plugin:2.12:verify (default) on project 
gameservice: There are test failures.


Fine.  As expected, 1 of the 2 tests failed.  But as NOT expected, the verify 
goal failed as well (I thought integration test failures would not halt 
execution, but simply be recorded).

Now, if I look at /target/failsafe-reports/GameResourceIT.txt and 
/target/failsafe-reports/TEST-GameResourceIT.xml, I see as expected that 1 of 2 
tests failed.
When I look at /target/failsafe-reports/failsafe-summary.xml, I see:
failsafe-summary result=255 /

Finally, if I run mvn:site surefire-report:report, I get an html page in 
/target/site/surefire-report.html that shows all 0s for the report summary 
(tests, errors, failures, skipped, etc.)

Why would this be the case?  I expected maven-surefire-report-plugin to 
transform the 

RE: Using ant-contrib in ant based plugin development

2012-07-30 Thread Lyons, Roy
I would like to report back that indeed the issue was with needing to use the 
xml instead.  I had thought for sure that it was an issue with the classpath 
within maven, but I have a feeling that ant-contrib was already in my path when 
it came to running ant externally -- and this is why I saw a different behavior.

I am not sure if anyone on this list has write-access to the how-to on writing 
maven plugins with ant...  but if there is, can you update the page to include 
a section on using ant-contrib functions and include this information to allow 
those who come after me to not have to bang their head for a few hours?  The 
functions included in contrib would be very useful for moving official build 
scripts into a plugin method instead (which is what I plan to do here).

Thanks,

Roy

-Original Message-
From: Lyons, Roy 
Sent: Monday, July 30, 2012 9:23 AM
To: Maven Users List
Subject: RE: Using ant-contrib in ant based plugin development

Excellent!  That explains why I had so much trouble with the 'for' task.  I 
will give this method a try with the xml instead.  I very much appreciate your 
reply on this.

-Original Message-
From: Aurélien Girardeau [mailto:aurelien.girard...@gmail.com]
Sent: Saturday, July 28, 2012 8:26 AM
To: Maven Users List; manf...@mosabuam.com
Subject: Re: Using ant-contrib in ant based plugin development

Hi Roy,

I use ant-contrib in a Ant-based Mojo and it works fine for me.

Here is my ant-contrib declaration in my build.xml:

taskdef resource=net/sf/antcontrib/antlib.xml
classpath
pathelement location=${ant-contrib-jar} /
/classpath
/taskdef

Note that antcontrib.properties doesn't contain for declaration. Prefer 
antlib.xml.

and here is my mojos.xml for ${ant-contrib-jar} parameter:

parameter
nameant-contrib-jar/name
propertyant-contrib-jar/property
requiredtrue/required
expression${ant-contrib-jar}/expression
defaultValue${project.build.directory}/antcontrib/
ant-contrib-1.0b3.jar/defaultValue
typejava.lang.String/type
description/description
/parameter

Note that I don't use a antcontrib artifact deployed in my local repo, but a 
antcontrib jar installed in my ${project.build.directory}. I dont't think it 
change anything.

Did you try an echo on your  ${settings.localRepository}  or  ${user.home} to 
check they are correcty loaded at Maven runtime?

Hope it can help,

Aurélien


2012/7/27 Manfred Moser manf...@mosabuam.com

 Why are you not implementing your plugin in Java or even Groovy?


 http://www.sonatype.com/books/mcookbook/reference/writing-plugins-alte
 rnative-sect-writing-groovy.html

 Shell script seems like a bad idea to me if you want it to run everywhere..

 manfred

 On Fri, July 27, 2012 2:26 pm, Lyons, Roy wrote:
  Update:
 
  Not hearing anything made me give up on pure ant...  I was able to 
  get things working with the shellscript shell=ksh task, and just
 embedding
  kornshell.  That, of course, defeats the usual idea of a plugin 
  since it is platform specific...  but later on, I can add in support 
  for windows
 by
  doing a similar shellscript directive with cmd based on the osfamily
 task.
   Interestingly, I was able to use both of those from ant-contrib...  but
  not for   or if
 
  Odd.
 
 
  I am still interested in possibilities of using ant in its pure 
  form, so any responses to this thread are still welcome.
 
  Thanks,
 
  Roy
  
  From: Lyons, Roy
  Sent: Friday, July 27, 2012 12:16 PM
  To: Maven Users List
  Subject: RE: Using ant-contrib in ant based plugin development
 
  my webmail made me login again, and I didnt see part of my message 
  was missing.  here is the full thing:
 
 
  Maven User List,
 
  I waited in sending to this list until after I had exhausted my 
  other resources, including google searching, documentation, and 
  experimentation of my own.
 
  As such, I hope that your collective minds can take on this challenge.
 
 
  So here is the problem:
 
  [INFO]task-segment: [com.cme.plugins:cme-packaging:cme-packaging]
  (aggregator-style)
  [INFO]
  
   [INFO] [cme-packaging:cme-packaging {execution: default-cli}]
 
  cmepackage:
   [echo] We are in UNIX
  [INFO]
  
  
  [ERROR] BUILD ERROR
  [INFO]
  
   [INFO] Failed to execute: Executing Ant script: 
  package.build.xml
  [cmepackage]: Failed to execute.
 
  Could not create task or type of type: for.
 
  Ant could not find the task or a class this task relies upon.
 
  This is common and has a number of causes; the usual solutions are 
  to read the manual pages then download and install needed JAR files, 
  or fix the build file:
   - You have misspelt 'for'.
 Fix: check your spelling.
   - The task needs an external 

RE: How can I trigger a makefile through Maven? is there any plugin for this?

2012-07-30 Thread huseyn
Hi,

I have eigtht libraries. There are very dependieces. I use c/c++ and
makefile. How can I solve the problem of dependency?  Can you help me?


Thanks, 

Huseyn D.




--
View this message in context: 
http://maven.40175.n5.nabble.com/How-can-I-trigger-a-makefile-through-Maven-is-there-any-plugin-for-this-tp5663921p5715218.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



[ANN] apt-maven-plugin 1.0-alpha-5 released

2012-07-30 Thread Russell Gold
Hi, 

The Mojo team is pleased to announce the release of the apt-maven-plugin 
version 1.0-alpha-5, which runs the old annotation processor.

http://mojo.codehaus.org/apt-maven-plugin

The get this update, simply specify the version in your project's plugin 
configuration:

plugin
groupIdorg.codehaus.mojo/groupId
artifactIdapt-maven-plugin/artifactId
version1.o-alpha-5/version
/plugin

Release Notes:

The following bugs have been fixed:
[MOJO-1609] - EclipseMojo creates factory path entries with trailing whitespace
[MOJO-1702] - apt plugin fails when running on java 7

Enjoy,

The Mojo team.

Russell Gold



-
Come read my webnovel, Take a Lemon http://www.takealemon.com, 
and listen to the Misfile radio play 
http://www.gold-family.us/audio/misfile.html!






Re: How can I trigger a makefile through Maven? is there any plugin for this?

2012-07-30 Thread Ed Hillmann
Use the native plugin?

http://mojo.codehaus.org/maven-native/native-maven-plugin/

I've never used this, so I'm not much more help than supplying the URL

On Mon, Jul 30, 2012 at 10:49 PM, huseyn hdemire...@gmail.com wrote:

 Hi,

 I have eigtht libraries. There are very dependieces. I use c/c++ and
 makefile. How can I solve the problem of dependency?  Can you help me?


 Thanks,

 Huseyn D.




 --
 View this message in context:
 http://maven.40175.n5.nabble.com/How-can-I-trigger-a-makefile-through-Maven-is-there-any-plugin-for-this-tp5663921p5715218.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: How can I trigger a makefile through Maven? is there any plugin for this?

2012-07-30 Thread Barrie Treloar
On Mon, Jul 30, 2012 at 10:19 PM, huseyn hdemire...@gmail.com wrote:
 Hi,

 I have eigtht libraries. There are very dependieces. I use c/c++ and
 makefile. How can I solve the problem of dependency?  Can you help me?

www.catb.org/~esr/faqs/smart-questions.html

Please start your own email thread ad don't hijack threads
http://www.urbandictionary.com/define.php?term=Thread%20Hijackingdefid=6353149
(p.s. following up on some of the answers to this thread might be
worthwhile too)

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