質問

I have imported my Maven config into BaseX but found no way to query it.

I want to query for repository of id="thirdparty-releases"

Neither of the following worked:

/settings/profiles/profile/repositories/repository[id="thirdparty-releases"]

db:open("settings","settings.xml")/settings/profiles/profile/repositories/repository[id="thirdparty-releases"]

My config follows:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>D:\Users\Dims\Design\!Lib\!m2\repository</localRepository>



  <pluginGroups>

  </pluginGroups>
  <proxies>
  </proxies>
  <servers>
  </servers>
  <mirrors>
  </mirrors>
  <profiles>
    <profile>
      <id>env-dev</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>jboss-public-repository-group</id>
          <name>JBoss Public Repository Group</name>
          <url>http://repository.jboss.org/nexus/content/groups/public/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>
        <repository>
          <id>thirdparty-releases</id>
          <name>JBoss Thirdparty Releases</name>
          <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
        </repository>
        <repository>
          <id>maven2-repository.dev.java.net</id>
          <name>Java.net Repository for Maven</name>
          <url>http://download.java.net/maven/2/</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
</settings>
役に立ちましたか?

解決

Your data has a different namespace (see xmlns in the <settings /> node). You either have to change the namespace in your query or you could also use the wildcard selector for querying, e.g. /*:settings/*:profiles/...

他のヒント

What do you mean by:

I want to query for repository of id="thirdparty-releases"

Because that seems more like a maven question to me...?


BaseX itself, as I'm sure you're aware, is a stand-alone database. If you only need to query existing data there's no need to even use a JDK, although, as BaseX is a Java app, you will need a JVM -- so maven doesn't really enter the picture.

It has a GUI and is quite easy to get started with.

If you also want to run commands from a Java program then you can always look at the github examples or reference the Javadoc on available commands.

Of course, there are many BaseX questions on stackoverflow, over three hundred currently, and for [basex] [java] I see nearly fifty results. There's an excellent mailing list where the main developer is quite available and helpful, as well as everyone else on the list.

Admittedly, I don't understand your question. Why would you import your maven config into BaseX?

If you're just looking to run xpath or xquery on a database, my suggestion would be to use the GUI.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top