Re: Unable to run Maven Goals using pipeline as code.

2018-08-14 Thread Baptiste Mathus
By the way, you might be interested to learn about and use the 'Pipeline
Maven Plugin'.

Cheers

Le mar. 7 août 2018 à 17:50, suny nazar  a écrit :

> Issue is fixed , by providing tools configuration in Jenkins file.
>
> tools {
> maven 'JenkinsMaven'
> jdk 'JenkinsJDK'
> }
>
> On Tuesday, 7 August 2018 18:54:11 UTC+5:30, yossibr9876 wrote:
>>
>> Hi,
>> make sure u have a jdk !!! (I think you have jre ) .
>>
>> On Tuesday, August 7, 2018 at 3:48:36 PM UTC+3, suny nazar wrote:
>>>
>>>
>>> i am getting below error when i am running maven goals via Jenkinsfile. I 
>>> am not getting this issue when i am running freestyle project with maven 
>>> goals.
>>>
>>>
>>> [ERROR] Failed to execute goal 
>>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
>>> (default-compile) on project server: Compilation failure
>>> [ERROR] Unable to locate the Javac Compiler in:
>>> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
>>> [ERROR] Please ensure you are using JDK 1.4 or above and
>>> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
>>> [ERROR] In most cases you can change the location of your Java
>>> [ERROR] installation by setting the JAVA_HOME environment variable.
>>>
>>>
>>> below code has been put in Jenkinsfile.
>>>
>>>
>>> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
>>> Files\Java\jdk1.8.0_181
>>>
>>>
>>> pipeline {
>>> agent any
>>> stages{
>>> stage('Build'){
>>> steps {
>>> bat 'mvn clean package'
>>> }
>>> post {
>>> success {
>>> echo 'Now Archiving...'
>>> archiveArtifacts artifacts: '**/target/*.war'
>>> }
>>> }
>>> }
>>> }
>>> }
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/9f1c0bd3-5cb6-4b7b-b704-f8c3052a641d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS4J2FpkmWjKR3RjftzveARaEGqoYTT5kUot6S%3D5b_FEjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread suny nazar
Issue is fixed , by providing tools configuration in Jenkins file.

tools { 
maven 'JenkinsMaven' 
jdk 'JenkinsJDK' 
}

On Tuesday, 7 August 2018 18:54:11 UTC+5:30, yossibr9876 wrote:
>
> Hi,
> make sure u have a jdk !!! (I think you have jre ) .
>
> On Tuesday, August 7, 2018 at 3:48:36 PM UTC+3, suny nazar wrote:
>>
>>
>> i am getting below error when i am running maven goals via Jenkinsfile. I am 
>> not getting this issue when i am running freestyle project with maven goals.
>>
>>
>> [ERROR] Failed to execute goal 
>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
>> (default-compile) on project server: Compilation failure
>> [ERROR] Unable to locate the Javac Compiler in:
>> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
>> [ERROR] Please ensure you are using JDK 1.4 or above and
>> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
>> [ERROR] In most cases you can change the location of your Java
>> [ERROR] installation by setting the JAVA_HOME environment variable.
>>
>>
>> below code has been put in Jenkinsfile.
>>
>>
>> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
>> Files\Java\jdk1.8.0_181
>>
>>
>> pipeline {
>> agent any
>> stages{
>> stage('Build'){
>> steps {
>> bat 'mvn clean package'
>> }
>> post {
>> success {
>> echo 'Now Archiving...'
>> archiveArtifacts artifacts: '**/target/*.war'
>> }
>> }
>> }
>> }
>> }
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9f1c0bd3-5cb6-4b7b-b704-f8c3052a641d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread suny nazar
Did n't get you , actually i have tried two options in Global tool 
configuration.

1 Maven and JDK was given local paths.
2 Maven and JDK were set to be installed by Jenkins.

in both cases it did not work , when i am trying locally to run mvn compile 
, it works. It also works with freestyle project , i am having this issue 
with pipeline job using jenkinsfile.

can anyone , tell me if i need to change jenkinsfile to pickup correct 
paths.

On Tuesday, 7 August 2018 18:20:04 UTC+5:30, slide wrote:
>
> Is JAVA_HOME set to that for the user that Jenkins is running as?
>
> On Tue, Aug 7, 2018 at 5:48 AM suny nazar > 
> wrote:
>
>>
>> i am getting below error when i am running maven goals via Jenkinsfile. I am 
>> not getting this issue when i am running freestyle project with maven goals.
>>
>>
>> [ERROR] Failed to execute goal 
>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
>> (default-compile) on project server: Compilation failure
>> [ERROR] Unable to locate the Javac Compiler in:
>> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
>> [ERROR] Please ensure you are using JDK 1.4 or above and
>> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
>> [ERROR] In most cases you can change the location of your Java
>> [ERROR] installation by setting the JAVA_HOME environment variable.
>>
>>
>> below code has been put in Jenkinsfile.
>>
>>
>> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
>> Files\Java\jdk1.8.0_181
>>
>>
>> pipeline {
>> agent any
>> stages{
>> stage('Build'){
>> steps {
>> bat 'mvn clean package'
>> }
>> post {
>> success {
>> echo 'Now Archiving...'
>> archiveArtifacts artifacts: '**/target/*.war'
>> }
>> }
>> }
>> }
>> }
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/f257a74a-c2a8-42ce-89d4-7a69a3c85e52%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d21780cd-fce0-48aa-b3bb-dc718317a212%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread yossibr9876
Hi,
make sure u have a jdk !!! (I think you have jre ) .

On Tuesday, August 7, 2018 at 3:48:36 PM UTC+3, suny nazar wrote:
>
>
> i am getting below error when i am running maven goals via Jenkinsfile. I am 
> not getting this issue when i am running freestyle project with maven goals.
>
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
> (default-compile) on project server: Compilation failure
> [ERROR] Unable to locate the Javac Compiler in:
> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
> [ERROR] Please ensure you are using JDK 1.4 or above and
> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
> [ERROR] In most cases you can change the location of your Java
> [ERROR] installation by setting the JAVA_HOME environment variable.
>
>
> below code has been put in Jenkinsfile.
>
>
> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
> Files\Java\jdk1.8.0_181
>
>
> pipeline {
> agent any
> stages{
> stage('Build'){
> steps {
> bat 'mvn clean package'
> }
> post {
> success {
> echo 'Now Archiving...'
> archiveArtifacts artifacts: '**/target/*.war'
> }
> }
> }
> }
> }
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/31846d14-4aa3-449c-9ee9-2547a6b95942%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread Slide
Is JAVA_HOME set to that for the user that Jenkins is running as?

On Tue, Aug 7, 2018 at 5:48 AM suny nazar  wrote:

>
> i am getting below error when i am running maven goals via Jenkinsfile. I am 
> not getting this issue when i am running freestyle project with maven goals.
>
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
> (default-compile) on project server: Compilation failure
> [ERROR] Unable to locate the Javac Compiler in:
> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
> [ERROR] Please ensure you are using JDK 1.4 or above and
> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
> [ERROR] In most cases you can change the location of your Java
> [ERROR] installation by setting the JAVA_HOME environment variable.
>
>
> below code has been put in Jenkinsfile.
>
>
> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
> Files\Java\jdk1.8.0_181
>
>
> pipeline {
> agent any
> stages{
> stage('Build'){
> steps {
> bat 'mvn clean package'
> }
> post {
> success {
> echo 'Now Archiving...'
> archiveArtifacts artifacts: '**/target/*.war'
> }
> }
> }
> }
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/f257a74a-c2a8-42ce-89d4-7a69a3c85e52%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVcOqc-0fSLJ9MMM9qQUrxpX-3wbPi1LyKcVEho4uJH9Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread suny nazar



i am getting below error when i am running maven goals via Jenkinsfile. I am 
not getting this issue when i am running freestyle project with maven goals.


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) 
on project server: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.


below code has been put in Jenkinsfile.


does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
Files\Java\jdk1.8.0_181


pipeline {
agent any
stages{
stage('Build'){
steps {
bat 'mvn clean package'
}
post {
success {
echo 'Now Archiving...'
archiveArtifacts artifacts: '**/target/*.war'
}
}
}
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f257a74a-c2a8-42ce-89d4-7a69a3c85e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.