JSPM

jar2proxy-alpha

1.0.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4
    • Score
      100M100P100Q25561F
    • License MIT

    transfer java facade with jar to js

    Package Exports

    • jar2proxy-alpha/lib/jar2proxy

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jar2proxy-alpha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    jar2proxy

    Developer tool for egg-sofa-rpc, You can easily use this tool to convert Java interface definitions into egg executable code.


    Environmental requirements

    • jdk 1.8
    • node >= 8

    useage

    config config/proxy.js

    • eggFramework If you need to resolve the proxy configuration that is dependent on the plugin at the same time, otherwise skip. If the framework you are using is based on egg for secondary encapsulation, then configure the real name of the framework you use here. The default value is egg.
    • directoryToJar Store the file directory for jar and resources.jar, default value is ${app.root}/libs
    • mavenRepository Specify the maven repository url. Format reference path/to/maven/conf/settings.xml#profile.repository.url, like https://repo.maven.apache.org/maven2/.

    The directoryToJar and mavenRepository are used together, starting from the specified file directoryfirst, and then finding from mavenRepository if not found (if mavenRepository is specified)

    At least one directoryToJar or mavenRepository exists.

    The jar package must contain binary and source packages

    For example, the following configuration will try to find 2 jar packages jar2proxy-facade.jar and jar2proxy-facade-sources.jar.

    config package.json

    "scripts": {
      "jar2proxy": "egg-bin jar2proxy"
    },

    run command

    $ npm run jar2proxy

    output files

    • app/proxy/userFacade.js The name of the configuration will be processed by default into a camel format. You can read the interface definition and find the class definition details from the app/proxy_class.
    • app/proxy_class/index.js When load for the first time, all class definitions will be merged into one file. This file is only used for egg-rpc.
    • app/proxy_class/com/ali/jar2proxy/normal/enums/xx.js
    • app/proxy_class/com/ali/jar2proxy/normal/model/yy.js
    const path = require('path');
    
    module.exports = {
      eggFramework: 'egg',
      directoryToJar: path.join(__dirname, '../libs'),
      mavenRepository: null,
      group: 'SOFA',
      services: [
        {
          appName: 'jar2proxy',
          api: {
            UserFacade: 'com.ali.jar2proxy.normal.facade.UserFacade',
          },
          dependency: [
            {
              groupId: 'com.alibaba.jar2proxy.facade',
              artifactId: 'jar2proxy-facade',
              version: '1.0.0',
            },
          ],
        },
      ],
    };

    Refer this article for more details.