The problem is that Jenkins always builds from a directory other than your 
project root directory, so it uses -f to point at the root project POM.  Before 
I changed the shell scripts, the search for the .mvn directory was always 
starting at the current directory (which is why Jenkins never found the .mvn 
directory in the project directory.  Now, if -f is specified, we start the 
search for the .mvn directory at the directory where the POM is and search 
upwards.  This has the effect of making the search return the same result 
whether I run Maven from the project directory where the POM lives or run it 
from somewhere else using -f to point to the POM.


-----Original Message-----
From: Eric B [mailto:[email protected]] 
Sent: Wednesday, June 07, 2017 9:56 AM
To: Maven Users List
Subject: Re: Jenkins Maven build not seeing my .mvn folder?

Thanks for the links and the info, but after reading MNG-5889, I'm even more 
confused.

Am I to understand that MNG-5889 is specifically regarding Maven to look for 
the .mvn folder in the directory of the invoked pom file rather than in the 
current working directory?  Will this break my current structure in which my 
.mvn folder is in my project root rather than the parent-pom folder?

What is the "right" structure for something like this?

Thanks,

Eric

On Tue, Jun 6, 2017 at 2:31 PM, Arnaud Héritier <[email protected]> wrote:

> It is 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.apache.org
> _jira_plugins_servlet_mobile-23issue_MNG-2D5889&d=DwIFaQ&c=RoP1YumCXCg
> aWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_Oz
> wdxJosG0&m=DKZbfvfOJ877bL08jqrSvN62YONIRSjetJmqdDQOI5c&s=YbXM6yIwnPBd6
> 3HpjgNrJBLFNGJp3iMljW2p0FjVWYg&e=
>
>
> Le mar. 6 juin 2017 à 20:27, Arnaud Héritier <[email protected]> a 
> écrit :
>
> > The problem with extensions is different. And I don't think we'll fix it.
> > The problem .mvn and usage of -f is a maven bug fixed in 3.5.0 or 
> > 3.5.1
> >
> > Le mar. 6 juin 2017 à 19:36, Pascal <[email protected]> a écrit :
> >
> >> The existing bug to support core extensions:
> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__issues.jenkins
> >> -2Dci.org_browse_JENKINS-2D30058&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQc
> >> xBKCX5YTpkKY057SbK10&r=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0&
> >> m=DKZbfvfOJ877bL08jqrSvN62YONIRSjetJmqdDQOI5c&s=-xoxaqwRjn1MZ3sswGF
> >> -jUbPTk6ZcaTliheKgJ4mcIM&e=
> >>
> >> As I said, the only solution so far is to use a Freestyle project. 
> >> You
> can
> >> find more details in the bug comments.
> >>
> >> Pascal
> >>
> >>
> >> 2017-06-06 19:27 GMT+02:00 Pascal <[email protected]>:
> >>
> >> > Hello,
> >> >
> >> > I fear you have done everything correctly and the issue is with 
> >> > the Jenkins Maven plugin. There is already a bug report in the 
> >> > Jenkins
> Maven
> >> > Plugin, but it's hard to find. If I recall how to find it, I will 
> >> > post
> >> it
> >> > here.
> >> >
> >> > Unfortunately, it does not look like an easy bug, so you cannot 
> >> > use
> the
> >> > "Maven" Job type in Jenkins together with the .mvn folder feature.
> >> However,
> >> > what you can do is create a Freestyle Job and add a build step 
> >> > "Call
> >> Maven
> >> > goals".
> >> >
> >> > Cheers,
> >> >
> >> > Pascal
> >> >
> >> >
> >> > 2017-06-06 18:13 GMT+02:00 Eric B <[email protected]>:
> >> >
> >> >> Hi,
> >> >>
> >> >> I'm cross posting this to StackOverflow ( 
> >> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__stackoverfl
> >> >> ow.com_q_44394234_827480&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX
> >> >> 5YTpkKY057SbK10&r=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0&m=
> >> >> DKZbfvfOJ877bL08jqrSvN62YONIRSjetJmqdDQOI5c&s=S_n7abikLs0LWBcnJf
> >> >> Z-R-AkRN85ejJyezl_Nvwt4D8&e= ) b/c I'm not truly
> >> convinced
> >> >> this is a maven question per say.  Rather I think it is more
> something
> >> due
> >> >> to my Jenkins job config that is causing some issues, but I am 
> >> >> hoping
> >> that
> >> >> maven users here may have encountered this in Jenkins as well.
> Either
> >> >> that, or maybe someone can point out that I'm using the .mvn 
> >> >> folder incorrectly.
> >> >>
> >> >> Essentially, I have a multi-module maven project that is set up as:
> >> >>
> >> >> |.mvn
> >> >>  \-maven.config
> >> >>  \-jvm.config
> >> >> |superpom
> >> >>  \-pom.xml (main project parent pom, includes module defns)
> >> >> |module1
> >> >>  \-pom.xml (parent points to ../superpom/pom.xml)  \src
> >> >>   \...
> >> >> |module2
> >> >>  \-pom.xml (parent points to ../superpom/pom.xml)  \src
> >> >>   \...
> >> >>
> >> >> My maven.config file is defined as:
> >> >>
> >> >> -Dsign.alias=cert
> >> >> -Dsign.storepass=changeit
> >> >> -Dsign.keypass=changeit
> >> >> -Dcheckstyle.skip=true
> >> >> -Dcobertura.skip=true
> >> >> -Dpmd.skip=true
> >> >> -DskipTests=true
> >> >> -DdatabaseUrl=jdbc:sqlserver://localhost:1433;databaseName=TEMP
> >> >> -DuserName=test
> >> >> -Dpassword=test
> >> >> -f superpom/pom.xml
> >> >>
> >> >> If I run my maven build from the command line, everything builds 
> >> >> as expected. ie:
> >> >>
> >> >> [project]$ mvn clean install
> >> >>
> >> >> However, when I configure my jenkins job, it is failing as 
> >> >> though it
> is
> >> >> not
> >> >> seeing/reading the .mvn/ folder/files. In fact, to be honest, 
> >> >> I'm not entirely sure how to configure my maven project in 
> >> >> Jenkins. If I
> leave
> >> my
> >> >> ROOT pom definition as blank, then Jenkins complains it doesn't 
> >> >> have
> a
> >> >> pom.xml file.
> >> >>
> >> >> If I specify my root pom as superpom/pom.xml then it isn't 
> >> >> loading
> any
> >> of
> >> >> my config files.
> >> >>
> >> >> To be safe, I've even tried adding my .mvn folder in my superpom
> >> folder,
> >> >> but that too is ignored.
> >> >>
> >> >> jenkins.log:
> >> >>
> >> >> [superpom] $ 
> >> >> /var/jenkins_home/tools/hudson.model.JDK/JDK_7/bin/java
> >> >> -cp /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven33-
> >> >> agent-1.8.1.jar:/var/jenkins_home/tools/hudson.tasks.Maven_
> >> >> MavenInstallation/Maven_3.3.9/boot/plexus-classworlds-2.5.2.
> >> >> jar:/var/jenkins_home/tools/hudson.tasks.Maven_
> >> >> MavenInstallation/Maven_3.3.9/conf/logging
> >> >> jenkins.maven3.agent.Maven33Main
> >> >>
> >> /var/jenkins_home/tools/hudson.tasks.Maven_
> MavenInstallation/Maven_3.3.9
> >> >> /var/jenkins_home/war/WEB-INF/lib/remoting-3.7.jar
> >> >> /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven33-
> >> >> interceptor-1.8.1.jar
> >> >> /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven3-
> >> >> interceptor-commons-1.8.1.jar
> >> >> 38679
> >> >> <===[JENKINS REMOTING CAPACITY]===>channel started using 
> >> >> settings config with name Settings.xml Replacing all maven 
> >> >> server entries not found in credentials list is
> >> true
> >> >> Executing Maven:  -B -f
> >> >> /var/jenkins_home/workspace/JB4(Maven)/superpom/pom.xml
> >> >> -Dmaven.repo.local=/var/jenkins_home/workspace/JB4(
> Maven)/.repository
> >> >> -s /tmp/settings4167440206098086967.xml clean install [INFO] 
> >> >> Scanning for projects...
> >> >>
> >> >>
> >> >> I'm not sure if I am using the .mvn folder incorrectly, if there 
> >> >> is something wrong with my Jenkins job configuration.
> >> >>
> >> >> Am I doing this right?  Am I missing a step somewhere?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Eric
> >> >>
> >> >
> >> >
> >>
> > --
> > -----
> > Arnaud Héritier
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__aheritier.net&d=
> > DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Ql5uwmbofQMW0
> > iErugdCnFgO-CBGr_pt_OzwdxJosG0&m=DKZbfvfOJ877bL08jqrSvN62YONIRSjetJm
> > qdDQOI5c&s=ZisSKdYTeh78NsdxXkbCUuB7ZglQF_KXlEfRaI0sQm8&e=
> > Mail/GTalk: aheritier AT gmail DOT com Twitter/Skype : aheritier
> >
> --
> -----
> Arnaud Héritier
> https://urldefense.proofpoint.com/v2/url?u=http-3A__aheritier.net&d=Dw
> IFaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Ql5uwmbofQMW0iEru
> gdCnFgO-CBGr_pt_OzwdxJosG0&m=DKZbfvfOJ877bL08jqrSvN62YONIRSjetJmqdDQOI
> 5c&s=ZisSKdYTeh78NsdxXkbCUuB7ZglQF_KXlEfRaI0sQm8&e=
> Mail/GTalk: aheritier AT gmail DOT com Twitter/Skype : aheritier
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to