[scala-tools] why do my .class files disappear?

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

[scala-tools] why do my .class files disappear?

Roland Kuhn
Hi,

for the most part scala+maven+eclipse in a mixed scala-java project
works well, but there is one thing I do not understand: why do my scala
.class files disappear from time to time? I just witnessed an example
which gave me an idea. I cleaned and automatically built a project after
a large refactoring, the main classes compiled fine but the tests were
still in disarray; all scala classes were there (verified on the
filesystem). After saving a test class (java), some build process was
running after which all scala-related .class files were gone, naturally
leading to many errors flagged in the main java classes. Why is this so?

My config:
- Eclipse 3.5.2
- scala plugin (nightly)
- maven and scala builders active (in that order, I tried other
combinations to no avail)

pom.xml (compiler plugins only):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<version>2.3.2</version>
<executions>
<execution>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.13.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals><goal>add-source</goal><goal>compile</goal></goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals><goal>testCompile</goal></goals>
</execution>
</executions>
</plugin>

Thanks,

Roland
Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

David Bernard-3
which nightly (update-site) of eclipse (master or wip_exp_backport) ?

Have you tried to diseable the maven builder ?

what is the log of your maven console (in eclipse) ?

/davidB

On Mon, Feb 21, 2011 at 21:25, Roland Kuhn <[hidden email]> wrote:
Hi,

for the most part scala+maven+eclipse in a mixed scala-java project works well, but there is one thing I do not understand: why do my scala .class files disappear from time to time? I just witnessed an example which gave me an idea. I cleaned and automatically built a project after a large refactoring, the main classes compiled fine but the tests were still in disarray; all scala classes were there (verified on the filesystem). After saving a test class (java), some build process was running after which all scala-related .class files were gone, naturally leading to many errors flagged in the main java classes. Why is this so?

My config:
- Eclipse 3.5.2
- scala plugin (nightly)
- maven and scala builders active (in that order, I tried other combinations to no avail)

pom.xml (compiler plugins only):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<version>2.3.2</version>
<executions>
<execution>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.13.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals><goal>add-source</goal><goal>compile</goal></goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals><goal>testCompile</goal></goals>
</execution>
</executions>
</plugin>

Thanks,

Roland

Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

Roland Kuhn
1) http://download.scala-ide.org/update-current-35

which is the most reliable combination?

2) yes, didn't change it (though compile went a lot faster from what I could see)

3) between "files there" and "files gone" there appeared only one line with "Maven Builder: AUTO_BUILD"

Am 21.02.2011 22:39, schrieb David Bernard:
which nightly (update-site) of eclipse (master or wip_exp_backport) ?

Have you tried to diseable the maven builder ?

what is the log of your maven console (in eclipse) ?

/davidB

On Mon, Feb 21, 2011 at 21:25, Roland Kuhn <[hidden email]> wrote:
Hi,

for the most part scala+maven+eclipse in a mixed scala-java project works well, but there is one thing I do not understand: why do my scala .class files disappear from time to time? I just witnessed an example which gave me an idea. I cleaned and automatically built a project after a large refactoring, the main classes compiled fine but the tests were still in disarray; all scala classes were there (verified on the filesystem). After saving a test class (java), some build process was running after which all scala-related .class files were gone, naturally leading to many errors flagged in the main java classes. Why is this so?

My config:
- Eclipse 3.5.2
- scala plugin (nightly)
- maven and scala builders active (in that order, I tried other combinations to no avail)

pom.xml (compiler plugins only):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<version>2.3.2</version>
<executions>
<execution>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.13.1</version>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals><goal>add-source</goal><goal>compile</goal></goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals><goal>testCompile</goal></goals>
</execution>
</executions>
</plugin>

Thanks,

Roland


Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

Josh Suereth

If it happens every time you modify your pom then i believe the culprit is the Maven builder.

On Feb 21, 2011 5:39 PM, "Roland Kuhn" <[hidden email]> wrote:

1) http://download.scala-ide.org/update-current-35

which is the most reliable combination?

2) yes, didn't change it (though compile went a lot faster from what I could see)

3) between "files there" and "files gone" there appeared only one line with "Maven Builder: AUTO_BUILD"

Am 21.02.2011 22:39, schrieb David Bernard:


>
> which nightly (update-site) of eclipse (master or wip_exp_backport) ?
>
> Have you tried to dis...

Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

Roland Kuhn
If that is so, how do I fix it? I'm thinking about splitting the target/ folder for java and scala, but I am not certain what the best way is. I guess I'll find out sooner or later, yet it feels so unproductive fighting with the tools…

On Feb 22, 2011, at 1:03, Josh Suereth <[hidden email]> wrote:

If it happens every time you modify your pom then i believe the culprit is the Maven builder.

On Feb 21, 2011 5:39 PM, "Roland Kuhn" <[hidden email]> wrote:

1) http://download.scala-ide.org/update-current-35

which is the most reliable combination?

2) yes, didn't change it (though compile went a lot faster from what I could see)

3) between "files there" and "files gone" there appeared only one line with "Maven Builder: AUTO_BUILD"

Am 21.02.2011 22:39, schrieb David Bernard:


>
> which nightly (update-site) of eclipse (master or wip_exp_backport) ?
>
> Have you tried to dis...

Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

David Bernard-3
try diseable Maven builder.

On Tue, Feb 22, 2011 at 07:45, Roland Kuhn <[hidden email]> wrote:
If that is so, how do I fix it? I'm thinking about splitting the target/ folder for java and scala, but I am not certain what the best way is. I guess I'll find out sooner or later, yet it feels so unproductive fighting with the tools…

On Feb 22, 2011, at 1:03, Josh Suereth <[hidden email]> wrote:

If it happens every time you modify your pom then i believe the culprit is the Maven builder.

On Feb 21, 2011 5:39 PM, "Roland Kuhn" <[hidden email][hidden email]> wrote:

1) http://download.scala-ide.org/update-current-35

which is the most reliable combination?

IMO
 

2) yes, didn't change it (though compile went a lot faster from what I could see)

3) between "files there" and "files gone" there appeared only one line with "Maven Builder: AUTO_BUILD"

Am <a href="tel:21.02.2011%2022" target="_blank">21.02.2011 22:39, schrieb David Bernard:


>
> which nightly (update-site) of eclipse (master or wip_exp_backport) ?
>
> Have you tried to dis...


Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

Roland Kuhn
Okay, tried that, but apparently without effect (though I didn't restart Eclipse). Then I updated to the wip-exp-backport scala IDE plugin (with Eclipse restart) and after that at least the error does not show anymore (after partial rebuild) and type information was available. The .class files still disappear, though.

Disabling the Maven builder has the obvious effect that my protobuf source files are not generated anymore (which was done by an ant execution from Maven) and their types sometimes vanish (to be restored by the partial build after saving the file). Now, this is probably expected, as I should tell Eclipse about that (how? I'll probably find out...).

Am 22.02.2011 09:18, schrieb David Bernard:
try diseable Maven builder.

On Tue, Feb 22, 2011 at 07:45, Roland Kuhn <[hidden email]> wrote:
If that is so, how do I fix it? I'm thinking about splitting the target/ folder for java and scala, but I am not certain what the best way is. I guess I'll find out sooner or later, yet it feels so unproductive fighting with the tools…

On Feb 22, 2011, at 1:03, Josh Suereth <[hidden email]> wrote:

If it happens every time you modify your pom then i believe the culprit is the Maven builder.

On Feb 21, 2011 5:39 PM, "Roland Kuhn" <[hidden email]> wrote:

1) http://download.scala-ide.org/update-current-35

which is the most reliable combination?

IMO
 

2) yes, didn't change it (though compile went a lot faster from what I could see)

3) between "files there" and "files gone" there appeared only one line with "Maven Builder: AUTO_BUILD"

Am <a moz-do-not-send="true" href="tel:21.02.2011%2022" target="_blank">21.02.2011 22:39, schrieb David Bernard:


>
> which nightly (update-site) of eclipse (master or wip_exp_backport) ?
>
> Have you tried to dis...



Reply | Threaded
Open this post in threaded view
|

Re: [scala-tools] why do my .class files disappear?

Roland Kuhn
Spoke too soon: after a while the errors show again. So, the only solution I know until now is doing a clean once in a while :-(

Am 22.02.2011 16:21, schrieb Roland Kuhn:
Okay, tried that, but apparently without effect (though I didn't restart Eclipse). Then I updated to the wip-exp-backport scala IDE plugin (with Eclipse restart) and after that at least the error does not show anymore (after partial rebuild) and type information was available. The .class files still disappear, though.

Disabling the Maven builder has the obvious effect that my protobuf source files are not generated anymore (which was done by an ant execution from Maven) and their types sometimes vanish (to be restored by the partial build after saving the file). Now, this is probably expected, as I should tell Eclipse about that (how? I'll probably find out...).

Am 22.02.2011 09:18, schrieb David Bernard:
try diseable Maven builder.

On Tue, Feb 22, 2011 at 07:45, Roland Kuhn <[hidden email]> wrote:
If that is so, how do I fix it? I'm thinking about splitting the target/ folder for java and scala, but I am not certain what the best way is. I guess I'll find out sooner or later, yet it feels so unproductive fighting with the tools…

On Feb 22, 2011, at 1:03, Josh Suereth <[hidden email]> wrote:

If it happens every time you modify your pom then i believe the culprit is the Maven builder.

On Feb 21, 2011 5:39 PM, "Roland Kuhn" <[hidden email]> wrote:

1) http://download.scala-ide.org/update-current-35

which is the most reliable combination?

IMO
 

2) yes, didn't change it (though compile went a lot faster from what I could see)

3) between "files there" and "files gone" there appeared only one line with "Maven Builder: AUTO_BUILD"

Am <a moz-do-not-send="true" href="tel:21.02.2011%2022" target="_blank">21.02.2011 22:39, schrieb David Bernard:


>
> which nightly (update-site) of eclipse (master or wip_exp_backport) ?
>
> Have you tried to dis...