小编asm*_*ean的帖子

常春藤:使用分类器从maven安装

我正在尝试常春藤:从maven安装jogl和gluegen到我当地的存放处.我无法正确安装本机依赖项.

我的ivysettings是

<ivysettings>
    <settings defaultResolver="central"
            defaultConflictManager="all"
    />
    <caches defaultCacheDir="${ivy.cache.dir}"
            artifactPattern="[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]" 
    />
    <resolvers>
        <ibiblio name="central" m2compatible="true"
                 pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
        />
        <filesystem name="depository">
            <ivy pattern="${dest.repo.dir}/[organisation]/[module]/ivys/ivy-[revision](-[classifier]).xml" />
            <artifact pattern="${dest.repo.dir}/[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]" />
        </filesystem>
    </resolvers>
</ivysettings>
Run Code Online (Sandbox Code Playgroud)

我的安装目标是

<ivy:install settingsRef="ivy.settings" 
    organisation="org.jogamp.jogl" module="jogl-all-main" revision="2.1.5-01"
    from="${from.resolver}" to="${to.resolver}" transitive="true" overwrite="true" />
Run Code Online (Sandbox Code Playgroud)

其中from.resolver central和to.resolver是depository.

分类器例如是native-windows-i586,native-linux-armv6等.有问题的pom文件位于http://repo1.maven.org/maven2/org/jogamp/jogl/jogl-all-main/ 2.1.5-01/JOGL-所有主2.1.5-01.pom

我正确地解决了jogl-all-main.解析依赖关系后,只解析pom文件中的最后一个,即jogl-all-2.1.5-01-natives-windows-i586.jar.有没有办法使用常春藤:安装任务从maven中央存储库安装到我的本地存储库?

java jogl ivy maven

6
推荐指数
1
解决办法
3530
查看次数

具有多态性的方法链 C++

是否可以编写返回派生类型的流畅的处理方法?考虑以下两个类:

class Base {
protected:
    std::string mFoo;
public:
    Base& withFoo(std::string foo) {
        mFoo = foo;
        return *this;
    }
};

class Derived : public Base {
protected:
    std::string mBar;
public:
    Derived& withBar(std::string bar) {
        mBar = bar;
        return *this;
    }

    void doOutput() {
        std::cout << "Foo is " <<
            mFoo << ".  Bar is " <<
            mBar << "." << std::endl;
    }
};
Run Code Online (Sandbox Code Playgroud)

然后我想构建我的对象并像这样使用它:

Derived d;
d.withFoo("foo").withBar("bar").doOutput();
Run Code Online (Sandbox Code Playgroud)

这当然会失败,因为withFoo返回一个Base. 由于我的所有with方法都只是设置成员变量,因此我可以首先指定派生的withs。问题是我的构建器方法(doOutput在上面的示例中)需要是一个单独的语句。

Derived d; …
Run Code Online (Sandbox Code Playgroud)

c++ polymorphism fluent

3
推荐指数
1
解决办法
1314
查看次数

标签 统计

c++ ×1

fluent ×1

ivy ×1

java ×1

jogl ×1

maven ×1

polymorphism ×1