Re: Surefire 3.0.0-M4 not failing build on errors

2020-06-12 Thread Enrico Olivelli
Jeff

Il Sab 13 Giu 2020, 00:15 Jeff Jensen 
ha scritto:

> I looked for this issue in JIRA but haven't found anything yet.  Anyone
> know if this has been reported and/or fixed?
>
> Our scenario is a failure occurs at startup of tests but Surefire doesn't
> fail the build.  Specifically, Spring controller tests aren't failing when
> there is a Spring configuration problem.
>
> Spring top-level thrown exception is:
>   java.lang.IllegalStateException: Failed to load ApplicationContext
>
> but Surefire doesn't report fail.  Surefire output results is:
>   Tests run: 0, Failures: 0, Errors: 0, Skipped: 0,
>
> Running the tests in an IDE correctly fail for the setup problem.
>

Which IDE?

Did  you try other versions of surefire? Like the latest from 2.x release
line?

Regards
Enrico


Re: Maven Artifacts not consumable after Introducing ci-friendly approach - revision tag

2020-06-12 Thread Hanish Bansal
Hi Team,

I have pushed a sample minimal project in git at the following link
https://github.com/hanishbansal/test-parent

Project Structure:
  test-parent
   - child1
   - child2

child2 project has dependency of child1 project.

Steps to Reproduce the error:
1. Compile test-parent project with goal "clean install". It will compile
and install all child projects.
2. Now compile child2 project, it would give compilation error due to
dependency of child1 project.



On Sat, Jun 13, 2020 at 12:58 AM Tomo Suzuki 
wrote:

> I suspect typo in child module name. Do you want to share minimum
> reproducible project?
>
> On Fri, Jun 12, 2020 at 07:17 Hanish Bansal <
> hanish.bansal.agar...@gmail.com>
> wrote:
>
> > Yes, that has been already tried. I have installed child modules
> separately
> > but if there is any child module (e.g. child2) has dependency of other
> > child module child1 then I am not able to compile child2 project.
> >
> > On Fri, Jun 12, 2020 at 3:39 PM Tomo Suzuki 
> > wrote:
> >
> > > (Assuming yy-utils is the one of the child project)
> > > Run ”mvn install” in yy-utils module first.
> > >
> > > On Fri, Jun 12, 2020 at 01:56 Hanish Bansal <
> > > hanish.bansal.agar...@gmail.com>
> > > wrote:
> > >
> > > > Hi All,
> > > >
> > > > We have maven Multi Module Project, where we have recently
> implemented
> > > > version control process as mentioned in below documentation but after
> > > > introducing it we are not able to compile child projects
> independently
> > > > because of dependency failure.
> > > > http://maven.apache.org/maven-ci-friendly.html#multi-module-setup
> > > >
> > > > We have also used flatten-maven-plugin but artifacts deployed in our
> > > > repository via this setup are not consumable by Maven anymore.
> > > >
> > > >  
> > > >   
> > > > 
> > > >   org.codehaus.mojo
> > > >   flatten-maven-plugin
> > > >   1.1.0
> > > >   
> > > > true
> > > > resolveCiFriendliesOnly
> > > >   
> > > >   
> > > > 
> > > >   flatten
> > > >   process-resources
> > > >   
> > > > flatten
> > > >   
> > > > 
> > > > 
> > > >   flatten.clean
> > > >   clean
> > > >   
> > > > clean
> > > >   
> > > > 
> > > >   
> > > > 
> > > >   
> > > >   
> > > >
> > > > While trying to get artifacts, maven build failed with below error:
> > > >
> > > > Failed to read artifact descriptor for
> > > > org..xxx.x:yy-utils:jar:0.0.1: Could not transfer artifact
> > > >
> > > > Can you please help here?
> > > >
> > > > --
> > > >
> > > > *Thanks & Regards,Hanish Bansal*
> > > >
> > > --
> > > Regards,
> > > Tomo
> > >
> >
> >
> > --
> >
> > *Thanks & Regards,Hanish Bansal*
> > Lead Software Engineer, Big Data
> > (M) : +91-995-339-9925
> > LinkedIn: www.linkedin.com/in/hanishbansal/
> >
> --
> Regards,
> Tomo
>


-- 

*Thanks & Regards,Hanish Bansal*
Lead Software Engineer, Big Data
(M) : +91-995-339-9925
LinkedIn: www.linkedin.com/in/hanishbansal/


Re: Maven Artifacts not consumable after Introducing ci-friendly approach - revision tag

2020-06-12 Thread Hanish Bansal
Hi Team,

I have pushed sample minimal project in git at following link
https://github.com/hanishbansal/test-parent
Also attached the same code as zip file.

Steps to Reproduce the error:
1. Compile test-parent project with goal "clean install". It will compile
and install all child projects.
2. Now compile child2 project, it would give compilation error due to
dependency of child1 project.


On Sat, Jun 13, 2020 at 12:58 AM Tomo Suzuki 
wrote:

> I suspect typo in child module name. Do you want to share minimum
> reproducible project?
>
> On Fri, Jun 12, 2020 at 07:17 Hanish Bansal <
> hanish.bansal.agar...@gmail.com>
> wrote:
>
> > Yes, that has been already tried. I have installed child modules
> separately
> > but if there is any child module (e.g. child2) has dependency of other
> > child module child1 then I am not able to compile child2 project.
> >
> > On Fri, Jun 12, 2020 at 3:39 PM Tomo Suzuki 
> > wrote:
> >
> > > (Assuming yy-utils is the one of the child project)
> > > Run ”mvn install” in yy-utils module first.
> > >
> > > On Fri, Jun 12, 2020 at 01:56 Hanish Bansal <
> > > hanish.bansal.agar...@gmail.com>
> > > wrote:
> > >
> > > > Hi All,
> > > >
> > > > We have maven Multi Module Project, where we have recently
> implemented
> > > > version control process as mentioned in below documentation but after
> > > > introducing it we are not able to compile child projects
> independently
> > > > because of dependency failure.
> > > > http://maven.apache.org/maven-ci-friendly.html#multi-module-setup
> > > >
> > > > We have also used flatten-maven-plugin but artifacts deployed in our
> > > > repository via this setup are not consumable by Maven anymore.
> > > >
> > > >  
> > > >   
> > > > 
> > > >   org.codehaus.mojo
> > > >   flatten-maven-plugin
> > > >   1.1.0
> > > >   
> > > > true
> > > > resolveCiFriendliesOnly
> > > >   
> > > >   
> > > > 
> > > >   flatten
> > > >   process-resources
> > > >   
> > > > flatten
> > > >   
> > > > 
> > > > 
> > > >   flatten.clean
> > > >   clean
> > > >   
> > > > clean
> > > >   
> > > > 
> > > >   
> > > > 
> > > >   
> > > >   
> > > >
> > > > While trying to get artifacts, maven build failed with below error:
> > > >
> > > > Failed to read artifact descriptor for
> > > > org..xxx.x:yy-utils:jar:0.0.1: Could not transfer artifact
> > > >
> > > > Can you please help here?
> > > >
> > > > --
> > > >
> > > > *Thanks & Regards,Hanish Bansal*
> > > >
> > > --
> > > Regards,
> > > Tomo
> > >
> >
> >
> > --
> >
> > *Thanks & Regards,Hanish Bansal*
> > Lead Software Engineer, Big Data
> > (M) : +91-995-339-9925
> > LinkedIn: www.linkedin.com/in/hanishbansal/
> >
> --
> Regards,
> Tomo
>


-- 

*Thanks & Regards,Hanish Bansal*
Lead Software Engineer, Big Data
(M) : +91-995-339-9925
LinkedIn: www.linkedin.com/in/hanishbansal/
<>

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

Surefire 3.0.0-M4 not failing build on errors

2020-06-12 Thread Jeff Jensen
I looked for this issue in JIRA but haven't found anything yet.  Anyone
know if this has been reported and/or fixed?

Our scenario is a failure occurs at startup of tests but Surefire doesn't
fail the build.  Specifically, Spring controller tests aren't failing when
there is a Spring configuration problem.

Spring top-level thrown exception is:
  java.lang.IllegalStateException: Failed to load ApplicationContext

but Surefire doesn't report fail.  Surefire output results is:
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0,

Running the tests in an IDE correctly fail for the setup problem.


[ANN] Apache Maven EJB Plugin 3.1.0 Released

2020-06-12 Thread Hervé Boutemy
The Maven team is pleased to announce the release of the Apache Maven EJB 
Plugin, version 3.1.0

This plugin generates a Java Enterprise JavaBean (EJB) file as well as the 
associated client JAR.

https://maven.apache.org/plugins/maven-ejb-plugin/

You should specify the version in your project's plugin configuration:


  org.apache.maven.plugins
  maven-ejb-plugin
  3.1.0



Release Notes - Apache Maven EJB Plugin - Version 3.1.0

Improvement
* [MEJB-129] Refactor IncludesExcludes to reduce code duplication
* [MEJB-126] make build Reproducible

New Feature
* [MEJB-128] Reproducible Builds: make entries in output jar files reproducible 
(order + timestamp)


Enjoy,

-The Maven team




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



Re: Maven Artifacts not consumable after Introducing ci-friendly approach - revision tag

2020-06-12 Thread Tomo Suzuki
I suspect typo in child module name. Do you want to share minimum
reproducible project?

On Fri, Jun 12, 2020 at 07:17 Hanish Bansal 
wrote:

> Yes, that has been already tried. I have installed child modules separately
> but if there is any child module (e.g. child2) has dependency of other
> child module child1 then I am not able to compile child2 project.
>
> On Fri, Jun 12, 2020 at 3:39 PM Tomo Suzuki 
> wrote:
>
> > (Assuming yy-utils is the one of the child project)
> > Run ”mvn install” in yy-utils module first.
> >
> > On Fri, Jun 12, 2020 at 01:56 Hanish Bansal <
> > hanish.bansal.agar...@gmail.com>
> > wrote:
> >
> > > Hi All,
> > >
> > > We have maven Multi Module Project, where we have recently implemented
> > > version control process as mentioned in below documentation but after
> > > introducing it we are not able to compile child projects independently
> > > because of dependency failure.
> > > http://maven.apache.org/maven-ci-friendly.html#multi-module-setup
> > >
> > > We have also used flatten-maven-plugin but artifacts deployed in our
> > > repository via this setup are not consumable by Maven anymore.
> > >
> > >  
> > >   
> > > 
> > >   org.codehaus.mojo
> > >   flatten-maven-plugin
> > >   1.1.0
> > >   
> > > true
> > > resolveCiFriendliesOnly
> > >   
> > >   
> > > 
> > >   flatten
> > >   process-resources
> > >   
> > > flatten
> > >   
> > > 
> > > 
> > >   flatten.clean
> > >   clean
> > >   
> > > clean
> > >   
> > > 
> > >   
> > > 
> > >   
> > >   
> > >
> > > While trying to get artifacts, maven build failed with below error:
> > >
> > > Failed to read artifact descriptor for
> > > org..xxx.x:yy-utils:jar:0.0.1: Could not transfer artifact
> > >
> > > Can you please help here?
> > >
> > > --
> > >
> > > *Thanks & Regards,Hanish Bansal*
> > >
> > --
> > Regards,
> > Tomo
> >
>
>
> --
>
> *Thanks & Regards,Hanish Bansal*
> Lead Software Engineer, Big Data
> (M) : +91-995-339-9925
> LinkedIn: www.linkedin.com/in/hanishbansal/
>
-- 
Regards,
Tomo


Re: Maven Artifacts not consumable after Introducing ci-friendly approach - revision tag

2020-06-12 Thread Hanish Bansal
Yes, that has been already tried. I have installed child modules separately
but if there is any child module (e.g. child2) has dependency of other
child module child1 then I am not able to compile child2 project.

On Fri, Jun 12, 2020 at 3:39 PM Tomo Suzuki 
wrote:

> (Assuming yy-utils is the one of the child project)
> Run ”mvn install” in yy-utils module first.
>
> On Fri, Jun 12, 2020 at 01:56 Hanish Bansal <
> hanish.bansal.agar...@gmail.com>
> wrote:
>
> > Hi All,
> >
> > We have maven Multi Module Project, where we have recently implemented
> > version control process as mentioned in below documentation but after
> > introducing it we are not able to compile child projects independently
> > because of dependency failure.
> > http://maven.apache.org/maven-ci-friendly.html#multi-module-setup
> >
> > We have also used flatten-maven-plugin but artifacts deployed in our
> > repository via this setup are not consumable by Maven anymore.
> >
> >  
> >   
> > 
> >   org.codehaus.mojo
> >   flatten-maven-plugin
> >   1.1.0
> >   
> > true
> > resolveCiFriendliesOnly
> >   
> >   
> > 
> >   flatten
> >   process-resources
> >   
> > flatten
> >   
> > 
> > 
> >   flatten.clean
> >   clean
> >   
> > clean
> >   
> > 
> >   
> > 
> >   
> >   
> >
> > While trying to get artifacts, maven build failed with below error:
> >
> > Failed to read artifact descriptor for
> > org..xxx.x:yy-utils:jar:0.0.1: Could not transfer artifact
> >
> > Can you please help here?
> >
> > --
> >
> > *Thanks & Regards,Hanish Bansal*
> >
> --
> Regards,
> Tomo
>


-- 

*Thanks & Regards,Hanish Bansal*
Lead Software Engineer, Big Data
(M) : +91-995-339-9925
LinkedIn: www.linkedin.com/in/hanishbansal/


Re: Maven Artifacts not consumable after Introducing ci-friendly approach - revision tag

2020-06-12 Thread Tomo Suzuki
(Assuming yy-utils is the one of the child project)
Run ”mvn install” in yy-utils module first.

On Fri, Jun 12, 2020 at 01:56 Hanish Bansal 
wrote:

> Hi All,
>
> We have maven Multi Module Project, where we have recently implemented
> version control process as mentioned in below documentation but after
> introducing it we are not able to compile child projects independently
> because of dependency failure.
> http://maven.apache.org/maven-ci-friendly.html#multi-module-setup
>
> We have also used flatten-maven-plugin but artifacts deployed in our
> repository via this setup are not consumable by Maven anymore.
>
>  
>   
> 
>   org.codehaus.mojo
>   flatten-maven-plugin
>   1.1.0
>   
> true
> resolveCiFriendliesOnly
>   
>   
> 
>   flatten
>   process-resources
>   
> flatten
>   
> 
> 
>   flatten.clean
>   clean
>   
> clean
>   
> 
>   
> 
>   
>   
>
> While trying to get artifacts, maven build failed with below error:
>
> Failed to read artifact descriptor for
> org..xxx.x:yy-utils:jar:0.0.1: Could not transfer artifact
>
> Can you please help here?
>
> --
>
> *Thanks & Regards,Hanish Bansal*
>
-- 
Regards,
Tomo


Re: Conditional import of Java class based on dependency version

2020-06-12 Thread Benjamin Marwell
Well, if the Dependency version changed with the target java  Bytecode
version, you could create a multirelease jar and manage the dependencies
via profiles.

But that would seem not feasible to me.
What's your use case?
Or maybe you could refactor that class(es) into modules instead?

Best regards,
Ben




On Tue, 9 Jun 2020, 13:51 Jagat Singh,  wrote:

> Hi,
>
> I wanted to learn what is the pattern in maven when we have to change the
> import at the top of class based on dependency version.
>
> Example in Java code
>
> If dependency version is 1.0
> Then import path
>
> import com.hello.Class
>
> If dependency version is 2.0
> Then import path
>
> import com.hello2.Class
>
>
> Thanks in advance.
>