look at debug trace:
[ -f /home/jenkins/.mavenrc ]
+ . /home/jenkins/.mavenrc
+ MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=256m

there is no "global" and "local" env variables: there is a script (/home/
jenkins/.mavenrc) that defines MAVEN_OPTS env variable, then overrides previous 
value that was set in our IT code

such script should define:
MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=256m ${MAVEN_OPTS}


this will solve issues of Maven core ITs requiring MAVEN_OPTS

I don't know for maven-archetype, I'm not working on it, and this thread is 
not about it: I don't know why you're mixing everything and make simple things 
complex

Regards,

Hervé

Le mardi 30 juillet 2019, 09:40:43 CEST Tibor Digana a écrit :
> Essentially you want to say that global environment variable overrides
> local MAVEN_OPTS?
> This way I have undertood your email.
> but I would say that it cannot be!
> 
> Download the Maven dist and open the scripts $MVN_HOME/bin/mvn and there we
> will see this.
> This script in our distcorresponds to what I see in your email.
> So I think all we have to do is to export MAVEN_SKIP_RC to 1 in our ITs and
> prevent from merging global and local environment variables.
> 
> if [ -z "$MAVEN_SKIP_RC" ] ; then
>   if [ -f /etc/mavenrc ] ; then
>     . /etc/mavenrc
>   fi
>   if [ -f "$HOME/.mavenrc" ] ; then
>     . "$HOME/.mavenrc"
>   fi
> fi
> ...
> MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"`
> $MAVEN_OPTS"
> 
> We have a lots of troubles with Jenkins.
> Solving this does not mean anything becase we ca see in the logs that
> "apache/maven-archetype" randomly lost files.
> We have problem with networ connectivity to Maven Central, every second day
> and more ofter in the night of European time.
> 
> Cheers
> Tibor17
> 
> On Tue, Jul 30, 2019 at 7:40 AM Hervé BOUTEMY <herve.bout...@free.fr> wrote:
> > I found the root cause of failing IT on some Linux nodes!!!
> > 
> > 
> > activating debug mode for mvn shell script, we get:
> > + [ -f /home/jenkins/.mavenrc ]
> > + . /home/jenkins/.mavenrc
> > + MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=256m
> > 
> > there is a .mavenrc script on some Linux nodes that overrides MAVEN_OPTS
> > instead of appending: I did not yet report to INFRA, need to check if this
> > variable is defined with Puppet and provide a PR
> > 
> > FYI, core ITs log files have finally always been accessible: just need to
> > look inside
> > org\apache\maven\its\core-it-suite\2.1-SNAPSHOT\core-it-suite-2.1-SNAPSHOT
> > -tests.jar artifact
> > 
> > 
> > This debugging session has been hard, but I'm happy to say that it is now
> > under control: no more wild guesses about strange root causes, but pure
> > simple logic.
> > 
> > Regards,
> > 
> > Hervé
> > 
> > Le dimanche 28 juillet 2019, 16:20:59 CEST Tibor Digana a écrit :
> > > We discuss this issue in Slack
> > > We know for certain that there is a problem with environment variables.
> > > So there must be a bug in our code then. I have analysed the code I
> > > think
> > > the problem should be with spaces in the value of environment variable
> > > MAVEN_OPTS. There is no quotation marks around such environemnt variable
> > > when we have such rough element in String[] when we call
> > > Runtime.execute(cli, String[]).
> > > 
> > > Here is the list of comments from Slack and the way how we got there:
> > > 
> > > the `forkMode=auto` in profile `embedded` so it's okay. But I analyzed
> > > `MavenITmng4747JavaAgentUsedByPluginTest` and Line  53 `newVerifier(
> > > testDir.getAbsolutePath() )` and I got to `CommandLine` class from
> > > `maven-shared-utils:0.9`. Although forking is used if we use env vars in
> > > the IT but I got to `execute()` method and I was interested in `String[]
> > > environment = getEnvironmentVariables();` which finally is passed to
> > > Java
> > > 
> > > running forked process. Please tell me if this code is okay for you:
> > >     ```public String[] getEnvironmentVariables()
> > >     {
> > >     
> > >         addSystemEnvironment();
> > >         String[] environmentVars = new String[envVars.size()];
> > >         int i = 0;
> > >         for ( String name : envVars.keySet() )
> > >         {
> > >         
> > >             String value = envVars.get( name );
> > >             environmentVars[i] = name + "=" + value;
> > >             i++;
> > >         
> > >         }
> > >         return environmentVars;
> > >     
> > >     }```
> > > 
> > > I do not see quotation marks. This is important if you use two or more
> > > systm properties in `MAVEN_OPTS=-Dk1=v1 -Dk2=v2` - there is a space!
> > > Next issue is that the env vars of the parent process are merged with
> > 
> > given
> > 
> > > vars for the child process in `addSystemEnvironment();`, Line 239.
> > > 
> > > that's why maybe platform Linux does not understand the space and maybe
> > > Windows does not have a problem with it.
> > > 
> > > merging env vars is strange because of JAVA_HOME, there are at least
> > > two.
> > > One in CLI and second in env vars.
> > > 
> > > I think we should use latest `maven-shared-utils` and check the code in
> > > shared utils. Maybe to fix shared utils and meanwhile use snapshot
> > 
> > version,
> > 
> > > maybe.
> > > 
> > > 
> > > 
> > > 
> > > On Tue, Jul 16, 2019 at 11:22 PM Tibor Digana <tibordig...@apache.org>
> > > 
> > > wrote:
> > > > Heads up!,
> > > > 
> > > > I am investigating the build errors on Maven Core.
> > > > So I created three branches moved the HEAD backwards (i.e. git reset
> > > > --hard HEAD~12) and observed the outcome.
> > > > 
> > > > I have investigated 29 commits. Not sure how far to go...
> > > > 
> > > > `maven-resolver-1.3.3-reset-head-12` crashed with Linux + JDK 7, 8,
> > 
> > 11, 12
> > 
> > > > (16 ITs)
> > > > `maven-resolver-1.3.3-reset-head-14` crashed with Linux + JDK 7 and 8
> > 
> > (8
> > 
> > > > ITs)
> > > > `maven-resolver-1.3.3-reset-head-29` crashed Linux JDK 8 (4 ITs)
> > > > 
> > > > Always the ITs 0553, 4590, 4747 fail on several nodes.
> > > > Always related to Linux.
> > 
> > > > See the list of errors and branches:
> > https://builds.apache.org/job/maven-box/job/maven/job/maven-resolver-1.3.3
> > 
> > > > -reset-head-12/1/#showFailuresLink
> > 
> > https://builds.apache.org/job/maven-box/job/maven/job/maven-resolver-1.3.3
> > 
> > > > -reset-head-14/1/
> > 
> > https://builds.apache.org/job/maven-box/job/maven/job/maven-resolver-1.3.3
> > 
> > > > -reset-head-29/1/
> > > > 
> > > > 
> > > > 
> > > > From the MavenITmng0553SettingsAuthzEncryptionTest:
> > > > 
> > > > [ERROR] Error executing Maven.
> > > > org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException:
> > > > java.io.FileNotFoundException: /home/jenkins/.m2/settings-security.xml
> > 
> > (No
> > 
> > > > such file or directory)
> > > > 
> > > >     at org.sonatype.plexus.components.sec.dispatcher.SecUtil.read
> > > > 
> > > > (SecUtil.java:69)
> > > > 
> > > >     at org.apache.maven.cli.MavenCli.encryption (MavenCli.java:920)
> > > >     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:286)
> > > >     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
> > > > 
> > > > [ERROR] Failed to execute goal on project test: Could not resolve
> > > > dependencies for project
> > > > org.apache.maven.its.mng0553:test:jar:1.0-SNAPSHOT: Failed to collect
> > > > dependencies at org.apache.maven.its.mng0553:a:jar:0.1-SNAPSHOT:
> > > > Failed
> > > > to read artifact descriptor for
> > > > org.apache.maven.its.mng0553:a:jar:0.1-SNAPSHOT: Could not transfer
> > > > artifact org.apache.maven.its.mng0553:a:pom:0.1-SNAPSHOT from/to test
> > > > (http://localhost:32917/): Not authorized
> > 
> > > > From the MavenITmng4590ImportedPomUsesSystemPropertiesTest:
> > expected:</home/jenkins/jenkins-slave/workspace/ven-resolver-1.3.3-reset-h
> > 
> > > > ead-29/test/core-it-suite/target/test-classes/mng-4590/pom.xml> but
> > 
> > was:</home/jenkins/jenkins-slave/workspace/ven-resolver-1.3.3-reset-head-
> > 
> > > > 29/test/core-it-suite/target/test-classes/mng-4590/${test.file}>
> > > > 
> > > > 
> > > > 
> > > > From the MavenITmng4747JavaAgentUsedByPluginTest:
> > > > 
> > > > junit.framework.AssertionFailedError
> > > > 
> > > >     at
> > > >     org.apache.maven.it
> > 
> > .MavenITmng4747JavaAgentUsedByPluginTest.testit(Maven
> > 
> > > >     ITmng4747JavaAgentUsedByPluginTest.java:63)
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> > For additional commands, e-mail: dev-h...@maven.apache.org





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

Reply via email to