Quantcast

About dependency conflict

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

About dependency conflict

Benniu
Hi, developers

I'm developing a jenkins plugin and one issue is blocking my work.
In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
core 3.0.5.  How can I resolve the conflict?

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Ulli Hafner
On 12/20/2011 09:44 AM, Benniu wrote:
> Hi, developers
>
> I'm developing a jenkins plugin and one issue is blocking my work.
> In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
> core 3.0.5.  How can I resolve the conflict?
>
> Thanks

You can use the maven-shade-plugin for that dependency:
http://maven.apache.org/plugins/maven-shade-plugin/

Ulli
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Benniu
I tried, but it's not working.

         <executions>

          <execution>

            <phase>package</phase>

            <goals>

              <goal>shade</goal>

            </goals>

            <configuration>

              <relocations>

                <relocation>

                  <pattern>org.springframework</pattern>

                  <shadedPattern>org.shaded.springframework</shadedPattern>

                  </relocation>

              </relocations>

            </configuration>

          </execution>

        </executions>


Is it correct?


2011/12/20 Ullrich Hafner <[hidden email]>
On 12/20/2011 09:44 AM, Benniu wrote:
> Hi, developers
>
> I'm developing a jenkins plugin and one issue is blocking my work.
> In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
> core 3.0.5.  How can I resolve the conflict?
>
> Thanks

You can use the maven-shade-plugin for that dependency:
http://maven.apache.org/plugins/maven-shade-plugin/

Ulli

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Ulli Hafner
On Tue 20 Dec 2011 10:31:12 AM CET, BenNiu Ji wrote:

> I tried, but it's not working.
>
>         <executions>
>
>           <execution>
>
>             <phase>package</phase>
>
>             <goals>
>
>               <goal>shade</goal>
>
>             </goals>
>
>             <configuration>
>
>               <relocations>
>
>                 <relocation>
>
>                   <pattern>org.springframework</pattern>
>
>                  
> <shadedPattern>org.shaded.springframework</shadedPattern>
>
>                   </relocation>
>
>               </relocations>
>
>             </configuration>
>
>           </execution>
>
>         </executions>
>
>
> Is it correct?
>
>
> 2011/12/20 Ullrich Hafner <[hidden email]
> <mailto:[hidden email]>>
>
>     On 12/20/2011 09:44 AM, Benniu wrote:
>     > Hi, developers
>     >
>     > I'm developing a jenkins plugin and one issue is blocking my work.
>     > In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
>     > core 3.0.5.  How can I resolve the conflict?
>     >
>     > Thanks
>
>     You can use the maven-shade-plugin for that dependency:
>     http://maven.apache.org/plugins/maven-shade-plugin/
>
>     Ulli
>
>

Yes. What is not working?

Ulli
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Benniu
I'm still seeing the error:
FATAL: org.springframework.core.io.Resource.contentLength()J
java.lang.NoSuchMethodError: org.springframework.core.io.Resource.contentLength()J

2011/12/20 Ullrich Hafner <[hidden email]>
On Tue 20 Dec 2011 10:31:12 AM CET, BenNiu Ji wrote:
> I tried, but it's not working.
>
>         <executions>
>
>           <execution>
>
>             <phase>package</phase>
>
>             <goals>
>
>               <goal>shade</goal>
>
>             </goals>
>
>             <configuration>
>
>               <relocations>
>
>                 <relocation>
>
>                   <pattern>org.springframework</pattern>
>
>
> <shadedPattern>org.shaded.springframework</shadedPattern>
>
>                   </relocation>
>
>               </relocations>
>
>             </configuration>
>
>           </execution>
>
>         </executions>
>
>
> Is it correct?
>
>
> 2011/12/20 Ullrich Hafner <[hidden email]
> <mailto:[hidden email]>>
>
>     On 12/20/2011 09:44 AM, Benniu wrote:
>     > Hi, developers
>     >
>     > I'm developing a jenkins plugin and one issue is blocking my work.
>     > In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
>     > core 3.0.5.  How can I resolve the conflict?
>     >
>     > Thanks
>
>     You can use the maven-shade-plugin for that dependency:
>     http://maven.apache.org/plugins/maven-shade-plugin/
>
>     Ulli
>
>

Yes. What is not working?

Ulli

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Benniu
This method is in Spring core 3.0.5 which my plugin needs to use. But jenkins uses Spring core 2.5. So I guess the problem is the classes in spring core 2.5 is loaded. That's why the method is not found. I just don't know how to resolve the conflict. How can I let jenkins keep using 2.5 and while my plugin use the class in 3.0.5?

2011/12/20 BenNiu Ji <[hidden email]>
I'm still seeing the error:
FATAL: org.springframework.core.io.Resource.contentLength()J
java.lang.NoSuchMethodError: org.springframework.core.io.Resource.contentLength()J

2011/12/20 Ullrich Hafner <[hidden email]>
On Tue 20 Dec 2011 10:31:12 AM CET, BenNiu Ji wrote:
> I tried, but it's not working.
>
>         <executions>
>
>           <execution>
>
>             <phase>package</phase>
>
>             <goals>
>
>               <goal>shade</goal>
>
>             </goals>
>
>             <configuration>
>
>               <relocations>
>
>                 <relocation>
>
>                   <pattern>org.springframework</pattern>
>
>
> <shadedPattern>org.shaded.springframework</shadedPattern>
>
>                   </relocation>
>
>               </relocations>
>
>             </configuration>
>
>           </execution>
>
>         </executions>
>
>
> Is it correct?
>
>
> 2011/12/20 Ullrich Hafner <[hidden email]
> <mailto:[hidden email]>>
>
>     On 12/20/2011 09:44 AM, Benniu wrote:
>     > Hi, developers
>     >
>     > I'm developing a jenkins plugin and one issue is blocking my work.
>     > In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
>     > core 3.0.5.  How can I resolve the conflict?
>     >
>     > Thanks
>
>     You can use the maven-shade-plugin for that dependency:
>     http://maven.apache.org/plugins/maven-shade-plugin/
>
>     Ulli
>
>

Yes. What is not working?

Ulli


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Jørgen Tjernø
After using the shade plugin, you need to refer to the framework with the new name, here it would be org.shaded.springframework instead of org.springframework.
Are you referring to it as org.shaded.springframework in your code?

- Jørgen.

On Tue, Dec 20, 2011 at 4:03 AM, BenNiu Ji <[hidden email]> wrote:
This method is in Spring core 3.0.5 which my plugin needs to use. But jenkins uses Spring core 2.5. So I guess the problem is the classes in spring core 2.5 is loaded. That's why the method is not found. I just don't know how to resolve the conflict. How can I let jenkins keep using 2.5 and while my plugin use the class in 3.0.5?


2011/12/20 BenNiu Ji <[hidden email]>
I'm still seeing the error:
FATAL: org.springframework.core.io.Resource.contentLength()J

java.lang.NoSuchMethodError: org.springframework.core.io.Resource.contentLength()J

2011/12/20 Ullrich Hafner <[hidden email]>
On Tue 20 Dec 2011 10:31:12 AM CET, BenNiu Ji wrote:
> I tried, but it's not working.
>
>         <executions>
>
>           <execution>
>
>             <phase>package</phase>
>
>             <goals>
>
>               <goal>shade</goal>
>
>             </goals>
>
>             <configuration>
>
>               <relocations>
>
>                 <relocation>
>
>                   <pattern>org.springframework</pattern>
>
>
> <shadedPattern>org.shaded.springframework</shadedPattern>
>
>                   </relocation>
>
>               </relocations>
>
>             </configuration>
>
>           </execution>
>
>         </executions>
>
>
> Is it correct?
>
>
> 2011/12/20 Ullrich Hafner <[hidden email]
> <mailto:[hidden email]>>
>
>     On 12/20/2011 09:44 AM, Benniu wrote:
>     > Hi, developers
>     >
>     > I'm developing a jenkins plugin and one issue is blocking my work.
>     > In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
>     > core 3.0.5.  How can I resolve the conflict?
>     >
>     > Thanks
>
>     You can use the maven-shade-plugin for that dependency:
>     http://maven.apache.org/plugins/maven-shade-plugin/
>
>     Ulli
>
>

Yes. What is not working?

Ulli



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: About dependency conflict

Benniu
Thank you guys. I finally got the conflict resolved.

In my plugin, I use jar A. and in Jar A, it depends on Spring core 3.0.5
I rebuild jar A with shaded spring core. 
It's working fine now.

2011/12/21 Jørgen Tjernø <[hidden email]>
After using the shade plugin, you need to refer to the framework with the new name, here it would be org.shaded.springframework instead of org.springframework.
Are you referring to it as org.shaded.springframework in your code?

- Jørgen.

On Tue, Dec 20, 2011 at 4:03 AM, BenNiu Ji <[hidden email]> wrote:
This method is in Spring core 3.0.5 which my plugin needs to use. But jenkins uses Spring core 2.5. So I guess the problem is the classes in spring core 2.5 is loaded. That's why the method is not found. I just don't know how to resolve the conflict. How can I let jenkins keep using 2.5 and while my plugin use the class in 3.0.5?


2011/12/20 BenNiu Ji <[hidden email]>
I'm still seeing the error:
FATAL: org.springframework.core.io.Resource.contentLength()J
java.lang.NoSuchMethodError: org.springframework.core.io.Resource.contentLength()J

2011/12/20 Ullrich Hafner <[hidden email]>
On Tue 20 Dec 2011 10:31:12 AM CET, BenNiu Ji wrote:
> I tried, but it's not working.
>
>         <executions>
>
>           <execution>
>
>             <phase>package</phase>
>
>             <goals>
>
>               <goal>shade</goal>
>
>             </goals>
>
>             <configuration>
>
>               <relocations>
>
>                 <relocation>
>
>                   <pattern>org.springframework</pattern>
>
>
> <shadedPattern>org.shaded.springframework</shadedPattern>
>
>                   </relocation>
>
>               </relocations>
>
>             </configuration>
>
>           </execution>
>
>         </executions>
>
>
> Is it correct?
>
>
> 2011/12/20 Ullrich Hafner <[hidden email]
> <mailto:[hidden email]>>
>
>     On 12/20/2011 09:44 AM, Benniu wrote:
>     > Hi, developers
>     >
>     > I'm developing a jenkins plugin and one issue is blocking my work.
>     > In Jenkins, spring core 2.5 is used. By in my plugin, I need spring
>     > core 3.0.5.  How can I resolve the conflict?
>     >
>     > Thanks
>
>     You can use the maven-shade-plugin for that dependency:
>     http://maven.apache.org/plugins/maven-shade-plugin/
>
>     Ulli
>
>

Yes. What is not working?

Ulli




Loading...