You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jörn Gebhardt <Jo...@ptv.de> on 2004/03/17 15:29:40 UTC

Including dependencies from external file

Hi,

we encounter the following very strange problem that occurs only under
Windows XP:

We have a project.xml that looks like this:

  <?xml version="1.0"?>

  <!DOCTYPE dependencies [
    <!ENTITY ProductDependencies SYSTEM "../product-dep.xml">
  ]>

  <project
      xmlns:j="jelly:core">
  ...
      <dependencies>
          <!-- insert dependencies from ../product-dep.xml file -->
          &ProductDependencies;
  ...
     </dependencies>
  ...
  </project>

I.e. we want to include some entries in the dependencies section from
another file. As this works perfectly fine under Windows 2000 and Windows NT
it causes the following problem under Windows XP:

java.net.UnknownHostException:
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:153)
        at java.net.Socket.connect(Socket.java:452)
        at java.net.Socket.connect(Socket.java:402)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
        at sun.net.NetworkClient.openServer(NetworkClient.java:118)
        at sun.net.ftp.FtpClient.openServer(FtpClient.java:423)
        at sun.net.ftp.FtpClient.<init>(FtpClient.java:692)
        at
sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
va:175)
        at
sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
tion.java:257)
        at java.net.URL.openStream(URL.java:913)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown So
urce)
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
Source)
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityRefer
ence(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1527)
        at org.apache.maven.MavenUtils.getProject(MavenUtils.java:201)
        at org.apache.maven.MavenUtils.getProject(MavenUtils.java:161)
        at
org.apache.maven.MavenSession.initializeRootProject(MavenSession.java
:324)
        at org.apache.maven.MavenSession.initialize(MavenSession.java:234)
        at org.apache.maven.cli.App.doMain(App.java:532)
        at org.apache.maven.cli.App.main(App.java:1109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)


For some strange reasons Xerces tries to open a FTP connection under XP
instead of just reading the file. Has anybody an idea what is going on here
and why this problem occurs only under Windows XP? I've consulted already
the Xerces mailing list, but got no answers. 
Or are there any other ways to include the same set of dependencies in
multiple POMs without using inheritance?

Thanks in advance,
Joern

Re: Including dependencies from external file

Posted by Gilles Dodinet <rh...@free.fr>.
Joern, 

we use something like that to include external xml fragments : 

<!ENTITY inherited-dependencies SYSTEM
"file:../mevenide-ui-eclipse/pom-fragments/inherited-dependencies.xml">

it works under xp and linux.

-- gd


Quoting Jörn Gebhardt <Jo...@ptv.de>:

> Hi,
> 
> we encounter the following very strange problem that occurs only under
> Windows XP:
> 
> We have a project.xml that looks like this:
> 
>   <?xml version="1.0"?>
> 
>   <!DOCTYPE dependencies [
>     <!ENTITY ProductDependencies SYSTEM "../product-dep.xml">
>   ]>
> 
>   <project
>       xmlns:j="jelly:core">
>   ...
>       <dependencies>
>           <!-- insert dependencies from ../product-dep.xml file -->
>           &ProductDependencies;
>   ...
>      </dependencies>
>   ...
>   </project>
> 
> I.e. we want to include some entries in the dependencies section from
> another file. As this works perfectly fine under Windows 2000 and Windows NT
> it causes the following problem under Windows XP:
> 
> java.net.UnknownHostException:
> 
> 
> For some strange reasons Xerces tries to open a FTP connection under XP
> instead of just reading the file. Has anybody an idea what is going on here
> and why this problem occurs only under Windows XP? I've consulted already
> the Xerces mailing list, but got no answers. 
> Or are there any other ways to include the same set of dependencies in
> multiple POMs without using inheritance?
> 
> Thanks in advance,
> Joern
> 



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