"install" not installing in local repo

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

"install" not installing in local repo

Guillaume Laforge
Hi all,

I noticed a strange behavior with the "install" task, when I'm using it on the Groovy project.
In a nutshell, it's not updating the JAR in my local repo, unless I'm doing a "clean install".

Let's say I'm modifying something in the groovy-servlet subproject.
Then do "gradle install".
The changes I made don't find their way in the snapshot (I'm don't even know if it scratches the old jar or not).
Although I see that the compiler does indeed compile my changes, as for example, if I introduce a typo on purpose, the compiler will complain.
But it's only when I do "gradle clean install" that the snapshot is updated with my changes in my local repo.

So... is it a problem of the Groovy build, or a problem in Gradle?
If the latter, is it a known issue?

It is quite annoying as clean builds are more time consuming :-(

Thanks for your attention.

--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Luke Daley-2

On 25/09/2012, at 1:50 PM, Guillaume Laforge wrote:

> Hi all,
>
> I noticed a strange behavior with the "install" task, when I'm using it on the Groovy project.
> In a nutshell, it's not updating the JAR in my local repo, unless I'm doing a "clean install".
>
> Let's say I'm modifying something in the groovy-servlet subproject.
> Then do "gradle install".
> The changes I made don't find their way in the snapshot (I'm don't even know if it scratches the old jar or not).

How do you know that it's not updating?

> Although I see that the compiler does indeed compile my changes, as for example, if I introduce a typo on purpose, the compiler will complain.
> But it's only when I do "gradle clean install" that the snapshot is updated with my changes in my local repo.
>
> So... is it a problem of the Groovy build, or a problem in Gradle?
> If the latter, is it a known issue?
>
> It is quite annoying as clean builds are more time consuming :-(

I'm unable to reproduce this with a different project. I tried with the Groovy project, but `install` fails with https://gist.github.com/3806353

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Guillaume Laforge
On Sun, Sep 30, 2012 at 11:46 AM, Luke Daley <[hidden email]> wrote:

On 25/09/2012, at 1:50 PM, Guillaume Laforge wrote:

> Hi all,
>
> I noticed a strange behavior with the "install" task, when I'm using it on the Groovy project.
> In a nutshell, it's not updating the JAR in my local repo, unless I'm doing a "clean install".
>
> Let's say I'm modifying something in the groovy-servlet subproject.
> Then do "gradle install".
> The changes I made don't find their way in the snapshot (I'm don't even know if it scratches the old jar or not).

How do you know that it's not updating?

Because when I then use that JAR, the modifications I had made are not there.
For example, say I'm adding some println statements here and there, and when I use the supposedly updated JAR, my printlns aren't there.
But when I do a clean install, I get those new printlns.
 
> Although I see that the compiler does indeed compile my changes, as for example, if I introduce a typo on purpose, the compiler will complain.
> But it's only when I do "gradle clean install" that the snapshot is updated with my changes in my local repo.
>
> So... is it a problem of the Groovy build, or a problem in Gradle?
> If the latter, is it a known issue?
>
> It is quite annoying as clean builds are more time consuming :-(

I'm unable to reproduce this with a different project. I tried with the Groovy project, but `install` fails with https://gist.github.com/3806353

That's because you're using an old 1.8.x project setup that had some generated sources, but it's working differently now with the 2.x line.
You should do a clean checkout of Groovy and start anew. 

--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Luke Daley-2

On 30/09/2012, at 10:52 AM, Guillaume Laforge wrote:

> On Sun, Sep 30, 2012 at 11:46 AM, Luke Daley <[hidden email]> wrote:
>
> On 25/09/2012, at 1:50 PM, Guillaume Laforge wrote:
>
> > Hi all,
> >
> > I noticed a strange behavior with the "install" task, when I'm using it on the Groovy project.
> > In a nutshell, it's not updating the JAR in my local repo, unless I'm doing a "clean install".
> >
> > Let's say I'm modifying something in the groovy-servlet subproject.
> > Then do "gradle install".
> > The changes I made don't find their way in the snapshot (I'm don't even know if it scratches the old jar or not).
>
> How do you know that it's not updating?
>
> Because when I then use that JAR, the modifications I had made are not there.
> For example, say I'm adding some println statements here and there, and when I use the supposedly updated JAR, my printlns aren't there.
> But when I do a clean install, I get those new printlns.

> when I then use that JAR

What do you mean here? Are you grabbing the jar out of the maven local repo?

>  
> > Although I see that the compiler does indeed compile my changes, as for example, if I introduce a typo on purpose, the compiler will complain.
> > But it's only when I do "gradle clean install" that the snapshot is updated with my changes in my local repo.
> >
> > So... is it a problem of the Groovy build, or a problem in Gradle?
> > If the latter, is it a known issue?
> >
> > It is quite annoying as clean builds are more time consuming :-(
>
> I'm unable to reproduce this with a different project. I tried with the Groovy project, but `install` fails with https://gist.github.com/3806353
>
> That's because you're using an old 1.8.x project setup that had some generated sources, but it's working differently now with the 2.x line.
> You should do a clean checkout of Groovy and start anew.

git clean -f -d did the trick.

I still can't reproduce. The jar is written into the local maven cache every time for me.

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Guillaume Laforge
On Sun, Sep 30, 2012 at 12:33 PM, Luke Daley <[hidden email]> wrote:
[...]
> when I then use that JAR

What do you mean here? Are you grabbing the jar out of the maven local repo?

Yes, I was copying that jar from the maven local repo manually to the WEB-INF/lib folder of a web application (a Gaelyk app in my case).
 
[...]git clean -f -d did the trick.

I still can't reproduce. The jar is written into the local maven cache every time for me.

You're sure it's an updated JAR that is pushed in the local maven cache?
That it really contains changes made?

--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Luke Daley-2

On 30/09/2012, at 1:11 PM, Guillaume Laforge wrote:

> On Sun, Sep 30, 2012 at 12:33 PM, Luke Daley <[hidden email]> wrote:
> [...]
> > when I then use that JAR
>
> What do you mean here? Are you grabbing the jar out of the maven local repo?
>
> Yes, I was copying that jar from the maven local repo manually to the WEB-INF/lib folder of a web application (a Gaelyk app in my case).

Why not copy it from the build?

>  [...]git clean -f -d did the trick.
>
> I still can't reproduce. The jar is written into the local maven cache every time for me.
>
> You're sure it's an updated JAR that is pushed in the local maven cache?
> That it really contains changes made?

I'm using…

shasum subprojects/groovy-servlet/target/libs/groovy-servlet-2.1.0-SNAPSHOT.jar && shasum ~/.m2/repository/org/codehaus/groovy/groovy-servlet/2.1.0-SNAPSHOT/groovy-servlet-2.1.0-SNAPSHOT.jar

To check the content. It's definitely changing in sync.

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Guillaume Laforge
On Sun, Sep 30, 2012 at 2:23 PM, Luke Daley <[hidden email]> wrote:

On 30/09/2012, at 1:11 PM, Guillaume Laforge wrote:

> On Sun, Sep 30, 2012 at 12:33 PM, Luke Daley <[hidden email]> wrote:
> [...]
> > when I then use that JAR
>
> What do you mean here? Are you grabbing the jar out of the maven local repo?
>
> Yes, I was copying that jar from the maven local repo manually to the WEB-INF/lib folder of a web application (a Gaelyk app in my case).

Why not copy it from the build?

I ended up doing clean builds and copying from the build, but that's not solving the problem :-)

 
>  [...]git clean -f -d did the trick.
>
> I still can't reproduce. The jar is written into the local maven cache every time for me.
>
> You're sure it's an updated JAR that is pushed in the local maven cache?
> That it really contains changes made?

I'm using…

shasum subprojects/groovy-servlet/target/libs/groovy-servlet-2.1.0-SNAPSHOT.jar && shasum ~/.m2/repository/org/codehaus/groovy/groovy-servlet/2.1.0-SNAPSHOT/groovy-servlet-2.1.0-SNAPSHOT.jar

To check the content. It's definitely changing in sync.

Well, in the case of Groovy, it doesn't prove anything, as the groovy compiled classes contained a kind of timestamp field that changes upon recompilation, even if no changes to the code have been made. So you could think the JAR is indeed updated, which it is, but perhaps it may not include the actual changes.

I'll try to have another look at it and see what's going on, when I have some time.

--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Luke Daley-2

On 30/09/2012, at 2:00 PM, Guillaume Laforge wrote:

> On Sun, Sep 30, 2012 at 2:23 PM, Luke Daley <[hidden email]> wrote:
>
> On 30/09/2012, at 1:11 PM, Guillaume Laforge wrote:
>
> > On Sun, Sep 30, 2012 at 12:33 PM, Luke Daley <[hidden email]> wrote:
> > [...]
> > > when I then use that JAR
> >
> > What do you mean here? Are you grabbing the jar out of the maven local repo?
> >
> > Yes, I was copying that jar from the maven local repo manually to the WEB-INF/lib folder of a web application (a Gaelyk app in my case).
>
> Why not copy it from the build?
>
> I ended up doing clean builds and copying from the build, but that's not solving the problem :-)
>
>  
> >  [...]git clean -f -d did the trick.
> >
> > I still can't reproduce. The jar is written into the local maven cache every time for me.
> >
> > You're sure it's an updated JAR that is pushed in the local maven cache?
> > That it really contains changes made?
>
> I'm using…
>
> shasum subprojects/groovy-servlet/target/libs/groovy-servlet-2.1.0-SNAPSHOT.jar && shasum ~/.m2/repository/org/codehaus/groovy/groovy-servlet/2.1.0-SNAPSHOT/groovy-servlet-2.1.0-SNAPSHOT.jar
>
> To check the content. It's definitely changing in sync.
>
> Well, in the case of Groovy, it doesn't prove anything

If there was a problem where changes that were made to Groovy files were not picked up on compilation, we'd definitely know about it. Everyone would have the problem. Therefore, the fact that the jar in the build is the same as what is in the maven local cache is a good indicator that the change has been applied.

> , as the groovy compiled classes contained a kind of timestamp field that changes upon recompilation, even if no changes to the code have been made. So you could think the JAR is indeed updated, which it is, but perhaps it may not include the actual changes.
>
> I'll try to have another look at it and see what's going on, when I have some time.

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: "install" not installing in local repo

Guillaume Laforge
On Sun, Sep 30, 2012 at 3:03 PM, Luke Daley <[hidden email]> wrote:
[...] 
If there was a problem where changes that were made to Groovy files were not picked up on compilation, we'd definitely know about it. Everyone would have the problem. Therefore, the fact that the jar in the build is the same as what is in the maven local cache is a good indicator that the change has been applied.

So... I've tried again, and I think the problem somehow lies with our subprojects in a way or another.

Do the following:

1) gradle clean
2) gradle install
3) java -cp ~/.m2/repository/org/codehaus/groovy/groovy-all/2.1.0-SNAPSHOT/groovy-all-2.1.0-SNAPSHOT.jar groovy.json.JsonBuilder
Since there's no main() method on JsonBuilder, it'll complain about that method being absent
4) go to the groovy-json subproject, and modify JsonBuilder to add a dummy main() method which does a println("hello")
5) gradle install
6) java -cp ~/.m2/repository/org/codehaus/groovy/groovy-all/2.1.0-SNAPSHOT/groovy-all-2.1.0-SNAPSHOT.jar groovy.json.JsonBuilder
This time again, it'll complain again because there's no main method! Although you've just added one!

So it's somehow a problem with the multimodule support.
It may very well be a problem in our build, and not at all in gradle, but whatever it is, it's painful :-)

--
Guillaume Laforge
Groovy Project Manager
SpringSource, a division of VMware