Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Upload neo-devpack-java jar artifact to central maven repository #8

Closed
peterszatmary opened this issue Oct 12, 2017 · 5 comments
Closed
Assignees

Comments

@peterszatmary
Copy link
Contributor

Hello,

We need upload neo-devpack-java jar artifact to maven central repository. Tutorial page how to achieve it is here.

After that we can write smart contracts with just maven pom dependency and not add it manualy to classpath like we do right now. It is easier and standard way for Java developers.

Example of one smart contract pom.xml

<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.learning.neo</groupId>
    <artifactId>hello-world-smart-contract</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>My first smart contract</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
    </properties>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

  <dependencies>
        <dependency>
            <groupId>org.neo.smartcontract.framework</groupId>
            <artifactId>neo-devpack-java</artifactId>
            <version>2.3.0</version>
        </dependency>
    </dependencies>
</project>

I can do it if you agree with it. And after that i will start contribute examples to neo-project/examples-java project.

@fabwa
Copy link

fabwa commented Oct 15, 2017

For now, we could host our own maven repo as for public ones we should have more documentation done. For those looking for .jar can find 2.3.0 in fork

@peterszatmary
Copy link
Contributor Author

This issue is not just about using remote repo but also mavenizing the smart contracts. the second part your solution doesnt have. if we cannot use maven central repo right now than we can definitely use github as repo in maven style ( let maven download jar from github ).

@peterszatmary
Copy link
Contributor Author

peterszatmary commented Mar 8, 2018

Hi guys

i did several necessary changes in pom.xml as prepration for uploading the jar to maven central repository. Here is the pull request

I followed instructions on official maven sites and made JIRA ticket OSSRH-38312 for us to have first neo-devpack-java in central maven repository.

After that we can make release page on Github. Change artifact version to +1 (2.3.1) and start to use SNAPSHOT postfix to separate versions that are / are not already deployed in maven repo.

@peterszatmary
Copy link
Contributor Author

Hello,

today i made some final changes to pom.xml in
pull request 17. With this configuration i succesfully deployed first deo-devpack-java to maven repo. See please
search.maven.org , issue OSSRH-38312. From my perspective after merging mentioned pull request we can close this ticket.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@fabwa @peterszatmary and others