Java 如何使用Maven导入Confluence API?

Java 如何使用Maven导入Confluence API?,java,maven,pom.xml,Java,Maven,Pom.xml,我需要使用Confluence API 我使用Maven POM,但找不到如何插入Confluence API的依赖项 你能帮我吗 我已经尝试过的: 我需要与primaly合作。 我找到了关于管理pom的教程。因此,在本教程之后,我的pom如下所示: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLo

我需要使用Confluence API

我使用Maven POM,但找不到如何插入Confluence API的依赖项

你能帮我吗

我已经尝试过的:
我需要与primaly合作。
我找到了关于管理pom的教程。因此,在本教程之后,我的pom如下所示:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>***.createspace</groupId>
    <artifactId>CreateSpace</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>CreateSpace</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-confluence-plugin</artifactId>
                <version>3.2.3</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${product.version}</productVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>    <!-- important! -->
        </dependency>
    </dependencies>
</project>

你能帮我吗?或者请告诉我我应该添加什么来避免被否决票,然后我希望你看到我真的在网上搜索,需要帮助

我不确定您正在使用的Confluence API实现。你可以试试这个:

<dependency>
  <groupId>org.jvnet.hudson</groupId>
  <artifactId>confluence-api</artifactId>
  <version>1.0</version>
</dependency>

org.jvnet.hudson
汇合api
1

如果您使用的实现不支持maven版本,那么您必须自己添加可传递的依赖项。

有关于如何使用atlassian maven repo的说明,并提供了repo URL:


此配置适用于5.2版,java代码中可以访问
SpaceManager
类。

在本例中,confluent.version为3.0.0

    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>common-config</artifactId>
        <version>${confluent.version}</version>
    </dependency>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>common-utils</artifactId>
        <version>${confluent.version}</version>
    </dependency>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-schema-registry-client</artifactId>
        <version>${confluent.version}</version>
    </dependency>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-avro-serializer</artifactId>
        <version>${confluent.version}</version>
    </dependency>

合流的
公共配置
${confluent.version}
合流的
公用公用事业
${confluent.version}
合流的
卡夫卡模式注册表客户端
${confluent.version}
合流的
卡夫卡avro序列化程序
${confluent.version}

这个?找到你需要的api并将依赖项添加到pom中。你甚至试过用谷歌搜索它吗?@Zilvinas:是的!但是他们只写了一些关于SDK的东西来下载,但是我不能安装一些东西。在我发现的任何一个教程中,都没有关于使用mavenSo设置confluence atlassian的内容,您已经将confluence依赖项标记为提供的。在类路径中有jar吗?SpaceManager类是该依赖项的一部分,还是在maven插件中定义的?另外,要明确的是,即使使用maven,您仍然在下载所需的SDK库。他们只是住在你当地的maven仓库里。在任何情况下,正如我上面所说的,如果您想使用现有的jar,您必须下载jar并将其放在类路径上。谢谢您的回答。可悲的是,当我把它插入我的pom时,什么都没有发生。。。我不知道这是错的还是我需要一些额外的东西。我真的对atlassian的文档感到困惑…请看一下我的编辑,mybe它可以帮助你更好地理解我的问题betterI在我的pom中准确地添加了这一点。但是什么也没发生。它总是说它无法解决
com.atlassian.confluence.spaces.SpaceManager
…请查看我的编辑,mybe它可以帮助您更好地理解我的问题,因为您已将依赖项设置为“提供”,而我看不到“confluence.version”的值,所以我无法告诉您任何信息,但确实包含此类。因此,如果您按照我解释的方式进行配置,那么您现在应该可以在使用5.2版时看到jar了,先生,您是我那个时代的英雄。它工作得很好。非常感谢。
<!-- language: xml -->
<repository>
  <id>atlassian-public</id>
  <url>https://maven.atlassian.com/repository/public</url>
  <snapshots>
    <enabled>true</enabled>
    <updatePolicy>never</updatePolicy>
    <checksumPolicy>warn</checksumPolicy>
  </snapshots>
   <releases>
     <enabled>true</enabled>
     <checksumPolicy>warn</checksumPolicy>
  </releases>
</repository>
<!-- language: xml -->
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence</artifactId>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.vilutis.lt</groupId>
    <artifactId>confluence-plugin</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>confluence-plugin</name>

    <repositories>
        <repository>
            <id>atlassian-public</id>
            <url>https://maven.atlassian.com/repository/public</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
        </repository>
    </repositories>

    <!-- I had to add this section because activation-1.0.2.jar does not exist in public maven repo -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
                <version>1.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>5.2</version>
        </dependency>
    </dependencies>
</project>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>common-config</artifactId>
        <version>${confluent.version}</version>
    </dependency>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>common-utils</artifactId>
        <version>${confluent.version}</version>
    </dependency>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-schema-registry-client</artifactId>
        <version>${confluent.version}</version>
    </dependency>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-avro-serializer</artifactId>
        <version>${confluent.version}</version>
    </dependency>