You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Dalibor Topic <ro...@kaffe.org> on 2004/01/22 14:24:36 UTC

Building maven CVS under free runtimes (kaffe): Breaks during compilation

Hi all,

I'm a kaffe developer currently discovering the wonderful world of maven 
;) It seems like a very nice tool to me, and the kaffe project uses it 
for managing the docbook documentation. Maven 1.0 rc1 doesn't run out of 
the box with kaffe (yet), but with a small patch to maven [1], and a few 
patches to kaffe's latest CVS it's possible to get quite far [2].

Encouraged by this, I tried to build maven's latest CVS with kaffe, and 
again, I got quite far with maven jar. Unfortunately, the compilation 
doesn't succeed:

bash-2.05a$ MAVEN_OPTS=-Dbuild.compiler=kjc maven jar
  __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc1-SNAPSHOT

java:prepare-filesystem:

java:compile:
     [echo] Compiling to /tmp/topic/maven/target/classes
     [javac] Compiling 93 source files to /tmp/topic/maven/target/classes
/tmp/topic/maven/src/java/org/apache/maven/util/HttpUtils.java:244: 
error:Cannot find type "sun/misc/BASE64Encoder"

BUILD FAILED

Since no good code uses sun internal classes, I'm sure it would be 
possible to remove the reference to "sun/misc/BASE64Encoder", in order 
to make it compile on free runtimes, as well.

I believe ant had a similar problem, and it was fixed by using 
reflection. Of course, putting

              sun.misc.BASE64Encoder encoder =
                     (sun.misc.BASE64Encoder) Class.forName(
                         "sun.misc.BASE64Encoder" ).newInstance();

straight in the code, makes the point of using reflection quite moot ;)

cheers,
dalibor topic

[1] Remove the unmecessary tools.jar entry in forehead.conf
[2] http://www.kaffe.org/~robilad/mavenized-kaffe-website.png
maven jar works fine. maven site:generate breaks due to some code using 
some unportable (i.e. sun internal) classes.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Building maven CVS under free runtimes (kaffe): Breaks during compilation

Posted by Dalibor Topic <ro...@kaffe.org>.
Hi Ryan,

Ryan Hoegg wrote:
> http://jakarta.apache.org/commons/codec
> 
> The Jakarta Commons Codec project has a Base64 implementation that is 
> being used in Apache XML-RPC and the Jakarta Commons HttpClient.

Please try (and apply ;) the attached patch for making Maven's CVS head 
build on a free runtime (i.e Kaffe[1]) with Maven 1.0-rc1.

2004-01-22  Dalibor Topic <ro...@kaffe.org>

	* project.xml:
	Added dependency on commons-codec

	* src/java/org/apache/maven/util/HttpUtils.java:
	Use Base64 encoder from Jakarta Commons-Codec.


with the attached patch, maven's CVS builds fine with kaffe. You need to 
set the build compiler to kaffe's kjc compiler, though.

MAVEN_OPTS=-Dbuild.compiler=kjc maven jar

I eventually end up having other problems, the regression tests for 
touchstone fail with:


BUILD FAILED
File...... file:/tmp/topic/maven/
Element... maven:maven
Line...... 41
Column.... 9
Unable to obtain goal [touchstone-tests] -- 
file:/tmp/topic/maven/src/test/touchstone-build/:72:24: <fail> Goal 
should be used from the touchstone plugin. We have an internal
         error processing goals.
Total time: 12 minutes 31 seconds
Finished at: Thu Jan 22 18:37:09 GMT+01:00 2004

which may or not may be a maven/kaffe problem.

cheers,
dalibor topic

[1] http://www.kaffe.org , current CVS head ;)

Re: Building maven CVS under free runtimes (kaffe): Breaks during compilation

Posted by Ryan Hoegg <rh...@isisnetworks.net>.
http://jakarta.apache.org/commons/codec

The Jakarta Commons Codec project has a Base64 implementation that is 
being used in Apache XML-RPC and the Jakarta Commons HttpClient.

--
Ryan Hoegg
ISIS Networks
http://www.isisnetworks.net

Eric Pugh wrote:

>Do you  have a patch/suggested class to use?  It seems like here:
>String encoding = null;
>            // check to see if sun's Base64 encoder is available.
>            try
>            {
>                sun.misc.BASE64Encoder encoder =
>                    (sun.misc.BASE64Encoder) Class.forName(
>                        "sun.misc.BASE64Encoder" ).newInstance();
>
>                encoding = encoder.encode( up.getBytes() );
>            }
>            catch ( Exception ex )
>            {
>                // Do nothing, as for MavenSession we will never use
>                // auth and we will eventually move over httpclient
>                // in the commons.
>            }
>            connection.setRequestProperty( "Authorization", "Basic " +
>encoding );
>        }
>
>We could use this:
>http://jakarta.apache.org/commons/codec/apidocs/org/apache/commons/codec/bin
>ary/Base64.html
>
>Do you want to try it out and submit a patch to use this?
>
>Eric
>
>  
>
>>-----Original Message-----
>>From: Dalibor Topic [mailto:robilad@kaffe.org]
>>Sent: Thursday, January 22, 2004 2:25 PM
>>To: dev@maven.apache.org; Jim Pick
>>Subject: Building maven CVS under free runtimes (kaffe): Breaks during
>>compilation
>>
>>
>>Hi all,
>>
>>I'm a kaffe developer currently discovering the wonderful
>>world of maven
>>;) It seems like a very nice tool to me, and the kaffe
>>project uses it
>>for managing the docbook documentation. Maven 1.0 rc1 doesn't
>>run out of
>>the box with kaffe (yet), but with a small patch to maven
>>[1], and a few
>>patches to kaffe's latest CVS it's possible to get quite far [2].
>>
>>Encouraged by this, I tried to build maven's latest CVS with
>>kaffe, and
>>again, I got quite far with maven jar. Unfortunately, the compilation
>>doesn't succeed:
>>
>>bash-2.05a$ MAVEN_OPTS=-Dbuild.compiler=kjc maven jar
>>  __  __
>>|  \/  |__ _Apache__ ___
>>| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
>>|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc1-SNAPSHOT
>>
>>java:prepare-filesystem:
>>
>>java:compile:
>>     [echo] Compiling to /tmp/topic/maven/target/classes
>>     [javac] Compiling 93 source files to
>>/tmp/topic/maven/target/classes
>>/tmp/topic/maven/src/java/org/apache/maven/util/HttpUtils.java:244:
>>error:Cannot find type "sun/misc/BASE64Encoder"
>>
>>BUILD FAILED
>>
>>Since no good code uses sun internal classes, I'm sure it would be
>>possible to remove the reference to "sun/misc/BASE64Encoder",
>>in order
>>to make it compile on free runtimes, as well.
>>
>>I believe ant had a similar problem, and it was fixed by using
>>reflection. Of course, putting
>>
>>              sun.misc.BASE64Encoder encoder =
>>                     (sun.misc.BASE64Encoder) Class.forName(
>>                         "sun.misc.BASE64Encoder" ).newInstance();
>>
>>straight in the code, makes the point of using reflection
>>quite moot ;)
>>
>>cheers,
>>dalibor topic
>>
>>[1] Remove the unmecessary tools.jar entry in forehead.conf
>>[2] http://www.kaffe.org/~robilad/mavenized-kaffe-website.png
>>maven jar works fine. maven site:generate breaks due to some
>>code using
>>some unportable (i.e. sun internal) classes.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: Building maven CVS under free runtimes (kaffe): Breaks during compilation

Posted by Eric Pugh <ep...@upstate.com>.
Do you  have a patch/suggested class to use?  It seems like here:
String encoding = null;
            // check to see if sun's Base64 encoder is available.
            try
            {
                sun.misc.BASE64Encoder encoder =
                    (sun.misc.BASE64Encoder) Class.forName(
                        "sun.misc.BASE64Encoder" ).newInstance();

                encoding = encoder.encode( up.getBytes() );
            }
            catch ( Exception ex )
            {
                // Do nothing, as for MavenSession we will never use
                // auth and we will eventually move over httpclient
                // in the commons.
            }
            connection.setRequestProperty( "Authorization", "Basic " +
encoding );
        }

We could use this:
http://jakarta.apache.org/commons/codec/apidocs/org/apache/commons/codec/bin
ary/Base64.html

Do you want to try it out and submit a patch to use this?

Eric

> -----Original Message-----
> From: Dalibor Topic [mailto:robilad@kaffe.org]
> Sent: Thursday, January 22, 2004 2:25 PM
> To: dev@maven.apache.org; Jim Pick
> Subject: Building maven CVS under free runtimes (kaffe): Breaks during
> compilation
>
>
> Hi all,
>
> I'm a kaffe developer currently discovering the wonderful
> world of maven
> ;) It seems like a very nice tool to me, and the kaffe
> project uses it
> for managing the docbook documentation. Maven 1.0 rc1 doesn't
> run out of
> the box with kaffe (yet), but with a small patch to maven
> [1], and a few
> patches to kaffe's latest CVS it's possible to get quite far [2].
>
> Encouraged by this, I tried to build maven's latest CVS with
> kaffe, and
> again, I got quite far with maven jar. Unfortunately, the compilation
> doesn't succeed:
>
> bash-2.05a$ MAVEN_OPTS=-Dbuild.compiler=kjc maven jar
>   __  __
> |  \/  |__ _Apache__ ___
> | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
> |_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc1-SNAPSHOT
>
> java:prepare-filesystem:
>
> java:compile:
>      [echo] Compiling to /tmp/topic/maven/target/classes
>      [javac] Compiling 93 source files to
> /tmp/topic/maven/target/classes
> /tmp/topic/maven/src/java/org/apache/maven/util/HttpUtils.java:244:
> error:Cannot find type "sun/misc/BASE64Encoder"
>
> BUILD FAILED
>
> Since no good code uses sun internal classes, I'm sure it would be
> possible to remove the reference to "sun/misc/BASE64Encoder",
> in order
> to make it compile on free runtimes, as well.
>
> I believe ant had a similar problem, and it was fixed by using
> reflection. Of course, putting
>
>               sun.misc.BASE64Encoder encoder =
>                      (sun.misc.BASE64Encoder) Class.forName(
>                          "sun.misc.BASE64Encoder" ).newInstance();
>
> straight in the code, makes the point of using reflection
> quite moot ;)
>
> cheers,
> dalibor topic
>
> [1] Remove the unmecessary tools.jar entry in forehead.conf
> [2] http://www.kaffe.org/~robilad/mavenized-kaffe-website.png
> maven jar works fine. maven site:generate breaks due to some
> code using
> some unportable (i.e. sun internal) classes.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org