gradle 打包spring-boot项目(apply plugin: 'spring-boot')怎么打包依赖包不需要main函数 5C

gradle 打包spring-boot项目(apply plugin: 'spring-boot')怎么打包依赖包不需要main函数

 apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'spring-boot'

打包报错

 Unable to find main class

打的包是工具包之类的东西。然后另一个包依赖它

1个回答

qq_15396517
Victor枫 不是打war包,是jar包,工具包之类的依赖包。提供给另一个工程用
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
在IDEA导入Gradle项目之后一直报错
代码用的Spring Boot+ MyBatis 导入后一直报如下错误 ``` Could not find org.springframework.boot:spring-boot-gradle-plugin:1.5.7.RELEASE. Searched in the following locations: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-gradle-plugin/1.5.7.RELEASE/spring-boot-gradle-plugin-1.5.7.RELEASE.pom http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-gradle-plugin/1.5.7.RELEASE/spring-boot-gradle-plugin-1.5.7.RELEASE.jar Required by: project : ``` Gradle相关配置如下 ``` apply plugin: 'java' apply plugin: 'eclipse-wtp' apply plugin: 'org.springframework.boot' if (!DEVELOP_MODE.toBoolean()) { apply plugin: 'war' } group = 'com.server' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } } configurations { providedRuntime } dependencies { compile('org.springframework.boot:spring-boot-starter-aop') compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-starter-jdbc') compile('org.springframework.boot:spring-boot-starter-web') compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1') compile "org.springframework.boot:spring-boot-starter-thymeleaf" runtime('mysql:mysql-connector-java') if (!DEVELOP_MODE.toBoolean()) { providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') } testCompile('org.springframework.boot:spring-boot-starter-test') } ```
关于 spring boot 用gradle打包 war后运行的问题
打包以后 出现错误 ``` 2-Jul-2019 16:00:10.516 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Error during ServletContainerInitializer processing javax.servlet.ServletException: Failed to instantiate WebApplicationInitializer class at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:155) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5267) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1140) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.InstantiationException: io.j99.app.measure.Application at java.lang.Class.newInstance(Unknown Source) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:152) ... 12 more Caused by: java.lang.NoSuchMethodException: io.j99.app.measure.Application.<init>() at java.lang.Class.getConstructor0(Unknown Source) ... 14 more 02-Jul-2019 16:00:10.516 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/measure-0.0.1] startup failed due to previous errors 02-Jul-2019 16:00:10.562 警告 [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [measure-0.0.1] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: 02-Jul-2019 16:00:10.562 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\measure-0.0.1] has finished in [5,484] ms 02-Jul-2019 16:00:10.562 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ROOT] 02-Jul-2019 16:00:10.734 信息 [36] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1364) at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1021) at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkContextClassLoaders(AbandonedConnectionCleanupThread.java:96) at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:69) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ``` ``` apply plugin: 'java' apply plugin: 'org.springframework.boot' //apply plugin: 'spring-boot' //apply plugin: 'watch' apply plugin: 'war' war { baseName = 'measure' version = '0.0.1' } /*apply plugin: 'idea' idea { module { inheritOutputDirs = false outputDir = file("$buildDir/classes/main/") } }*/ repositories { maven { url "http://maven.aliyun.com/nexus/content/repositories/public/" } maven { url "http://repo.spring.io/libs-snapshot" } } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } sourceCompatibility = 1.8 targetCompatibility = 1.8 springBoot { executable = true } configurations { // providedRuntime dev } /*jar { mainClass = "io.j99.app.measure.Application" }*/ dependencies { compile("commons-logging:commons-logging:1.2") compile("javax.servlet:javax.servlet-api:4.0.1") // compile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '9.0.8' compile("org.springframework.boot:spring-boot-devtools") // compile group: 'org.springframework.boot', name: 'spring-boot-dependencies', version: '2.2.0.M4' compile group: 'org.springframework.boot', name: 'spring-boot-maven-plugin', version: '2.2.0.M4' /// compile ("org.springframework.boot:spring-boot-dependencies") compile ("org.springframework.boot:spring-boot-maven-plugin") /// //// compile group: 'cn.org.faster', name: 'spring-boot-starter-parent', version: '1.1.1.RELEASE' compile ("org.springframework.boot:spring-boot-starter-tomcat") compile ("org.springframework.boot:spring-boot-starter-web") compile ("org.springframework.boot:spring-boot-devtools") // compile "org.springframework.boot:spring-boot-configuration-processor" compile("mysql:mysql-connector-java:8.0.12") /// compile fileTree(dir: 'libs', include: ['*.jar']) // dev("org.springframework.boot:spring-boot-devtools") testCompile("org.springframework.boot:spring-boot-starter-test") compile "io.springfox:springfox-swagger2:2.5.0" compile("org.springframework.session:spring-session") compile("org.simpleframework:simple-xml:2.7") compile("org.springframework.boot:spring-boot-starter-thymeleaf") compile("org.springframework.boot:spring-boot-starter-data-redis") compile("org.springframework.boot:spring-boot-starter-data-rest") compile 'io.jsonwebtoken:jjwt:0.6.0' // compile("org.springframework.boot:spring-boot-starter-data-mongodb") compile("org.springframework.boot:spring-boot-starter-jdbc") compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-actuator") // compile("mysql:mysql-connector-java") compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.0") compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:converter-jackson:2.1.0' compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' compile 'com.squareup.okhttp3:logging-interceptor:3.1.2' compile 'com.squareup.okhttp3:okhttp:3.1.2' compile("org.springframework.boot:spring-boot-starter-web") compile('commons-net:commons-net:3.5') compile('com.googlecode.log4jdbc:log4jdbc:1.2') // https://mvnrepository.com/artifact/org.apache.poi/poi compile group: 'org.apache.poi', name: 'poi', version: '3.15' compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.15' // https://mvnrepository.com/artifact/commons-lang/commons-lang compile group: 'commons-lang', name: 'commons-lang', version: '2.6' compile 'com.qiniu:qiniu-java-sdk:7.2.2' // https://mvnrepository.com/artifact/org.apache.ant/ant compile group: 'org.apache.ant', name: 'ant', version: '1.10.1' } bootRun { // addResources = true classpath = sourceSets.main.runtimeClasspath + configurations.dev } ``` 用gradle打包 war后 放入tomcat运行 报错 不知道是那个jar问题导致的 想问问各位大佬
IDEA导入gradle项目,所以用compile方式引入包都变成了provided
build.gradle文件配置如下: ``` buildscript { ext { springBootVersion = '1.5.2.RELEASE' } repositories { mavenLocal() jcenter() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } } version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'idea' apply plugin: 'org.springframework.boot' sourceCompatibility = 1.8 targetCompatibility = 1.8 [javadoc, compileTestJava]*.options*.encoding = 'UTF-8' compileJava { options.encoding = 'UTF-8' options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } repositories { mavenLocal() //mavenCentral() jcenter() } configurations { compile.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat' compile.exclude group: 'org.apache.tomcat' compile.exclude group: 'org.apache.tomcat.embed' all*.exclude module: 'spring-boot-starter-logging' } dependencies { compile('org.springframework.boot:spring-boot-starter-jersey') //compile('org.springframework.boot:spring-boot-starter-actuator') compile('org.springframework.boot:spring-boot-starter-undertow') compile('org.springframework.boot:spring-boot-starter-log4j2') compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1') // mybatis support // use swagger2 for api documentation compile('io.swagger:swagger-jersey2-jaxrs:1.5.10') compile('org.apache.commons:commons-lang3:3.4') compile('commons-codec:commons-codec:1.10') runtime('com.alibaba:druid:1.0.27') // alibaba datasource runtime('mysql:mysql-connector-java') // mysql jdbc driver runtime('org.apache.logging.log4j:log4j-jul:2.7') // log4j jul bridge(for java.util.logging.Logger) testCompile('org.springframework.boot:spring-boot-starter-test') testCompile('org.glassfish.jersey.connectors:jersey-apache-connector:2.25.1') // support jersey client using apache http client } idea { module { downloadJavadoc = false downloadSources = true } } ``` IDEA导入项目后的包变成了provided ![图片说明](https://img-ask.csdn.net/upload/201706/23/1498193445_262832.png)
kotlin配置dagger2报错':app:kaptAnzhiDebugKotlin
现在我是这样配置的: build.gradle: apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' android{ ····· } dependencies { compile 'com.google.dagger:dagger:2.5' kapt 'com.google.dagger:dagger-compiler:2.5' provided 'org.glassfish:javax.annotation:10.0-b28' } 之前项目是用java开发的,目前想融入kotlin,结果就出现了这种问题?不知道有没有哪位道友遇到过这种问题?该怎么解决呢?
执行gradle build一直报错
一直报错 multi-project-build:core:unspecified 跟项目配置文件: build.gradle subprojects { apply plugin: 'java' apply plugin: 'eclipse' repositories { mavenCentral() } } settings.gradle include 'app' include 'core' 子项目app的: apply plugin: 'application' dependencies { compile 'log4j:log4j:1.2.17' compile project(':core') } mainClassName = 'net.petrikainulainen.gradle.client.HelloWorld' task copyLicense { outputs.file new File("$buildDir/LICENSE") doLast { copy { from "LICENSE" into "$buildDir" } } } applicationDistribution.from(copyLicense) { into "" } 子项目core的: repositories { mavenCentral() } dependencies { compile("org.springframework.boot:spring-boot-starter-jdbc") testCompile 'junit:junit:4.11' }
idea构建Spring源码环境import项目时报错
Gradle project 选择第三个Use local gradle distribution时报错 Plugin [id: 'io.spring.dependency-management', version: '1.0.5.RELEASE', apply: false] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Plugin Repositories (could not resolve plugin artifact 'io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.0.5.RELEASE') Searched in the following repositories: Gradle Central Plugin Repository Consult IDE log for more details (Help | Show Log) 求大神解答
xutil3修改maven-gradle-plugin:1.3找不到怎么解决?
![图片说明](https://img-ask.csdn.net/upload/201604/06/1459947573_199619.png) 当使用的Gradle版本是2.4及以上,Android插件版本是1.3.0及以上的时候就会出现这个问题,这时候你只需将android-maven-gradle-plugin插件版本改为classpath ‘com.github.dcendents:android-maven-gradle-plugin:1.3’即可。 注意:有的童鞋偷懒只修改了版本号1.3,改成1.3会报错的,提示找不到1.3的版本。。,这样是不可以滴,因为地址也变了....当然找不到了。所以童鞋们继续重新修改吧....、 我就是只是把版本修改为1.3出现了找不到的问题搜了很多都不知道怎么解决,哪位师兄遇到过这种问题帮忙解答一下,非常感谢。
Spring Boot启动报错ERROR 3644 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
##报错类型: ###Field xxxDao in xxxServiceImpl required a bean of type xxx that could not be found. 详细情况如下: ```java . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.0.2.RELEASE) 2019-07-19 10:45:06.433 INFO 3644 --- [ main] com.meituan.hotel.Application : Starting Application on LAPTOP-2N82SD03 with PID 3644 (E:\CodeCache\IDEA\Webmagic\meituan-crawler-hotel\target\classes started by 三寸旧城七寸执念 in E:\CodeCache\IDEA\Webmagic\meituan-crawler-hotel) 2019-07-19 10:45:06.435 INFO 3644 --- [ main] com.meituan.hotel.Application : No active profile set, falling back to default profiles: default 2019-07-19 10:45:06.472 INFO 3644 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@197d671: startup date [Fri Jul 19 10:45:06 CST 2019]; root of context hierarchy 2019-07-19 10:45:07.211 INFO 3644 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-07-19 10:45:07.229 INFO 3644 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-07-19 10:45:07.229 INFO 3644 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31 2019-07-19 10:45:07.232 INFO 3644 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 2019-07-19 10:45:07.232 INFO 3644 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2019-07-19 10:45:07.232 INFO 3644 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 2019-07-19 10:45:07.235 INFO 3644 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 2019-07-19 10:45:07.351 INFO 3644 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-07-19 10:45:07.351 INFO 3644 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 882 ms 2019-07-19 10:45:07.459 INFO 3644 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/] 2019-07-19 10:45:07.462 INFO 3644 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 2019-07-19 10:45:07.462 INFO 3644 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2019-07-19 10:45:07.462 INFO 3644 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2019-07-19 10:45:07.462 INFO 3644 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2019-07-19 10:45:07.490 WARN 3644 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'hotelInfoServiceImpl': Unsatisfied dependency expressed through field 'hotelInfoDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.meituan.hotel.Dao.HotelInfoDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 2019-07-19 10:45:07.492 INFO 3644 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-07-19 10:45:07.504 INFO 3644 --- [ main] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-07-19 10:45:07.573 ERROR 3644 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field hotelInfoDao in com.meituan.hotel.Service.impl.HotelInfoServiceImpl required a bean of type 'com.meituan.hotel.Dao.HotelInfoDao' that could not be found. Action: Consider defining a bean of type 'com.meituan.hotel.Dao.HotelInfoDao' in your configuration. Process finished with exit code 1 ``` ### 最近网项目里面加了个模块,模块是基于gradle的工程,我本身的工程是基于maven的,没有导成功,我就把那个模块删除掉了,但是运行就出问题了,网上搜了很多,但是我的注解都加了,而且目录结构也没有问题,Application.class也的确在包的最外层。 ## 希望有大佬帮忙解答一下
Gradle构建web项目问题
1.使用的Eclipse,新建一个web程序,然后转换成Gradle项目 build.gradle配置如下 ``` apply plugin:'war' apply plugin:'eclipse-wtp' repositories{ maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/' } } dependencies{ compile group: 'org.apache.struts', name: 'struts2-core', version: '2.3.24' compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.2' } ``` 2.我在WebContext下添加了一个jsp页面 3.tomcat发布的时候,在tomcat下只有WEB-INF这么一个文件夹,jsp没有发布过去 4.百度上看了也没解决办法
spring boot中找不到jsp
查了一天了也没查到问题,我配置了mvc的前缀和后缀,可就是返回不了jsp,是打的war包有问题吗, 还是缺少什么web的包,它只会报Circular view path [/main]: would dispatch back to the current handler URL [/main] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.),实在是查不到怎么解决了,照着springboot的官方web例子改也不行,直接返回了字符串而不是jsp页面,真心求各位帮帮忙。 yml配置文件里的源码 ``` mvc: view: prefix: /WEB-INF/jsp/ suffix: .jsp ``` gradle的依赖包引入 ``` compile 'org.springframework.boot:spring-boot-starter-data-jpa' compile 'org.springframework.boot:spring-boot-starter-freemarker' compile 'org.springframework.boot:spring-boot-starter-groovy-templates' compile 'org.springframework.boot:spring-boot-starter-jdbc' compile 'com.h2database:h2:1.4.190' compile 'com.alibaba:fastjson:1.2.7' compile 'com.google.guava:guava:18.0' compile 'org.springframework.boot:spring-boot-starter-redis' compile 'org.springframework.boot:spring-boot-starter-web' // compile 'org.springframework.boot:spring-boot-starter-jetty' compile 'org.springframework.boot:spring-boot-starter-tomcat' compile 'org.apache.tomcat.embed:tomcat-embed-jasper' compile 'javax.servlet:jstl' compile 'org.apache.directory.studio:org.apache.commons.lang:2.6' compile 'commons-io:commons-io:2.4' compile 'mysql:mysql-connector-java' testCompile 'org.springframework.boot:spring-boot-starter-test' compile 'org.springframework.boot:spring-boot-starter-data-rest' compile 'org.springframework.boot:spring-boot-configuration-processor' compile 'com.googlecode.xmemcached:xmemcached:2.0.0' ``` controller ``` @RequestMapping("/main") public ModelAndView welcome1() { logger.error("111111111111111") return new ModelAndView("/main") } ``` 日志能打出来,但是这个main.jsp找不到 war包的目录结构 ![图片说明](https://img-ask.csdn.net/upload/201604/27/1461742939_597620.png) 又去查了一下,视频和例子都在说引入 compile 'org.springframework.boot:spring-boot-starter-tomcat' compile 'org.apache.tomcat.embed:tomcat-embed-jasper' 两个依赖后,注释为@Controller,直接return字符串类型的jsp名就可以 可就是还是不行,ViewResolver好像没有设置
Android Stadio2.0 gradle
Android Stadio 项目运行时 gradle 出错了,错误如下: :app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE Information:Gradle tasks [:app:generateDebugSources, :app:mockableAndr oidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAnd roidTestSources] :app:checkDebugManifest :app:generateDebugAssets UP-TO-DATE :app:mergeDebugResources :app:preDebugBuild UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:compileDebugAidl UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugRenderscript UP-TO-DATE :app:preBuild UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE :app:prepareComAndroidSupportDesign2340Library UP-TO-DATE :app:mergeDebugResources FAILED Information:BUILD FAILED Information:Total time: 3.758 secs Information:2 errors Information:0 warnings Information:See complete output in console 求大神指教,谢谢!
JAVA 给JVM 注册CA证书之后 仍然出现证书不信任问题。
1.项目基于mavn 的 或者是gradle的 然后下载仓库配成https 发现证书不信任。 2.网上搜索 下载了CA 证书 并配置到了JVM里面 但是 仍然出这个问题 3.现在 怀疑是 JVM 运行的时候 没有趣找那些 配置进去的证书 走的是空 或者是默认。 有没有大佬解下惑。 org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'ocr'. at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:80) ... Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'. at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:1258) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35) at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:107) ... 110 more Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.2.0.RELEASE. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:2.2.0.RELEASE Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.2.0.RELEASE. Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/2.2.0.RELEASE/spring-boot-gradle-plugin-2.2.0.RELEASE.pom'. at org.gradle.internal.resource.ResourceExceptions.failure(ResourceExceptions.java:74) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385) at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:290) at java.base/sun.security.validator.Validator.validate(Validator.java:264) at java.base/sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:222) at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:129) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:626) ... 241 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380) ... 247 more
hadoop简单问题,如何在spring boot中,同时使用这4个jar,能够正常运行
dependencies { compile('org.springframework.boot:spring-boot-starter') compile("org.apache.hadoop:hadoop-common:2.7.3") compile("org.apache.hadoop:hadoop-mapreduce-client-core:2.7.3") compile("org.apache.hadoop:hadoop-hdfs:2.7.3") } 或者这样也行 dependencies { compile('org.springframework.boot:spring-boot-starter') compile 'org.springframework.data:spring-data-hadoop:2.5.0.RELEASE' } 我就是想在spring boot中连接hadoop的hdfs而已,为啥要这样折磨我,请各位大神可以的话新建一个基本的spring boot项目,然后添加一下以上的关于hadoop的包,然后试着运行一下,我已经哭了
Intellij IDEA + Gradle 搭建Spring源代码,报错,求解决
版本: gradle 4.8.1 JDK 1.8.0\_171 Spring spring-framework-5.0.2.RELEASE 代码已经导入idea了,然后报错如下 ``` Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.8.1/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- 错误: 找不到或无法加载主类 C:\develop\java\jdk1.8.0_171 ```
Android Studio 2.1 gradle 2.10报错
Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2330Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72330Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42330Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2330Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl UP-TO-DATE :app:processDebugAndroidTestManifest UP-TO-DATE :app:compileDebugAndroidTestRenderscript UP-TO-DATE :app:generateDebugAndroidTestBuildConfig UP-TO-DATE :app:mergeDebugAndroidTestShaders UP-TO-DATE :app:compileDebugAndroidTestShaders UP-TO-DATE :app:generateDebugAndroidTestAssets UP-TO-DATE :app:mergeDebugAndroidTestAssets UP-TO-DATE :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources UP-TO-DATE :app:mergeDebugAndroidTestResources UP-TO-DATE :app:processDebugAndroidTestResources UP-TO-DATE :app:generateDebugAndroidTestSources UP-TO-DATE :app:mockableAndroidJar UP-TO-DATE :app:preDebugUnitTestBuild UP-TO-DATE 求大神帮帮忙。。。。
app:processDebugResources'.
不知道为什么,在没有编辑“public class SlidingMenu extends HorizontalScrollView”此的代码以前,gradle好没有报错,遍完试运的时候就出现了一下问题 ``` Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:mergeDebugResources :app:generateDebugResources :app:processDebugManifest :app:processDebugResources FAILED Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\java\sd\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1 Information:Total time: 17.299 secs Information:BUILD FAILED Information:1 error Information:0 warnings Information:See complete output in console ``` 这是build.gradle文件 ``` apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '23.0.3' defaultConfig { applicationId "com.fj_hooone.studys" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' } ``` 求解救
新电脑第一次安装Android studio 报错 gradle project
下面是IDEA里的最后一段 ``` 2017-11-22 00:35:54,284 [ thread 14] WARN - ect.sync.idea.ProjectSetUpTask - Failed to find target with hash string 'android-26' in: C:\Users\Lan\AppData\Local\Android\Sdk Consult IDE log for more details (Help | Show Log) 2017-11-22 00:35:54,285 [ thread 14] INFO - e.project.sync.GradleSyncState - Gradle sync failed: Failed to find target with hash string 'android-26' in: C:\Users\Lan\AppData\Local\Android\Sdk Consult IDE log for more details (Help | Show Log) (924ms) 2017-11-22 00:35:54,501 [ thread 18] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s. 2017-11-22 00:35:54,524 [ thread 18] INFO - #com.jetbrains.cidr.lang - Loading symbols finished in 0 s. 2017-11-22 00:35:54,529 [ thread 18] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s. 2017-11-22 00:35:54,541 [ thread 18] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s. 2017-11-22 00:36:14,763 [se-915-b01] INFO - ide.actions.ShowFilePathAction - Exit code 1 ```
reactnative启动报错 app:compileDebugJavaWithJavac
scanning folders for symlinks in E:\SimpleApp\SimpleApp\node_modules (30ms) Starting JS server... Building and installing the app on the device (cd android && gradlew.bat installDebug)... Starting a new Gradle Daemon for this build (subsequent builds will be faster). Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE :app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE :app:prepareComFacebookFrescoDrawee130Library UP-TO-DATE :app:prepareComFacebookFrescoFbcore130Library UP-TO-DATE :app:prepareComFacebookFrescoFresco130Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipeline130Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineBase130Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineOkhttp3130Library UP-TO-DATE :app:prepareComFacebookReactReactNative0493Library UP-TO-DATE :app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE :app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:bundleDebugJsAndAssets SKIPPED :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). :app:compileDebugJavaWithJavac FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Unexpected lock protocol found in lock file. Expected 3, found 0.
springboot gradle mybatis MapperScan.factoryBean()异常
异常 ``` Caused by: java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.mybatis.spring.annotation.MapperScan.factoryBean() at java.lang.reflect.Method.getDefaultValue(Method.java:612) ~[na:1.8.0_131] at org.springframework.core.annotation.AnnotationUtils.registerDefaultValues(AnnotationUtils.java:1258) ~[spring-core-5.1.2.RELEASE.jar:5.1.2.RELEASE] ``` 配置: ``` @Configuration @MapperScan(basePackages = EntMasterDataSourceConfig.BASE_PACKAGE, sqlSessionFactoryRef = "entMasterSqlSessionFactory") public class EntMasterDataSourceConfig { static final String BASE_PACKAGE = "com.sunlands.entmaster"; static final String MAPPER_LOCATION = "classpath:/*.xml"; @Value("${spring.datasource.ent_master.url}") private String dbUrl; @Value("${spring.datasource.ent_master.username}") private String dbUser; @Value("${spring.datasource.ent_master.password}") private String dbPassword; @Value("${spring.datasource.driver-class-name}") private String dbDriver; /** * 配置数据数据源 master * * @return */ @Bean(name = "entMasterDatasource") @Primary public DataSource masterDatasource() { DruidDataSource dataSource = new DruidDataSource(); dataSource.setDriverClassName(dbDriver); dataSource.setUrl(dbUrl); dataSource.setUsername(dbUser); dataSource.setPassword(dbPassword); //连接池启动时创建的初始化连接数量 dataSource.setInitialSize(1); //连接池中可同时连接的最大的连接数 dataSource.setMaxActive(100); //连接池中最小的空闲的连接数,低于这个数量会被创建新的连接 dataSource.setMinIdle(5); //最大等待时间,当没有可用连接时,连接池等待连接释放的最大时间,超过该时间限制会抛出异常,如果设置-1表示无限等待 dataSource.setMaxWait(60000); //超过removeAbandonedTimeout时间后,是否进 行没用连接(废弃)的回收(默认为false,调整为true) dataSource.setRemoveAbandoned(true); //超过时间限制,回收没有用(废弃)的连接(默认为 300秒,调整为180) dataSource.setRemoveAbandonedTimeout(180); //默认提交 dataSource.setDefaultAutoCommit(true); //打开检查,用异步线程evict进行检查 dataSource.setTestWhileIdle(true); //就是在进行borrowObject进行处理时,对拿到的connection进行validateObject校验 dataSource.setTestOnBorrow(false); //就是在进行returnObject对返回的connection进行validateObject校验,个人觉得对数据库连接池的管理意义不大 dataSource.setTestOnReturn(false); // 代表检查的sql dataSource.setValidationQuery("select 1 from dual"); //代表在执行检查时,通过statement设置,statement.setQueryTimeout(validationQueryTimeout) dataSource.setValidationQueryTimeout(1); dataSource.setTimeBetweenEvictionRunsMillis(30000); return dataSource; } /** * 配置session工厂 * * @param entMasterDatasource * @return * @throws Exception */ @Bean(name = "entMasterSqlSessionFactory") @Primary public SqlSessionFactory masterSqlSessionFactory(@Qualifier("entMasterDatasource") DataSource entMasterDatasource) throws Exception { final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); sessionFactory.setDataSource(entMasterDatasource); sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() .getResources(EntMasterDataSourceConfig.MAPPER_LOCATION)); return sessionFactory.getObject(); } /** * 配置事务管理器 * * @param dataSource * @return */ @Bean(name = "entMasterTransactionManger") @Primary public DataSourceTransactionManager masterTransactionManger(@Qualifier("entMasterDatasource") DataSource dataSource) { return new DataSourceTransactionManager(dataSource); } } ``` gradle springboot是2.1.0 ``` dependencies { implementation('org.springframework.boot:spring-boot-starter-web') providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') testImplementation('org.springframework.boot:spring-boot-starter-test') compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.1.0.RELEASE' compile group: 'com.alibaba', name: 'fastjson', version: '1.2.51' compile group: 'com.alibaba', name: 'druid', version: '1.1.12' compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.1.0.RELEASE' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1' compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.34' compile group: 'org.mybatis.spring.boot', name: 'mybatis-spring-boot-starter', version: '1.3.2' compile group: 'org.mybatis', name: 'mybatis-spring', version: '1.3.2' compile group: 'org.springframework', name: 'spring-jdbc', version: '5.1.2.RELEASE' compile group: 'org.springframework', name: 'spring-orm', version: '5.1.2.RELEASE' compile group: 'org.mybatis', name: 'mybatis', version: '3.4.6' } ```
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
这30个CSS选择器,你必须熟记(上)
关注前端达人,与你共同进步CSS的魅力就是让我们前端工程师像设计师一样进行网页的设计,我们能轻而易举的改变颜色、布局、制作出漂亮的影音效果等等,我们只需要改几行代码,不需...
国产开源API网关项目进入Apache孵化器:APISIX
点击蓝色“程序猿DD”关注我回复“资源”获取独家整理的学习资料!近日,又有一个开源项目加入了这个Java开源界大名鼎鼎的Apache基金会,开始进行孵化器。项目名称:AP...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
编写Spring MVC控制器的14个技巧
本期目录 1.使用@Controller构造型 2.实现控制器接口 3.扩展AbstractController类 4.为处理程序方法指定URL映射 5.为处理程序方法指定HTTP请求方法 6.将请求参数映射到处理程序方法 7.返回模型和视图 8.将对象放入模型 9.处理程序方法中的重定向 10.处理表格提交和表格验证 11.处理文件上传 12.在控制器中自动装配业务类 ...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
求小姐姐抠图竟遭白眼?痛定思痛,我决定用 Python 自力更生!
点击蓝色“Python空间”关注我丫加个“星标”,每天一起快乐的学习大家好,我是 Rocky0429,一个刚恰完午饭,正在用刷网页浪费生命的蒟蒻...一堆堆无聊八卦信息的网页内容慢慢使我的双眼模糊,一个哈欠打出了三斤老泪,就在此时我看到了一张图片:是谁!是谁把我女朋友的照片放出来的!awsl!太好看了叭...等等,那个背景上的一堆鬼画符是什么鬼?!真是看不下去!叔叔婶婶能忍,隔壁老王的三姨妈的四表...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
相关热词 c# clr dll c# 如何orm c# 固定大小的字符数组 c#框架设计 c# 删除数据库 c# 中文文字 图片转 c# 成员属性 接口 c#如何将程序封装 16进制负数转换 c# c#练手项目
立即提问