Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加maven预编译插件,提升jprotobuf启动性能 #39

Closed
xiemalin opened this issue Jan 12, 2016 · 4 comments
Closed

增加maven预编译插件,提升jprotobuf启动性能 #39

xiemalin opened this issue Jan 12, 2016 · 4 comments
Assignees

Comments

@xiemalin
Copy link
Contributor

由于jprotobuf采用动态编译的技术,所以启动过程中会进行预编译,影响启动时间,maven编译插件实现把动态编译工作提前到编译发布阶段,提升启动性能

@xiemalin xiemalin self-assigned this Jan 12, 2016
@xiemalin
Copy link
Contributor Author

pom配置说明

        <plugin>
            <groupId>com.baidu</groupId>
            <artifactId>jprotobuf-precompile-plugin</artifactId>
            <version>1.2.0</version>
            <configuration>
                <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                <filterClassPackage>com.baidu</filterClassPackage>
            </configuration>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <goals>
                        <goal>precompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

运行命令: maven clean package

@xiemalin
Copy link
Contributor Author

使用方法参见:https://github.com/jhunters/jprotobuf
使用注意事项如下:
jprotobuf-precompile-plugin 支持maven编译时同时进行jprotobuf对象的预编译操作. 注:plugin版本建议使用>=1.2.0, jprotobuf 支持版本>=1.9.4

@p0mp0k0
Copy link

p0mp0k0 commented Dec 2, 2016

没有使用maven的项目如何解决这个问题呢?

1 similar comment
@p0mp0k0
Copy link

p0mp0k0 commented Dec 2, 2016

没有使用maven的项目如何解决这个问题呢?

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

No branches or pull requests

2 participants