rasyahadlinugraha / wiquery

Automatically exported from code.google.com/p/wiquery
MIT License
0 stars 0 forks source link

cleanup maven dependencies #175

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
wiquery-1.5-M1

Please cleanup maven dependencies

log4j: 
Is currently without scope (=compile) but wiquery uses slf4j, so it doesn't 
make sense to have this dependency to 'compile'. It looks like you are using 
this implementation in your tests (slf4j-log4j12 has scope test) so change this 
scope to 'test' please.

wicket-core:
I suggest to change scope to 'provided' to loose coupling to specific wicket 
version. Most (probably all) having already a wicket-core dependency in her 
projects and wiquery does not matter if I use 1.5-rc2 or 1.5-RC3...

wicket-util, wicket-request:
remove dependencies, wicket-core already had this dependencies so no need to 
have it here again.

Original issue reported on code.google.com by minas.ma...@gmail.com on 15 Apr 2011 at 11:58

GoogleCodeExporter commented 9 years ago
ok, using 1.5-rc2 or 1.5-RC3 was a bad example (cause name of classes/packages 
can change from RC to RC -> PackagedTextTemplate -> PackageTextTemplate) how 
ever...

With released wicket versions wiquery should work with any release of 1.5.x and 
not matter if I use 1.5.10 or 1.5.11... (AFAIK between releases in the same 
version wicket does not change things like above)...

Original comment by minas.ma...@gmail.com on 15 Apr 2011 at 12:47

GoogleCodeExporter commented 9 years ago
Thanks for the pointers, we are still working on 1.5 and it is hardly working. 
Will take these points with me in next test version.

Original comment by hielke.hoeve on 18 Apr 2011 at 12:34

GoogleCodeExporter commented 9 years ago
One thing more: currently all *.java files are also included in jar file :-/
This because directory src/main/java is included (in pom) as resource path. 
Since all resources are in resource directory, this is not an necessary to 
include source directory...

Please don't get me wrong, I like wiquery. But maven config really needs a 
cleanup...

PS: Only test source directory contains some html and properties files. Moving 
these to test resources and you could completely remove definitions of 
sourceDirectory, testSourceDirectory,  resources and testResources from pom 
(since you do the maven way...)

Original comment by minas.ma...@gmail.com on 3 May 2011 at 3:02

GoogleCodeExporter commented 9 years ago
I think I fixed it, moving html and properties files to the resources makes 
development a living hell. I excluded .java from the resources so they won't be 
released anymore.

Original comment by hielke.hoeve on 4 May 2011 at 8:35

GoogleCodeExporter commented 9 years ago
Ok, thanks. I imagine having markup and java file in same source directory is 
much easier... fortunately with our IDE and a wicket plugin we can simple 
navigate from java to markup, even if they are in different re/source roots. 
How ever... excluding java files should do the job too... Thanks.

Still pending:

slf4j-log4j12 and log4j dependencies should have scope 'test'

It makes no sense using slf4j as logging facade and deploying with a specific 
logging implementation...? 

Thanks again for great work and I'm sorry for any inconvience.

Original comment by minas.ma...@gmail.com on 4 May 2011 at 9:09

GoogleCodeExporter commented 9 years ago
What if someone does not provide an implementation, then the logger cannot log 
and all is information is lost...

Original comment by hielke.hoeve on 4 May 2011 at 9:45

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 4 May 2011 at 9:45

GoogleCodeExporter commented 9 years ago
Wait... I see your point :) it should be test indeed.

Original comment by hielke.hoeve on 4 May 2011 at 9:54

GoogleCodeExporter commented 9 years ago
I assume all is fixed now?

Original comment by hielke.hoeve on 10 May 2011 at 2:07

GoogleCodeExporter commented 9 years ago
Hello hielke

Great job! Now wiquery can easily added to wicket projects without the need to 
exclude/change any dependencies (Ex: in our case we mostly use logback for 
logging and not log4j. This makes using slf4j perfect :-). Another great 
advantage of this cleanup: having only wicket-core dependency. This makes 
easily to change wicket version (regarding to issue 176). 

So, well done! Great job!

One thing you probably overlooked: junit dependency in wiquery-core should have 
<scope>test</scope>.

regards minas

Side note: when releasing 1.5 IMO the user need to get informed, that wiquery 
artifactId has changed too...

Original comment by minas.ma...@gmail.com on 11 May 2011 at 8:13

GoogleCodeExporter commented 9 years ago
Hey minas,

The junit dependency is unfortunately needed because the abstract testcase 
class is in src/main/java so that the jquery-ui project can use it also. AFAIK 
there is no other way...

I have made a backwards compatible dependency which simply references to the 
artifact wiquery-jquery-ui. In time ofcourse this dependency will be removed...

Original comment by hielke.hoeve on 11 May 2011 at 9:08

GoogleCodeExporter commented 9 years ago
Ah ok, I see... in this case just provide test-jar for wiquery-core and use it 
in tests with jquery-ui. Thats pretty simple and straight forward, without the 
need to have test-dependencies in releases. checkout this:

1. move class WiQueryTestCase from 'main' to 'test' folder
2. change scope for junit dependecy in wiquery-core to 'test'
3. provide a test-jar, insert in pom of wiquery-core:
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
4. to use wiquery-core test-jar for tests, insert in pom of wiquery-jquery-ui:
        <dependency>
            <groupId>org.odlabs.wiquery</groupId>
            <artifactId>wiquery-core</artifactId>
            <version>${project.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

... Now you can use test classes from wiquery-core in tests of 
wiquery-jquery-ui and releases does not have test dependencies anymore...

Original comment by minas.ma...@gmail.com on 11 May 2011 at 10:05

GoogleCodeExporter commented 9 years ago
Awsome, you are good with maven :) I will apply it now.

Original comment by hielke.hoeve on 11 May 2011 at 12:00

GoogleCodeExporter commented 9 years ago
Applied suggested fixes. I also added the snippit of step 3 to 
wiquery-jquery-ui so both projects deploy a test jar.

Original comment by hielke.hoeve on 11 May 2011 at 12:59

GoogleCodeExporter commented 9 years ago
Ok great! Thanks!

FYI: If you plan to deploy tests jar too, then you probably want also to deploy 
sources of it. you can do this with

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Thanks again
Minas

Side note: to eliminate fork warning during maven build caused by 
maven-source-plugin -> change goal from 'jar' to 'jar-no-fork' and 'test-jar' 
to 'test-jar-no-fork'

Original comment by minas.ma...@gmail.com on 11 May 2011 at 1:13

GoogleCodeExporter commented 9 years ago
Good job! config now looks good, simple and straight forward! Well done. :-)
Thanks
Minas.

Original comment by minas.ma...@gmail.com on 11 May 2011 at 1:26

GoogleCodeExporter commented 9 years ago
Ok i will add the test sources, why does the fork warning occur and what does 
it mean?

Original comment by hielke.hoeve on 11 May 2011 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 11 May 2011 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 11 May 2011 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 11 May 2011 at 7:13

GoogleCodeExporter commented 9 years ago
Minas,

There seems to be a problem with the poms to install the wiquery-core test jar. 
When removing all wiquery artifacts from my local repository the mvn clean 
install command does not install wiquery-core-test.jar, it does install 
wiquery-core-test-sources.jar though. I can't get my head around this.

I committed a change to the poms to hopefully get it working but my knowledge 
of maven is limited with this, perhaps I am overlooking something and I have no 
doubt overstated my desires in the poms.

Can you help please?

Original comment by hielke.hoeve on 12 May 2011 at 5:53

GoogleCodeExporter commented 9 years ago
hmm... I checked out rev 1003 (branches\wicket-1.5\) 
"mvn clean install" worked (with empty local repository). all jars installed...
do you still have the problem?

Original comment by minas.ma...@gmail.com on 12 May 2011 at 7:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
omg spend half an hour fiddling while it was the build command that was wrong. 
I did:
mvn clean install -Dmaven.test.skip=true

Thanks!!!!!

Original comment by hielke.hoeve on 12 May 2011 at 7:23