Re: Issues when compiling basic Java SE using Maven

2020-10-07 Thread Karl Heinz Marbaise

Hi,

the problem is simply you are trying to access central repository via
http instead of https 


So you have to change the configuration in Maven as well as in Netbeans
to use the https://repo.maven.apache.org/maven2

Since 15. January 2020 access to central only via https:


https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required


Kind regards
Karl Heinz Marbaise

On 07.10.20 08:34, rafa wrote:

Hi everyone,

I am new on Maven and I am trying to create project and compile project
using Netbeans IDE.

I have successfully installed Maven

Then I have created a Java SE application using Maven in Netbeans. Find
attached the pom.xml
When trying to compile it through netbeans, I get next:
/cd C:\Datos\Java\MavenTest; "JAVA_HOME=C:\\Program
Files\\Java\\jdk1.8.0_151" cmd /c "\"\"C:\\Program Files\\NetBeans
8.2\\java\\maven\\bin\\mvn.bat\" -Dmaven.ext.class.path=\"C:\\Program
Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\"
-Dfile.encoding=UTF-8 install\""/
/Scanning for projects.../

//
/Building MavenTest 1.0-SNAPSHOT/
//
/The POM for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 is
missing, no dependency information available/
//
/BUILD FAILURE/
//
/Total time: 0.095s/
/Finished at: Wed Oct 07 08:12:03 CEST 2020/
/Final Memory: 7M/155M/
//
/Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of
its dependencies could not be resolved: Failed to read artifact
descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5:
Failure to find org.apache.maven.plugins:maven-resources-plugin:pom:2.5
in http://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update interval
of central has elapsed or updates are forced -> [Help 1]/

/To see the full stack trace of the errors, re-run Maven with the -e
switch./
/Re-run Maven using the -X switch to enable full debug logging./

/For more information about the errors and possible solutions, please
read the following articles:/
/[Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException/
After googling a lot, I found some suggestions about the proxy
settings. However, when using /netsh winhttp show proxy /in cmd, I get
that no proxy is used.
Please find attached my settings.xml config. This is used on:
my\path\to\maven\apache-maven-3.6.3\conf
C:\Program Files\NetBeans 8.2\java\maven\conf
C:\Users\Gladys Pluas\.m2
If I try to compile the project using mvn compile from command line, I get:
Any idea of what I am missing?
Kind 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



Re: 'mvn clean test' crashes

2020-10-07 Thread Enrico Olivelli
A good approach to workaround the presence of third party libraries that
call System.exit is to set a SecurityManager that prevents calls to
System.exit. I did it a few times with good results.
You will have to allow well known libraries like Eclipse test runner or
Surefire itself

Just my 2 cents

Enrico

Il giorno mer 7 ott 2020 alle ore 09:50 Mukul Gandhi 
ha scritto:

> Hi Tibor,
>
> On Wed, Sep 30, 2020 at 5:03 PM Tibor Digana 
> wrote:
>
> > Usually these errors appear in the test itself or the *libraries*.
> > As for instance, we found out that a Spring's library is implementing
> Kafka
> > stuff calling the "Runtime.getRuntime().halt(  )".
> > The same bad thing is to call the "System.exit()".
> > I have recognized this situation after I saw a crashed test in your logs.
> > The test is supposed to be crashed if the execution breaks abruptly
> without
> > receiving a JUnit/TestNG event about finishing the test, see this log:
> >
> > *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
> > *est.SuspiciousActivityHelperTe**st*
> >
>
> Nowhere within my code (that's been tested by junit) and within my unit
> tests, I've used things like 'Runtime.getRuntime().halt' or 'System.exit'.
>
> The following within the logs that I've shared,
>
> (i.e *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
> *est.SuspiciousActivityHelperTe**st*)
>
> that you've cited, doesn't indicate any of the things like use
> of 'Runtime.getRuntime().halt' or 'System.exit'. For the information, the
> name 'SuspiciousActivityHelper' is a business name within my application,
> and is not anything related to technical suspicious aspects within my
> application or test codebases.
>
> The issues that I've discussed within this thread, still causes the same
> problems to me.
>
>
>
>
> --
> Regards,
> Mukul Gandhi
>


Re: Issue with assembly file-aggregator container descriptor hangler

2020-10-07 Thread Arnaud bourree
Issue is already known MASSEMBLY-815

Workaround is adding metaInf-services handler:


  metaInf-services


file-aggregator

.*-info.yaml
infos.yaml



Regards,

Arnaud

Le mer. 7 oct. 2020 à 12:00, Arnaud bourree  a
écrit :

> Hello,
>
> I want to aggregate yaml files from my dependencies.
> I did for the pom.xml:
> 
> ...
> 
>   
> com.acme
> dep-a
> 1.0
> info
> yaml
>   
>   
> com.acme
> dep-b
> 1.0
> info
> yaml
>   
>   ...
> 
> ...
> 
>   
> 
>   org.apache.maven.plugins
>   maven-dependency-plugin
>   3.1.2
>   
> 
>get-infos
>
>  copy-dependencies
>
>compile
>
>   com.acme
>   yaml
>   info
>
> ${project.build.directory}/infos
> 
> 
>   
> 
> 
>   org.apache.maven.plugins
>   maven-assembly-plugin
>   3.3.0
>   
> 
>   build-infos
>   
> single
>   
>   prepare-package
>   
> 
>   assemblies/infos-yaml.xml
> 
>   
> 
> 
> ...
>   
> 
>
> and for the assembly:
> http://maven.apache.org/ASSEMBLY/2.1.0; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="
> http://maven.apache.org/ASSEMBLY/2.1.0
> http://maven.apache.org/xsd/assembly-2.1.0.xsd;>
> infos
> 
> dir
> 
> false
> 
> 
> target/infos/
> 
> 
> 
> 
> 
> file-aggregator
> 
> .*-info.yaml
> infos.yaml
> 
> 
> 
> 
>
> In generated dir, no info.yaml in and as expected infos.yaml. But doesn't
> contain info.yaml file content from dep-a nor dep-b.
> If I specify dep-a in handler's fiePattern: .*dep-a-1.0-info.yaml, then I
> get dep-b-1.0-info.yaml in generated dir, and infos.yaml still not contains
> dep-a-1.0_info.yaml.
> From the 2nd run, I understand that the handler process
> dep-a-1.0-info.yaml file but why didn't it paste content in destination
> file?
>
> Any body has idea?
>
> Regards,
>
> Arnaud
>


Issue with assembly file-aggregator container descriptor hangler

2020-10-07 Thread Arnaud bourree
Hello,

I want to aggregate yaml files from my dependencies.
I did for the pom.xml:

...

  
com.acme
dep-a
1.0
info
yaml
  
  
com.acme
dep-b
1.0
info
yaml
  
  ...

...

  

  org.apache.maven.plugins
  maven-dependency-plugin
  3.1.2
  

   get-infos
   
 copy-dependencies
   
   compile
   
  com.acme
  yaml
  info

${project.build.directory}/infos


  


  org.apache.maven.plugins
  maven-assembly-plugin
  3.3.0
  

  build-infos
  
single
  
  prepare-package
  

  assemblies/infos-yaml.xml

  


...
  


and for the assembly:
http://maven.apache.org/ASSEMBLY/2.1.0; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="
http://maven.apache.org/ASSEMBLY/2.1.0
http://maven.apache.org/xsd/assembly-2.1.0.xsd;>
infos

dir

false


target/infos/





file-aggregator

.*-info.yaml
infos.yaml





In generated dir, no info.yaml in and as expected infos.yaml. But doesn't
contain info.yaml file content from dep-a nor dep-b.
If I specify dep-a in handler's fiePattern: .*dep-a-1.0-info.yaml, then I
get dep-b-1.0-info.yaml in generated dir, and infos.yaml still not contains
dep-a-1.0_info.yaml.
>From the 2nd run, I understand that the handler process dep-a-1.0-info.yaml
file but why didn't it paste content in destination file?

Any body has idea?

Regards,

Arnaud


Re: 'mvn clean test' crashes

2020-10-07 Thread Mukul Gandhi
Hi Tibor,

On Wed, Sep 30, 2020 at 5:03 PM Tibor Digana  wrote:

> Usually these errors appear in the test itself or the *libraries*.
> As for instance, we found out that a Spring's library is implementing Kafka
> stuff calling the "Runtime.getRuntime().halt(  )".
> The same bad thing is to call the "System.exit()".
> I have recognized this situation after I saw a crashed test in your logs.
> The test is supposed to be crashed if the execution breaks abruptly without
> receiving a JUnit/TestNG event about finishing the test, see this log:
>
> *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
> *est.SuspiciousActivityHelperTe**st*
>

Nowhere within my code (that's been tested by junit) and within my unit
tests, I've used things like 'Runtime.getRuntime().halt' or 'System.exit'.

The following within the logs that I've shared,

(i.e *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
*est.SuspiciousActivityHelperTe**st*)

that you've cited, doesn't indicate any of the things like use
of 'Runtime.getRuntime().halt' or 'System.exit'. For the information, the
name 'SuspiciousActivityHelper' is a business name within my application,
and is not anything related to technical suspicious aspects within my
application or test codebases.

The issues that I've discussed within this thread, still causes the same
problems to me.




-- 
Regards,
Mukul Gandhi