This page is no longer maintained — Please continue to the home page at www.scala-lang.org

why do my .class files disappear?

7 replies
roland.kuhn
Joined: 2011-02-21,
User offline. Last seen 35 weeks 3 days ago.

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):

org.apache.maven.plugins
maven-compiler-plugin

1.6
1.6

2.3.2

compile
compile

org.scala-tools
maven-scala-plugin
2.13.1

scala-compile-first
process-resources
add-sourcecompile

scala-test-compile
process-test-resources
testCompile

Thanks,

Roland

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: why do my .class files disappear?
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 <google [at] rkuhn [dot] info> 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

roland.kuhn
Joined: 2011-02-21,
User offline. Last seen 35 weeks 3 days ago.
Re: why do my .class files disappear?
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:
84648 [at] mail [dot] gmail [dot] com" type="cite">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 <google [at] rkuhn [dot] info" rel="nofollow">google [at] rkuhn [dot] info> 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


Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: why do my .class files disappear?

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" <google [at] rkuhn [dot] info> 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...

roland.kuhn
Joined: 2011-02-21,
User offline. Last seen 35 weeks 3 days ago.
Re: why do my .class files disappear?
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 <joshua [dot] suereth [at] gmail [dot] com> 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" <google [at] rkuhn [dot] info (google [at] rkuhn [dot] info" rel="nofollow">google [at] rkuhn [dot] info)> 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...

david.bernard
Joined: 2009-01-08,
User offline. Last seen 1 year 27 weeks ago.
Re: why do my .class files disappear?
try diseable Maven builder.

On Tue, Feb 22, 2011 at 07:45, Roland Kuhn <google [at] rkuhn [dot] info> 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 <joshua [dot] suereth [at] gmail [dot] com> 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" <google [at] rkuhn [dot] infogoogle [at] rkuhn [dot] info> wrote:

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

which is the most reliable combination?

IMO http://download.scala-ide.org/nightly-update-wip-exp-backport-2.8.1.final  

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...


roland.kuhn
Joined: 2011-02-21,
User offline. Last seen 35 weeks 3 days ago.
Re: why do my .class files disappear?
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:
yRJVdW4fdowh2vGkFFpbT5nC0WSrb4QsSsB1F [at] mail [dot] gmail [dot] com" type="cite">try diseable Maven builder.

On Tue, Feb 22, 2011 at 07:45, Roland Kuhn <google [at] rkuhn [dot] info" rel="nofollow">google [at] rkuhn [dot] info> 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 <joshua [dot] suereth [at] gmail [dot] com" target="_blank" rel="nofollow">joshua [dot] suereth [at] gmail [dot] com> 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" <google [at] rkuhn [dot] info" target="_blank" rel="nofollow">google [at] rkuhn [dot] info> wrote:

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

which is the most reliable combination?

IMO  http://download.scala-ide.org/nightly-update-wip-exp-backport-2.8.1.final  

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...



roland.kuhn
Joined: 2011-02-21,
User offline. Last seen 35 weeks 3 days ago.
Re: why do my .class files disappear?
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:
4D63D477 [dot] 8090905 [at] rkuhn [dot] info" type="cite"> 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:
yRJVdW4fdowh2vGkFFpbT5nC0WSrb4QsSsB1F [at] mail [dot] gmail [dot] com" type="cite">try diseable Maven builder.

On Tue, Feb 22, 2011 at 07:45, Roland Kuhn <google [at] rkuhn [dot] info" rel="nofollow">google [at] rkuhn [dot] info> 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 <joshua [dot] suereth [at] gmail [dot] com" target="_blank" rel="nofollow">joshua [dot] suereth [at] gmail [dot] com> 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" <google [at] rkuhn [dot] info" target="_blank" rel="nofollow">google [at] rkuhn [dot] info> wrote:

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

which is the most reliable combination?

IMO  http://download.scala-ide.org/nightly-update-wip-exp-backport-2.8.1.final  

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...




Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland