Vincent Massol wrote:
> On Jan 11, 2009, at 3:54 PM, Marius Dumitru Florea wrote:
>
>> Vincent Massol wrote:
>>> On Jan 11, 2009, at 12:52 PM, Anca Paula Luca wrote:
>>>
>>>> Marius Dumitru Florea wrote:
>>>>> Hi Vincent,
>>>>>
>>>>> vmassol (SVN) wrote:
>>>>>> Author: vmassol
>>>>>> Date: 2009-01-10 20:34:28 +0100 (Sat, 10 Jan 2009)
>>>>>> New Revision: 15295
>>>>>>
>>>>>> Modified:
>>>>>> platform/web/trunk/wysiwyg/pom.xml
>>>>>> Log:
>>>>>> Removing what seems to be unneeded stuff...
>>>>> On what basis?.. Both gwt-dev and gwt-dev-libs are needed, first
>>>>> because
>>>>> they contain the GWT compiler and second because they are
>>>>> required by
>>>>> the hosted browser when running and debugging the WYSIWYG in hosted
>>>>> mode. Then gwt-dev-libs needs to be unpacked. Have you tried to
>>>>> build
>>>>> the WYSIWYG with a fresh m2 repo after this change?
>>>> Fresh repo build passes, I deleted all the gwt-dev related entries
>>>> in the repo
>>>> and ran it. The hosted mode run will not work any longer since it
>>>> needs some
>>>> libraries unpacked from the zip (that is debug + tests, if we ran
>>>> any).
>>>>
>>>> Since we don't do any hosted mode runs at build time, it's arguable
>>>> if we need
>>>> this setup in the pom in the default profile or not, but since debug
>>>> is needed
>>>> quite often and all debug related files and setups are committed,
>>>> I'd say we
>>>> keep this one too, and use maven magic to remove it from the default
>>>> build.
>>> Note also that it wasn't working under Eclipse.
>> It has nothing to do with Eclipse.
>
> It has to do with m2eclipse (The maven embedder to be precise).
> settings.localRepository is not resolved so whenever I use Eclipse
> (with m2eclipse) I get a ${settings.localRepository} created.
> Since I kept getting this and since it was still working I assumed
> there was a problem in the build and removed it.
Yes, I've seen the ${settings.localRepository} directory a few times but
since building from command line worked fine I did not investigate to
see why it was created. I agree we have to find a way to avoid its creation.
>
>> The hosted browser provided by GWT
>> looks for needed libraries in m2 repo where gwt-dev-libs was unpacked.
>> Now I can't run the WYSIWYG in hosted mode on a fresh repo:
>>
>> mar...@midnight:~/work/eclipse/enterprise/distribution/jetty/hsqldb/
>> target/xwiki-enterprise-jetty-hsqldb-1.8-SNAPSHOT$
>> ./start_wysiwyg_noserver.sh
>> Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load
>> library:
>> /home/marius/.m2/repository/com/google/gwt/gwt-dev/1.5.3/libswt-pi-
>> gtk-3235.so
>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
>> at java.lang.Runtime.load0(Runtime.java:769)
>> at java.lang.System.load(System.java:968)
>> at org.eclipse.swt.internal.Library.loadLibrary(Library.java:132)
>> at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
>> at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
>> at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
>> at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
>> at com.google.gwt.dev.GWTShell.<clinit>(GWTShell.java:301)
>>
>> Was the previous pom causing any problems? If so, were those problems
>> blocking you that you couldn't wait till Monday to ask the person who
>> wrote the pom?
>
> Cool down Marius. We're all in the same boat. I was trying to fix
> something for you and do your work so I was doing you a favor. In my
> free time and during my weekend! :)
>
> Now I have no idea what hosted mode is. I only verified that the build
> kept working and it did so I was happy. Till I received your email
> this morning.
>
> If it's needed for that hosted mode then it needs to be added back for
> that hosted mode. As Anca said, this should be done in a profile since
> we probably don't want to lengthen the build (the download + the unzip
> every time) for all people not using that hosted mode.
The download and unzip happens once for each version of GWT. Since they
don't release that often it doesn't slow down the build. I agree it's
cleaner to have a separate profile though, since, for instance, Hudson
doesn't need these additional libraries.
>
> Note that it's a bad practice to unpack something in the local
> repository as it was done. The local repo should never be corrupted. I
> see it's in the instructions you gave but it doesn't make it better.
I know and I didn't liked it either. Sergiu also noticed this some time ago.
> Do you know why they're doing it this way? I guess what they want to
> do is unzip and install locally the files in the repo so that they can
> be used as dependencies of the maven gwt plugin is that it? If so we
> should probably use the install plugin
> (http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
> ).
On linux (I don't know about the other operating systems) the hosted
browser (the one running Java code instead of JavaScript) needs some
libraries (like libswt-pi-gtk-3235.so). The problem is that it looks for
them relative to the location of gwt-dev jar. I guess the code for the
browser is inside gwt-dev and since they didn't include the libraries in
the jar they are looking for them in the same directory.
Prior to GWT 1.5.2 we were downloading these libraries in the JAVA_TMP
directory (if I remember well; anyway, it was outside of the m2 repo).
To be able to run the editor in hosted mode the only solution I found
(and I did search a while) was to use the system scope for the gwt-dev jar:
<!-- We load this library this way because GWT looks for SWT libraries
in the same folder -->
<!--
<scope>system</scope>
<systemPath>JAVA_TMP/path/gwt-dev.jar</systemPath>
-->
This way the gwt-dev jar was in the same place with the SWT libraries
(the big zip we were downloading contained both gwt-dev and SWT libraries).
With the upgrade to GWT 1.5.2 the SWT libraries have been moved inside
gwt-dev-libs which is now downloaded and unzip inside the m2 repo.
So we either use the m2 repo or the system scope. Either way the gwt-dev
jar needs to be in the same place with the SWT libraries. If you look in
the previous pom, the system scope part was commented out.
>
> In any case I'm +1 to revert what I did (since I know now it's used
> for that hosted mode) but to put it in a hosted mode profile. Is that
> ok?
Ok
>
> Can you give more info on how you run that hosted mode? Also how do we
Hosted mode means running Java code instead of the compiled JavaScript
code. It saves you the time (around 2 minutes for the WYSIWYG) needed to
compile your Java code in JavaScript. It also allows you to debug the
Java code using your favorite IDE as you would with any regular Java code.
You can find in src/test/resources the scripts needed to run or debug
the editor in hosted mode. Both scripts need a server running: that's
XE. You have to copy the scripts where the start_xwiki* scripts are, in
the base XE directory. First start XE then run one of these two scripts.
They will open the standalone editor (Wysiwyg.html) in the hosted browser.
> currently differentiate hosted mode and not hosted mode when we run
> XE? Does that hosted mode means we get some jars or source files in
> XE's WEB-INF/lib that shouldn't be there? If so we need to use a
> profile so that they don't get there by error.
If you use Firefox to edit a page then you are in web mode. You have to
run start_wysiwyg* to open the hosted browser, which is a different
application meant only for developers.
In order to run the editor in hosted mode we need to have the source
files in the class path. In the start_wysiwyg* script the path to the
editor sources jar points to the XE's WEB-INF/lib directory but we can
change the path to point to the m2 repo if it's really needed. Other
than that XE doesn't hold any dependencies of the hosted browser.
>
> Thanks
> -Vincent
>
>>>>> See
>>>>> http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/setup.html
>>>>>
>>>>> We have to revert.
>>>>>
>>>>>> Modified: platform/web/trunk/wysiwyg/pom.xml
>>>>>> =
>>>>>> ==================================================================
>>>>>> --- platform/web/trunk/wysiwyg/pom.xml 2009-01-10 18:53:52 UTC
>>>>>> (rev 15294)
>>>>>> +++ platform/web/trunk/wysiwyg/pom.xml 2009-01-10 19:34:28 UTC
>>>>>> (rev 15295)
>>>>>> @@ -8,7 +8,7 @@
>>>>>> <artifactId>xwiki-web-wysiwyg</artifactId>
>>>>>> <name>XWiki Platform - Web - WYSIWYG</name>
>>>>>> <packaging>war</packaging>
>>>>>> - <description>XWiki's What You See Is What You Get editor</
>>>>>> description>
>>>>>> + <description>XWiki's GWT WYSIWYG editor</description>
>>>>>> <dependencies>
>>>>>> <dependency>
>>>>>> <groupId>com.google.gwt</groupId>
>>>>>> @@ -27,21 +27,8 @@
>>>>>> <groupId>com.google.gwt</groupId>
>>>>>> <artifactId>gwt-dev</artifactId>
>>>>>> <version>${gwtVersion}</version>
>>>>>> - <classifier>${platform}-libs</classifier>
>>>>>> - <type>zip</type>
>>>>>> - <scope>provided</scope>
>>>>>> - </dependency>
>>>>>> - <dependency>
>>>>>> - <groupId>com.google.gwt</groupId>
>>>>>> - <artifactId>gwt-dev</artifactId>
>>>>>> - <version>${gwtVersion}</version>
>>>>>> <classifier>${platform}</classifier>
>>>>>> <scope>provided</scope>
>>>>>> - <!-- We load this library this way because GWT looks for
>>>>>> SWT libraries in the same folder -->
>>>>>> - <!--
>>>>>> - <scope>system</scope>
>>>>>> - <systemPath>${settings.localRepository}/com/google/gwt/
>>>>>> gwt-dev/${gwtVersion}/gwt-dev-${platform}.jar</systemPath>
>>>>>> - -->
>>>>>> </dependency>
>>>>>> <dependency>
>>>>>> <groupId>com.google.gwt</groupId>
>>>>>> @@ -116,35 +103,8 @@
>>>>>> </dependencies>
>>>>>> <build>
>>>>>> <plugins>
>>>>>> - <!-- Download and unpack the GWT libs -->
>>>>>> <plugin>
>>>>>> <groupId>org.apache.maven.plugins</groupId>
>>>>>> - <artifactId>maven-dependency-plugin</artifactId>
>>>>>> - <executions>
>>>>>> - <execution>
>>>>>> - <id>unzip-gwt-libs</id>
>>>>>> - <phase>compile</phase>
>>>>>> - <goals>
>>>>>> - <goal>unpack</goal>
>>>>>> - </goals>
>>>>>> - <configuration>
>>>>>> - <artifactItems>
>>>>>> - <artifactItem>
>>>>>> - <groupId>com.google.gwt</groupId>
>>>>>> - <artifactId>gwt-dev</artifactId>
>>>>>> - <version>${gwtVersion}</version>
>>>>>> - <classifier>${platform}-libs</classifier>
>>>>>> - <type>zip</type>
>>>>>> - <overWrite>false</overWrite>
>>>>>> - </artifactItem>
>>>>>> - </artifactItems>
>>>>>> - <outputDirectory>${settings.localRepository}/com/
>>>>>> google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
>>>>>> - </configuration>
>>>>>> - </execution>
>>>>>> - </executions>
>>>>>> - </plugin>
>>>>>> - <plugin>
>>>>>> - <groupId>org.apache.maven.plugins</groupId>
>>>>>> <artifactId>maven-compiler-plugin</artifactId>
>>>>>> <executions>
>>>>>> <execution>
>>>>>> @@ -287,12 +247,6 @@
>>>>>> </properties>
>>>>>> </profile>
>>>>>> </profiles>
>>>>>> - <repositories>
>>>>>> - <repository>
>>>>>> - <id>ibiblio</id>
>>>>>> - <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
>>>>>> - </repository>
>>>>>> - </repositories>
>>>>>> <pluginRepositories>
>>>>>> <pluginRepository>
>>>>>> <id>gwt-maven</id>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs