GayaBalan / ivybeans

Automatically exported from code.google.com/p/ivybeans
0 stars 0 forks source link

Ivy libraries not in classpath for test #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Environment : ivybeans 1.0, netbeans daily 20080924 on jdk6, Win XP,
projects on jdk 5

Description :
There's some strange behaviour with the Ivy libraries.
The tests can't find the Ivy libraries when executed. Also the error badges
are on the file in the project window.But in the editor all looks fine,
there's code completion for the libraries, source and javadoc are available.
running all tests or single test fails.
Then when I open the test , add a blank space and save, the test runs.
Error badges on the files come and go randomly.
Perhaps a related issue: I have another project B that builds fine
standalone but when I test a project A that uses this project B, the test
fails saying that the project B can't find the Ivy libraries.

Original issue reported on code.google.com by bart...@gmail.com on 30 Sep 2008 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
That is weird. 
If you can provide a short sample project in order to I reproduce it.
It will help a lot. 

Original comment by laurent....@gmail.com on 30 Sep 2008 at 6:07

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 30 Sep 2008 at 6:07

GoogleCodeExporter commented 9 years ago
Now on NB daily 20080930.
Sorry for the delay.
Here's an example try-ivy-2.
Here all libraries are added by Ivy. I have another behaviour if I add junit as 
a
normal netbeans library. Then run (test)file works always, the badges are good 
but
run test on the project looses the Ivy libs .

By the way, I can't find a way to add a library only for testing. They only 
appear
correctly if conf="*", but in all  .But maybe this is another issue.
The settings file ensures that my local maven repo is used for resolving.

Bart

Original comment by bart...@gmail.com on 2 Oct 2008 at 11:08

Attachments:

GoogleCodeExporter commented 9 years ago
First of all : Indeed, if you use Netbeans library mecanism, it will always 
work. 

Secondly, if I well understand the problem here here, you are confused by 
Netbeans
Scope and ivy configurations. 
Like Maven Scopes in Netbeans are fixed and you can not change it, whereas 
Ivybeans
provide configurations which are configurable. We choose to let ivy users to use
configurations at will and to provide a mapping mecanism.

By default we add in ivy.xml 4 configurations(compile, runtime, compile-test,
runtime-test), that you can map with the four Netbeans scopes (Compile, Runtime,
Compile tests, Run tests). Unfortunately, the default mapping in IvyBeans 
between
Netbeans scopes and Ivy configuration is not good. The good mapping should be 
like I
show you in my print screen.

I will change the default mapping in this way for the next release. 

I do not think that I fix all your troubles here but I hope almost one and No 
problem
for the delay it is open source here, no stress just pleasure ;).

Original comment by laurent....@gmail.com on 2 Oct 2008 at 6:58

Attachments:

GoogleCodeExporter commented 9 years ago
I get the same errors with the good mappings. But now the libraries show up in 
the
right place.

Original comment by bart...@gmail.com on 6 Oct 2008 at 9:22

GoogleCodeExporter commented 9 years ago
I could not reproduce it with the current ivybeans trunk but I reproduce it 
with the
1.0 release  using Netbeans Dev 20081007. I uploaded a 1.1-M1 that should fixed 
the
problem.

Original comment by laurent....@gmail.com on 7 Oct 2008 at 8:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I reproduce it with the current RC1. 
To reproduce : 
 Add or remove a used library in java sources from Ivy Libraries node, it will change
the status (compiling or not compiling) of the open file but not in the project 
tab
view neither in the tasks tab view.

 Finally, to change the status in the two views, you have to touch the file (add a
blank and save the file for example).

Original comment by laurent....@gmail.com on 21 Oct 2008 at 9:04

GoogleCodeExporter commented 9 years ago
For compiling tests this is the target that is failing for me. 

<target
depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depe
nd"
if="have.tests" name="-do-compile-test">
        <!-- next line is where it fails -->
        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true"
destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
        <copy todir="${build.test.classes.dir}">
            <fileset dir="${test.src.dir}"
excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
        </copy>
    </target>

I'm assuming that the javac.test.classpath is causing the issue.

Original comment by bentilf...@gmail.com on 7 Nov 2008 at 9:38

GoogleCodeExporter commented 9 years ago
It is probably due to the fact that the javac.test.classpath is not managedand
refreshed as the javac.classpath ones. 

Original comment by laurent....@gmail.com on 11 Nov 2008 at 11:50

GoogleCodeExporter commented 9 years ago
The ivy-impl.xml ant build template does not contain test.classpath management.

Iput in attach a good ivy-impl.xml to use. 

Original comment by laurent....@gmail.com on 16 Nov 2008 at 7:29

Attachments:

GoogleCodeExporter commented 9 years ago
Sending       
D:\scm\svn\code.google\ivybeans\trunk\ivybeans\ivy-module\src\com\googlecode\ivy
beans\module\resources\ivy-impl_.xml
Transmitting file data .
Committed revision 221.

Original comment by laurent....@gmail.com on 16 Nov 2008 at 7:36

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 16 Nov 2008 at 7:36

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 16 Nov 2008 at 7:48

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 1 Dec 2008 at 10:14