Re: Maven and Continous Integration / Continous Delivery

2016-04-20 Thread Irfan Sayed
here is what needs to be done:

   - while building the packages, use the mvn option -DnewVersion and
   replace the new version in POM.xml. this will happen through Jenkins server
   (for example CI server ) . for this, you need to make all POMs writable.
   - once the packages are built with new version, you deploy the newly
   created packages on some node and verify the sanity/smoking . execute some
   test cases..
   - if the smoke fails, you can anyway rollback as this was the on the fly
   change in the POM file.
   - once those are passed and package is working fine. you need to release
   that version of POM with maven release plugin
   - that will have following advantages:
  - sanitized build with all smoke passed
  - no need to have snapshot version in the POM so you can easily
  release. you got the releasable candidate always.
   - dependency:
  - the projects which we are dependent on this, for this we can have
  Jenkins job to update all the child POMs so that they can pull the newly
  created version.

hope this helps

Regards,



On Wed, Apr 20, 2016 at 4:25 PM, Hohl, Gerrit  wrote:

> Hello Stephen,
>
> I forgot that I not only have the problem in the IDE about debugging and
> viewing the code of project A from project B, I also can't do a local build
> which depends on the right version.
>
> I also have to add that the viewing even works for Eclipse using the
> Eclipse-Maven-Plugin as it recognizes only the name of the artifact when
> looking for an open project in the IDE and doesn't care for the version.
> But that is not really a feature as you will get problems if you want to
> use / debug with a version from your artifact repository which is different
> from the one which you have checked-out in your IDE.
>
> Regards,
> Gerrit
>
>
> -Ursprüngliche Nachricht-
> Von: Hohl, Gerrit [mailto:g.h...@aurenz.de]
> Gesendet: Mittwoch, 20. April 2016 12:08
> An: Maven Users List
> Betreff: AW: Maven and Continous Integration / Continous Delivery
>
> Hello Stephen,
>
> thank you very much for your fast and long answer.
> Somehow that seems very complicated.
> And unfortunately it also doesn't answer some of my questions.
>
> Let' say we have a project A with the following POM (short version just as
> an example):
>
> 
> com.company
> project-a
> 1.0-SNAPSHOT
> pom
> 
>
> If I build this my CI server will produce an artifact project-a-1.0.123
> (123 is the build number) and put this into the artifact repository.
>
> Then I have another project B with the following POM:
>
> 
> com.company
> project-b
> 1.0-SNAPSHOT
> pom
> 
> 
> com.company
> project-a
> ???
> 
> 
> 
> 
> com.company
> project-a
> 
> 
> 
>
> The resulting artifact will also something like project-b-1.0.234 (234 is
> the build number) and put into the artifact repository.
> But I will have the problem with the "???" at the version tag of project
> A. I can put there also "1.0-SNAPSHOT" which maybe would be okay for the
> environment of the developer. But if I want to build it on the CI server I
> have to define a unique version as I don't want that dependencies switch
> automatically and builds can't be repeated.
> If I put a defined version there I also need that defined version in the
> project A. Otherwise I will get problems in the IDE as it maybe don't
> realize that project B uses the project A which I currently have
> checked-out. Means if I do debugging I will always end up in the sources of
> the artifact downloaded from the artifact repository and not in the source
> code of project A which I also have checked-out.
>
> Regards,
> Gerrit
>
> -Ursprüngliche Nachricht-
> Von: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com]
> Gesendet: Mittwoch, 20. April 2016 11:47
> An: Maven Users List
> Betreff: Re: Maven and Continous Integration / Continous Delivery
>
> If I were doing this myself here is what I would do:
>
> I would use a MRM that has staging support and setup a Jenkins Pipeline
> that starts by doing `mvn release:prepare release:perform -B
> -DpushChanges=false -DlocalCheckout=true "-DdevelopmentVersion=dev-SNAPSHOT"
> "-DreleaseVersion=${BUILD_ID}" "-DpreparationGoals=clean validate"` it
> should also capture the GIT repo state so that the tag and release commits
> can be resurrected on a different node (because I'd be using e.g. docker
> based build slaves that are ephemeral)
>
> That will basically perform a release with the appropriate commits.
>
> Then you do the rest of your downstream tests on the release artifacts.
>
> If anything fails then I would drop the staging repo and nobody is any the
> wiser
>
> If it's all good and you are all set to push to production you 

Re: generate maven dependency difference between two Jenkins builds

2014-11-04 Thread Irfan Sayed
thanks. i am thinking of writing Jenkins plugin which reports the deltas of
maven dependencies between two builds
i searched , but did not find anyone
do you have any idea if such plugin exist OR how we can achieve this ?

regards,

On Tue, Nov 4, 2014 at 1:06 PM, domi d...@fortysix.ch wrote:

 Please be aware, changing the code of a released library (not SNAPSHOT) is
 not allowed and maven can not take any responsibility for any errors this
 will cause.
 Thats why nexus/artifactory do not allow to change the artifact of a
 released version once its uploaded.
 Only SNAPSHOT versions are allowed to be changed.
 Domi

 On 04.11.2014, at 08:10, Irfan Sayed irfu.sa...@gmail.com wrote:

  thanks.
  what i figured out is , nexus / artifactory will not download the
  dependency unless there is change in the version.
  if dependency x  refers version 1.1 , then maven will see if
  nexus/artifactory has this version along with local maben repo of build
  machine
  if it does both, maven will not download the dependency even if developer
  changes the code keeping the version same
 
  regards
 
 
  On Mon, Oct 20, 2014 at 5:55 AM, Bernd Eckenfels e...@zusammenkunft.net
 
  wrote:
 
  Hello,
 
  I was looking a bit deeper into making the dependency plugin to print
  out the resolved timestamps. I noticed there is already an option
  -DoutputAbsoluteArtifactFilename=true which would give me the path of
  the files in the local directory. This is all good for released
  versions, but it still points to the non-unique snapshot version files.
 
  I am not wondering, is there a way to configure the maven
  resolver/dependency management to actually not do that. When I look at
  the build output, it does download the meta data and a specific
  timestamped version:
 
  Downloaded: https://.../2.1-SNAPSHOT/maven-metadata.xml (2 KB at 0.6
  KB/sec)
  Downloaded:
  https://.../2.1-SNAPSHOT/commons-vfs2-2.1-20141016.153538-385.pom (12
 KB
  at 22.1 KB/sec)
  Downloading:
  https://.../2.1-SNAPSHOT/commons-vfs2-2.1-20141016.153538-385.jar
  Downloaded:
  https://.../2.1-SNAPSHOT/commons-vfs2-2.1-20141016.153538-385.jar
  (423 KB at 209.7 KB/sec)
 
  But it still creates a copy of that version without timestamp.
 
  I can imagine this is not really the best situation, why does it not
  stick to the uniquely named file?
 
  BTW: whats the best API way to get the snapshot timestamp from a
  Artifact object after it was resolved? I tried getDownloadURL(), but it
  is null for the Artifacts which are present in the list of
 
 
 
 org.apache.maven.plugin.dependency.utils.DependencyStatusSets.buildArtifactListOutput(SetArtifact,
  boolean, boolean, boolean)
 
  Gruss
  Bernd
 
  Am Sun, 19 Oct 2014 19:11:50 +0200
  schrieb Bernd Eckenfels e...@zusammenkunft.net:
 
  Ah another thing, I always wished there is an option to archive the
  effective POM instead of the tear downed POM with the
  maven-archiver (addMavenDesciptor).
 
  Especially when the effective pom also contains the resolved snapshot
  timestamps (which it currently not does).
 
  Speaking of effective pom, you can create and archive it, then you
  have at least all expressions and profiles locked down.
 
  Gruss
  Bernd
 
  Am Sun, 19 Oct 2014 22:17:45 +0530
  schrieb Irfan Sayed irfu.sa...@gmail.com:
 
  thanks bernd.
  anyone has any other suggestions please?
 
  regards
 
 
  On Sun, Oct 19, 2014 at 9:49 PM, Bernd Eckenfels
  e...@zusammenkunft.net wrote:
 
  Hello,
 
  I dont have a good method for that (especially not if all
  dependencies arent fully version-specified. You can use and add
  dependencies:list as a target to the maven build, then the
  resolved list will be printed in the build log. This list can
  change depending on what is available at build time.
 
  Gruss
  Bernd
 
   Am Sun, 19 Oct 2014 20:57:29 +0530
  schrieb Irfan Sayed irfu.sa...@gmail.com:
 
  hello,
 
  we have java project and using maven to build the same. we are
  using Jenkins. in Jenkins ,  we can generate the delta of source
  code changes between two builds.
  in the same way, do we have any way wherein , we can generate
  the delta of maven dependencies changed between two builds.
 
  please suggest
 
  regards
 
 
  -
  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
 
 


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




explicit dependencies in maven

2014-11-03 Thread Irfan Sayed
hello,

is there any good doc/blog which describes the handling of explicit
declaration of dependencies.
when we build the code, we use certain dependencies , how we can make sure
that when we reproduce the same build after the gap of 6 months , same and
exact dependencies will be used. ???
i know we can have artifactory/nexus , but that does not guarantee the
exact version of dependency when developer changes the code and make it
public keeping the version same

please suggest

regards


Re: explicit dependencies in maven

2014-11-03 Thread Irfan Sayed
so, lets say if i am using x dependency with version 1.1 and if the
developer changes the code of that dependency, keeping the same version as
1.1
then nexus will not download the latest code changes for that dependency
because the version still refers to 1.1 ???
if that is the case, this is really nice

regards


On Tue, Nov 4, 2014 at 10:20 AM, Ron Wheeler rwhee...@artifact-software.com
 wrote:

 Have you scanned the Maven books referenced on the Maven web site? Best
 starting place.

 With a repository (Nexus), people are prevented from deploying the same
 version twice so you are guaranteed that if you build with version 2.3.15
 of ourNiceUtility, you will always get the same code. The repo will simply
 not allow them to overwrite version 2.3.15 once it is deployed into the
 wild(public).

 Beats firing developers but stops them from doing silly things.



 On 03/11/2014 11:33 PM, Irfan Sayed wrote:

 hello,

 is there any good doc/blog which describes the handling of explicit
 declaration of dependencies.
 when we build the code, we use certain dependencies , how we can make sure
 that when we reproduce the same build after the gap of 6 months , same and
 exact dependencies will be used. ???
 i know we can have artifactory/nexus , but that does not guarantee the
 exact version of dependency when developer changes the code and make it
 public keeping the version same

 please suggest

 regards



 --
 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: explicit dependencies in maven

2014-11-03 Thread Irfan Sayed
thanks :)

On Tue, Nov 4, 2014 at 10:57 AM, Anders Hammar and...@hammar.net wrote:

 Yes, that's how it works.

 /Anders (mobile)
 Den 4 nov 2014 06:06 skrev Irfan Sayed irfu.sa...@gmail.com:

  so, lets say if i am using x dependency with version 1.1 and if the
  developer changes the code of that dependency, keeping the same version
 as
  1.1
  then nexus will not download the latest code changes for that dependency
  because the version still refers to 1.1 ???
  if that is the case, this is really nice
 
  regards
 
 
  On Tue, Nov 4, 2014 at 10:20 AM, Ron Wheeler 
  rwhee...@artifact-software.com
   wrote:
 
   Have you scanned the Maven books referenced on the Maven web site? Best
   starting place.
  
   With a repository (Nexus), people are prevented from deploying the same
   version twice so you are guaranteed that if you build with version
 2.3.15
   of ourNiceUtility, you will always get the same code. The repo will
  simply
   not allow them to overwrite version 2.3.15 once it is deployed into the
   wild(public).
  
   Beats firing developers but stops them from doing silly things.
  
  
  
   On 03/11/2014 11:33 PM, Irfan Sayed wrote:
  
   hello,
  
   is there any good doc/blog which describes the handling of explicit
   declaration of dependencies.
   when we build the code, we use certain dependencies , how we can make
  sure
   that when we reproduce the same build after the gap of 6 months , same
  and
   exact dependencies will be used. ???
   i know we can have artifactory/nexus , but that does not guarantee the
   exact version of dependency when developer changes the code and make
 it
   public keeping the version same
  
   please suggest
  
   regards
  
  
  
   --
   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: generate maven dependency difference between two Jenkins builds

2014-11-03 Thread Irfan Sayed
thanks.
what i figured out is , nexus / artifactory will not download the
dependency unless there is change in the version.
if dependency x  refers version 1.1 , then maven will see if
nexus/artifactory has this version along with local maben repo of build
machine
if it does both, maven will not download the dependency even if developer
changes the code keeping the version same

regards


On Mon, Oct 20, 2014 at 5:55 AM, Bernd Eckenfels e...@zusammenkunft.net
wrote:

 Hello,

 I was looking a bit deeper into making the dependency plugin to print
 out the resolved timestamps. I noticed there is already an option
 -DoutputAbsoluteArtifactFilename=true which would give me the path of
 the files in the local directory. This is all good for released
 versions, but it still points to the non-unique snapshot version files.

 I am not wondering, is there a way to configure the maven
 resolver/dependency management to actually not do that. When I look at
 the build output, it does download the meta data and a specific
 timestamped version:

 Downloaded: https://.../2.1-SNAPSHOT/maven-metadata.xml (2 KB at 0.6
 KB/sec)
 Downloaded:
 https://.../2.1-SNAPSHOT/commons-vfs2-2.1-20141016.153538-385.pom (12 KB
 at 22.1 KB/sec)
 Downloading:
 https://.../2.1-SNAPSHOT/commons-vfs2-2.1-20141016.153538-385.jar
 Downloaded:
 https://.../2.1-SNAPSHOT/commons-vfs2-2.1-20141016.153538-385.jar
 (423 KB at 209.7 KB/sec)

 But it still creates a copy of that version without timestamp.

 I can imagine this is not really the best situation, why does it not
 stick to the uniquely named file?

 BTW: whats the best API way to get the snapshot timestamp from a
 Artifact object after it was resolved? I tried getDownloadURL(), but it
 is null for the Artifacts which are present in the list of


 org.apache.maven.plugin.dependency.utils.DependencyStatusSets.buildArtifactListOutput(SetArtifact,
 boolean, boolean, boolean)

 Gruss
 Bernd

  Am Sun, 19 Oct 2014 19:11:50 +0200
 schrieb Bernd Eckenfels e...@zusammenkunft.net:

  Ah another thing, I always wished there is an option to archive the
  effective POM instead of the tear downed POM with the
  maven-archiver (addMavenDesciptor).
 
  Especially when the effective pom also contains the resolved snapshot
  timestamps (which it currently not does).
 
  Speaking of effective pom, you can create and archive it, then you
  have at least all expressions and profiles locked down.
 
  Gruss
  Bernd
 
  Am Sun, 19 Oct 2014 22:17:45 +0530
  schrieb Irfan Sayed irfu.sa...@gmail.com:
 
   thanks bernd.
   anyone has any other suggestions please?
  
   regards
  
  
   On Sun, Oct 19, 2014 at 9:49 PM, Bernd Eckenfels
   e...@zusammenkunft.net wrote:
  
Hello,
   
I dont have a good method for that (especially not if all
dependencies arent fully version-specified. You can use and add
dependencies:list as a target to the maven build, then the
resolved list will be printed in the build log. This list can
change depending on what is available at build time.
   
Gruss
Bernd
   
  Am Sun, 19 Oct 2014 20:57:29 +0530
schrieb Irfan Sayed irfu.sa...@gmail.com:
   
 hello,

 we have java project and using maven to build the same. we are
 using Jenkins. in Jenkins ,  we can generate the delta of source
 code changes between two builds.
 in the same way, do we have any way wherein , we can generate
 the delta of maven dependencies changed between two builds.

 please suggest

 regards

   
-
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




generate maven dependency difference between two Jenkins builds

2014-10-19 Thread Irfan Sayed
hello,

we have java project and using maven to build the same. we are using
Jenkins. in Jenkins ,  we can generate the delta of source code changes
between two builds.
in the same way, do we have any way wherein , we can generate the delta of
maven dependencies changed between two builds.

please suggest

regards


Re: generate maven dependency difference between two Jenkins builds

2014-10-19 Thread Irfan Sayed
thanks bernd.
anyone has any other suggestions please?

regards


On Sun, Oct 19, 2014 at 9:49 PM, Bernd Eckenfels e...@zusammenkunft.net
wrote:

 Hello,

 I dont have a good method for that (especially not if all dependencies
 arent fully version-specified. You can use and add dependencies:list as
 a target to the maven build, then the resolved list will be printed in
 the build log. This list can change depending on what is available at
 build time.

 Gruss
 Bernd

   Am Sun, 19 Oct 2014 20:57:29 +0530
 schrieb Irfan Sayed irfu.sa...@gmail.com:

  hello,
 
  we have java project and using maven to build the same. we are using
  Jenkins. in Jenkins ,  we can generate the delta of source code
  changes between two builds.
  in the same way, do we have any way wherein , we can generate the
  delta of maven dependencies changed between two builds.
 
  please suggest
 
  regards
 

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




Re: generate maven dependency difference between two Jenkins builds

2014-10-19 Thread Irfan Sayed
thanks bernd.
can you please explain in detail . i am sorry but haven't got much
if u can give me steps then that wud be great

regards


On Sun, Oct 19, 2014 at 10:41 PM, Bernd Eckenfels e...@zusammenkunft.net
wrote:

 Ah another thing, I always wished there is an option to archive the
 effective POM instead of the tear downed POM with the
 maven-archiver (addMavenDesciptor).

 Especially when the effective pom also contains the resolved snapshot
 timestamps (which it currently not does).

 Speaking of effective pom, you can create and archive it, then you have
 at least all expressions and profiles locked down.

 Gruss
 Bernd

 Am Sun, 19 Oct 2014 22:17:45 +0530
 schrieb Irfan Sayed irfu.sa...@gmail.com:

  thanks bernd.
  anyone has any other suggestions please?
 
  regards
 
 
  On Sun, Oct 19, 2014 at 9:49 PM, Bernd Eckenfels
  e...@zusammenkunft.net wrote:
 
   Hello,
  
   I dont have a good method for that (especially not if all
   dependencies arent fully version-specified. You can use and add
   dependencies:list as a target to the maven build, then the resolved
   list will be printed in the build log. This list can change
   depending on what is available at build time.
  
   Gruss
   Bernd
  
 Am Sun, 19 Oct 2014 20:57:29 +0530
   schrieb Irfan Sayed irfu.sa...@gmail.com:
  
hello,
   
we have java project and using maven to build the same. we are
using Jenkins. in Jenkins ,  we can generate the delta of source
code changes between two builds.
in the same way, do we have any way wherein , we can generate the
delta of maven dependencies changed between two builds.
   
please suggest
   
regards
   
  
   -
   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




failsafe plugin error with suiteXml

2014-10-07 Thread Irfan Sayed
hi,

i am using maven failsafe plugin to run the integration tests
however, i am getting following error when i am executing integration tests
along with cobertura

execute goal mvn-failsafe-plugin: (failsafe-integration-tests) project x:
suiteXmlFiles is configured, but there is no TestNG dependency
http://stackoverflow.com/questions/26233462/execute-goal-mvn-failsafe-plugin-failsafe-integration-tests-project-x-suitex

can some one please suggest what could be the error
i have added TestNG dependnecy at every possible location in pom file
still the issue

please please suggest

regards


Re: failsafe plugin error with suiteXml

2014-10-07 Thread Irfan Sayed
please suggest .. i am really stuck

regards


On Tue, Oct 7, 2014 at 10:51 PM, Irfan Sayed irfu.sa...@gmail.com wrote:

 hi,

 i am using maven failsafe plugin to run the integration tests
 however, i am getting following error when i am executing integration
 tests along with cobertura

 execute goal mvn-failsafe-plugin: (failsafe-integration-tests) project x:
 suiteXmlFiles is configured, but there is no TestNG dependency
 http://stackoverflow.com/questions/26233462/execute-goal-mvn-failsafe-plugin-failsafe-integration-tests-project-x-suitex

 can some one please suggest what could be the error
 i have added TestNG dependnecy at every possible location in pom file
 still the issue

 please please suggest

 regards




maven compiler plugin

2013-10-10 Thread Irfan Sayed
hi,

i am using maven compiler plugin. i havent mentioned anything related to
plugin in POM.xml

i have just used the command on command prompt
mvn compiler:compile
what is happening is , above command compiles the test classes also .
however which should not be the case

in my opinion, only main java source files should get compiled and when i
execute compiler:testcompile goal , then only test classes should get
compile

please suggest how to just compile main source files and skip test cases
compilation

regards