maven-enforcer-plugin to ban a transitive provided dependency

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

maven-enforcer-plugin to ban a transitive provided dependency

dsilve
Hi,
I have the following scenario:
my project (A) has a number of compile dependencies on other internal projects (B0, B1, B2 ...).
I would like to break the build of A in case Bx has been built depending on an older release of A.

So for instance:

A:2.0-SNAPSHOT depends on B3:2.3
and
B3:2.3 depends on A:1.0 and this dependency is provided.

I tried to use the maven-enforcer-plugin to break the build of A in case there is a transitive dependency whose groupId and artifactId are the same as A, but it doesn't work because the dependency A:1.0 is provided.

Any suggestions?
Reply | Threaded
Open this post in threaded view
|

maven

Hossein Miri
Hi everyone,

I have a folder that contains some Java code, written specifically for Linux.
There is a pom.xml file and two folders called: src and build

I have installed Eclipse Juno on my Mac (10.7.5) and I understand
it already has Maven included. On the Linux machine, the code is
executed by entering mvn package at the command line.

But after this stage, it doesn't run on my Mac, because some of the
commands are specific to Linux (I am told). How do I import the
whole project into Maven on my Mac? I mean where do I copy
the folders and pom file?

p.s. I am only just beginning to learn Java programming using the
      Eclipse IDE and my installation details are in the image attached...

Thank you,
 H


mvn.tiff
Reply | Threaded
Open this post in threaded view
|

Re: maven

AlonsoIR
hi Miri, first, go to the folder project, where is pom.xml and execute mvn clean install, that sentences clean, compile and deploy the project into repository. Second, execute mvn eclipse:eclipse
and then import maven project from eclipse.

Let us know how about was.

regards

Alonso Isidoro Roman.

Mis citas preferidas (de hoy) :
"Si depurar es el proceso de quitar los errores de software, entonces programar debe ser el proceso de introducirlos..."
 -  Edsger Dijkstra

My favorite quotes (today):
"If debugging is the process of removing software bugs, then programming must be the process of putting ..."
  - Edsger Dijkstra

"If you pay peanuts you get monkeys"



2013/4/5 Hossein Miri <[hidden email]>
Hi everyone,

I have a folder that contains some Java code, written specifically for Linux.
There is a pom.xml file and two folders called: src and build

I have installed Eclipse Juno on my Mac (10.7.5) and I understand
it already has Maven included. On the Linux machine, the code is
executed by entering mvn package at the command line.

But after this stage, it doesn't run on my Mac, because some of the
commands are specific to Linux (I am told). How do I import the
whole project into Maven on my Mac? I mean where do I copy
the folders and pom file?

p.s. I am only just beginning to learn Java programming using the
      Eclipse IDE and my installation details are in the image attached...

Thank you,
 H



Reply | Threaded
Open this post in threaded view
|

Re: maven-enforcer-plugin to ban a transitive provided dependency

stephenconnolly
In reply to this post by dsilve
provided scope is not transitive, so that is why the build will not fail
using the enforcer rule that scans transitive dependencies. You probably
will need to write your own rule if this is something that you need


On 5 April 2013 09:47, dsilve <[hidden email]> wrote:

> Hi,
> I have the following scenario:
> my project (A) has a number of compile dependencies on other internal
> projects (B0, B1, B2 ...).
> I would like to break the build of A in case Bx has been built depending on
> an older release of A.
>
> So for instance:
>
> A:2.0-SNAPSHOT depends on B3:2.3
> and
> B3:2.3 depends on A:1.0 and this dependency is provided.
>
> I tried to use the maven-enforcer-plugin to break the build of A in case
> there is a transitive dependency whose groupId and artifactId are the same
> as A, but it doesn't work because the dependency A:1.0 is provided.
>
> Any suggestions?
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/maven-enforcer-plugin-to-ban-a-transitive-provided-dependency-tp5752733.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: maven

Hossein Miri
In reply to this post by AlonsoIR
Thank you . .

I did the first two things, by moving to the folder that contains the pom.xml file
and then running the following two commands in the Terminal:

 mvn clean install
 mvn eclipse:eclipse

What do you mean by your last sentence?
and then import maven project from eclipse.

Do you mean in the Eclipse Juno IDE?

When I go to Eclipse , Help , Install New Software and look at What is already installed
it shows that m2e - Maven Integration for Eclipse is already installed.

Is that what you mean?
Hossein
 
 
hi Hossein, first, go to the folder project, where is pom.xml and execute mvn clean install, that sentences clean, compile and deploy the project into repository. Second, execute mvn eclipse:eclipse
and then import maven project from eclipse.

Let us know how about was.

regards

Alonso Isidoro Roman.
 
 
Hi everyone,

I have a folder that contains some Java code, written specifically for Linux.
There is a pom.xml file and two folders called: src and build

I have installed Eclipse Juno on my Mac (10.7.5) and I understand
it already has Maven included. On the Linux machine, the code is
executed by entering mvn package at the command line.

But after this stage, it doesn't run on my Mac, because some of the
commands are specific to Linux (I am told). How do I import the
whole project into Maven on my Mac? I mean where do I copy
the folders and pom file?

p.s. I am only just beginning to learn Java programming using the
      Eclipse IDE and my installation details are in the image attached...

Thank you,
 H
 





Reply | Threaded
Open this post in threaded view
|

Re: maven

Adrien Rivard
Hi,

If you use Juno with the corresponding m2e , you *MUST NOT* use
eclipse:eclipse.
if you already have remove the .project .classpath and  .settings first,

Then import the project as existing maven project.

 (in eclipse, File > import > Existing maven projects > select the project
folder ...)

Also it is generaly not a good idea to use mvn install (prefer mvn
package), especially if you intend to use with m2e/eclipse.

If you have errors after the import, you may have a look at
http://wiki.eclipse.org/M2E_plugin_execution_not_covered .


On Fri, Apr 5, 2013 at 1:56 PM, Hossein Miri <[hidden email]> wrote:

> Thank you . .
>
> I did the first two things, by moving to the folder that contains the
> pom.xml file
> and then running the following two commands in the Terminal:
>
>  mvn clean install
>  mvn eclipse:eclipse
>
> What do you mean by your last sentence?
>
> and then import maven project from eclipse.
>
>
> Do you mean in the Eclipse Juno IDE?
>
> When I go to Eclipse , Help , Install New Software and look at What is
> already installed
> it shows that m2e - Maven Integration for Eclipse is already installed.
>
> Is that what you mean?
> Hossein
>
>
>
> hi Hossein, first, go to the folder project, where is pom.xml and execute
> mvn clean install, that sentences clean, compile and deploy the project
> into repository. Second, execute mvn eclipse:eclipse
> and then import maven project from eclipse.
>
> Let us know how about was.
>
> regards
>
> Alonso Isidoro Roman.
>
>
>
>
> Hi everyone,
>>
>> I have a folder that contains some Java code, written specifically for
>> Linux.
>> There is a pom.xml file and two folders called: src and build
>>
>> I have installed Eclipse Juno on my Mac (10.7.5) and I understand
>> it already has Maven included. On the Linux machine, the code is
>> executed by entering mvn package at the command line.
>>
>> But after this stage, it doesn't run on my Mac, because some of the
>> commands are specific to Linux (I am told). How do I import the
>> whole project into Maven on my Mac? I mean where do I copy
>> the folders and pom file?
>>
>> p.s. I am only just beginning to learn Java programming using the
>>       Eclipse IDE and my installation details are in the image
>> attached...
>>
>> Thank you,
>>  H
>>
>
>
>
>
>
>
>


--
Adrien Rivard
Reply | Threaded
Open this post in threaded view
|

Re: maven

Benson Margulies
In reply to this post by Hossein Miri
Uh, oh.

mvn eclipse:eclipse is the wrong answer, probably.

There are two ways to integrate Maven and eclipse. The older way is to
run mvn eclipse:eclipse to create Eclipse metadata, and then you
import into Eclipse as you would open any existing Eclipse project.
This has a number of limitations and is no longer actively maintained.

The newer way is to use the Eclipse command to import an existing
Maven project. This has a different set of problems, but is under
active development, and is what you will see described in current
Eclipse documentation. This is called 'm2e'.

These days, I think that most people are happier with m2e, which has
its own mailing lists to consult if you do have problems.


On Fri, Apr 5, 2013 at 7:56 AM, Hossein Miri <[hidden email]> wrote:

> Thank you . .
>
> I did the first two things, by moving to the folder that contains the
> pom.xml file
> and then running the following two commands in the Terminal:
>
>  mvn clean install
>  mvn eclipse:eclipse
>
> What do you mean by your last sentence?
>
> and then import maven project from eclipse.
>
>
> Do you mean in the Eclipse Juno IDE?
>
> When I go to Eclipse , Help , Install New Software and look at What is
> already installed
> it shows that m2e - Maven Integration for Eclipse is already installed.
>
> Is that what you mean?
> Hossein
>
>
>
> hi Hossein, first, go to the folder project, where is pom.xml and execute
> mvn clean install, that sentences clean, compile and deploy the project into
> repository. Second, execute mvn eclipse:eclipse
> and then import maven project from eclipse.
>
> Let us know how about was.
>
> regards
>
> Alonso Isidoro Roman.
>
>
>
>>
>> Hi everyone,
>>
>> I have a folder that contains some Java code, written specifically for
>> Linux.
>> There is a pom.xml file and two folders called: src and build
>>
>> I have installed Eclipse Juno on my Mac (10.7.5) and I understand
>> it already has Maven included. On the Linux machine, the code is
>> executed by entering mvn package at the command line.
>>
>> But after this stage, it doesn't run on my Mac, because some of the
>> commands are specific to Linux (I am told). How do I import the
>> whole project into Maven on my Mac? I mean where do I copy
>> the folders and pom file?
>>
>> p.s. I am only just beginning to learn Java programming using the
>>       Eclipse IDE and my installation details are in the image attached...
>>
>> Thank you,
>>  H
>
>
>
>
>
>
>

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

Reply | Threaded
Open this post in threaded view
|

Re: maven-enforcer-plugin to ban a transitive provided dependency

dsilve
In reply to this post by stephenconnolly
Thank you Stephen!

Does anybody knows if there is already a plugin able to this?

David

PS: Guys don't publish unrelated posts on this thread.
Reply | Threaded
Open this post in threaded view
|

Re: maven

AlonsoIR
In reply to this post by Hossein Miri
El viernes, 5 de abril de 2013, Hossein Miri escribió:

> Thank you . .
>
> I did the first two things, by moving to the folder that contains the
> pom.xml file
> and then running the following two commands in the Terminal:
>
>  mvn clean install
>  mvn eclipse:eclipse
>
> What do you mean by your last sentence?
>
> and then import maven project from eclipse.
>
>
> Do you mean in the Eclipse Juno IDE?
>
> When I go to Eclipse , Help , Install New Software and look at What is
> already installed
> it shows that m2e - Maven Integration for Eclipse is already installed.
>
> Is that what you mean?
> Hossein
>
>
  Nop, i Mean that in eclipse you need to import the Maven project. I m
using STS but i think is the same in every eclipse. Go File,
Import,Maven,Existing maven projects...

then you need to supply root maven project, the folder with pom.xml and
click Finish.

Tell us what about.

> hi Hossein, first, go to the folder project, where is pom.xml and execute
> mvn clean install, that sentences clean, compile and deploy the project
> into repository. Second, execute mvn eclipse:eclipse
> and then import maven project from eclipse.
>
> Let us know how about was.
>
> regards
>
> Alonso Isidoro Roman.
>
>
>
>
> Hi everyone,
>>
>> I have a folder that contains some Java code, written specifically for
>> Linux.
>> There is a pom.xml file and two folders called: src and build
>>
>> I have installed Eclipse Juno on my Mac (10.7.5) and I understand
>> it already has Maven included. On the Linux machine, the code is
>> executed by entering mvn package at the command line.
>>
>> But after this stage, it doesn't run on my Mac, because some of the
>> commands are specific to Linux (I am told). How do I import the
>> whole project into Maven on my Mac? I mean where do I copy
>> the folders and pom file?
>>
>> p.s. I am only just beginning to learn Java programming using the
>>       Eclipse IDE and my installation details are in the image
>> attached...
>>
>> Thank you,
>>  H
>>
>
>
>
>
>
>
>