本文主要是介绍idea使用代理模式联网,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
file--setting--
确定,会弹出新窗口
点击http proxy settings
输入地址,端口号,账号密码,这个公司应该会给吧,毕竟百度什么问题要联网吧
输入无误测试一下,点击测试连接:
这样idea就算设置好了代理模式。但是!使用maven的时候还是会提示,
不能解析你导入的包,pom.xml里面都没没有引用成功的。
还需要在你的setting 文件里配置代理模式,如下:
<proxy><id>my-proxy</id><active>true</active><protocol>http</protocol><host>csproxy.***.com.cn</host><port>18**5</port><!--<username>shihuan</username><password>123456</password><nonProxyHosts>repository.mycom.com|*.google.com</nonProxyHosts>--></proxy></proxies>
账号密码 写自己的,这里涉及到隐私部分信息我用*代替了。
这个配置好之后,idea会检测到maven有变化 changed。等他加载好(把你引用的依赖文件下载到你的maven仓库)就不会提示引用包无效了。没有maven仓库的要先下载maven配置环境变量,新建maven仓库目录。这里只讲解网络配置方面。
一切准备就绪,我们新建一个spring boot项目,启动跑一下,显示如下就表示成功了:
"C:\Program Files\Java\jdk1.8.0_92\bin\java" "-javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\lib\idea_rt.jar=60494:C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_92\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_92\jre\lib\rt.jar;C:\Users\july2\IdeaProjects\springBootTeset\target\classes;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\boot\spring-boot-starter-web\1.5.14.BUILD-SNAPSHOT\spring-boot-starter-web-1.5.14.BUILD-20180514.190825-11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\boot\spring-boot-starter\1.5.14.BUILD-SNAPSHOT\spring-boot-starter-1.5.14.BUILD-20180514.190825-11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\boot\spring-boot\1.5.14.BUILD-SNAPSHOT\spring-boot-1.5.14.BUILD-20180514.190825-11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\boot\spring-boot-autoconfigure\1.5.14.BUILD-SNAPSHOT\spring-boot-autoconfigure-1.5.14.BUILD-20180514.190825-11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\boot\spring-boot-starter-logging\1.5.14.BUILD-SNAPSHOT\spring-boot-starter-logging-1.5.14.BUILD-20180514.190825-11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\ch\qos\logback\logback-classic\1.1.11\logback-classic-1.1.11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\ch\qos\logback\logback-core\1.1.11\logback-core-1.1.11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\slf4j\jcl-over-slf4j\1.7.25\jcl-over-slf4j-1.7.25.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\slf4j\log4j-over-slf4j\1.7.25\log4j-over-slf4j-1.7.25.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\yaml\snakeyaml\1.17\snakeyaml-1.17.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\boot\spring-boot-starter-tomcat\1.5.14.BUILD-SNAPSHOT\spring-boot-starter-tomcat-1.5.14.BUILD-20180514.190825-11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\apache\tomcat\embed\tomcat-embed-core\8.5.31\tomcat-embed-core-8.5.31.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\apache\tomcat\tomcat-annotations-api\8.5.31\tomcat-annotations-api-8.5.31.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\apache\tomcat\embed\tomcat-embed-el\8.5.31\tomcat-embed-el-8.5.31.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\apache\tomcat\embed\tomcat-embed-websocket\8.5.31\tomcat-embed-websocket-8.5.31.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\hibernate\hibernate-validator\5.3.6.Final\hibernate-validator-5.3.6.Final.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\com\fasterxml\classmate\1.3.4\classmate-1.3.4.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\com\fasterxml\jackson\core\jackson-databind\2.8.11.1\jackson-databind-2.8.11.1.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\com\fasterxml\jackson\core\jackson-core\2.8.11\jackson-core-2.8.11.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-web\4.3.17.RELEASE\spring-web-4.3.17.RELEASE.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-aop\4.3.17.RELEASE\spring-aop-4.3.17.RELEASE.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-beans\4.3.17.RELEASE\spring-beans-4.3.17.RELEASE.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-context\4.3.17.RELEASE\spring-context-4.3.17.RELEASE.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-webmvc\4.3.17.RELEASE\spring-webmvc-4.3.17.RELEASE.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-expression\4.3.17.RELEASE\spring-expression-4.3.17.RELEASE.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\myMaven\apache-maven-3.5.3-bin\LocalMavenHome\org\springframework\spring-core\4.3.17.RELEASE\spring-core-4.3.17.RELEASE.jar" com.example.demo.SpringBootTestApplication. ____ _ __ _ _/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v1.5.14.BUILD-SNAPSHOT)2018-05-15 16:39:43.027 INFO 20188 --- [ main] c.e.demo.SpringBootTestApplication : Starting SpringBootTestApplication on LAPTOP-LMBBFFJV with PID 20188 (C:\Users\july2\IdeaProjects\springBootTeset\target\classes started by July in C:\Users\july2\IdeaProjects\springBootTeset)
2018-05-15 16:39:43.049 INFO 20188 --- [ main] c.e.demo.SpringBootTestApplication : No active profile set, falling back to default profiles: default
2018-05-15 16:39:43.213 INFO 20188 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@530612ba: startup date [Tue May 15 16:39:43 CST 2018]; root of context hierarchy
2018-05-15 16:39:46.820 INFO 20188 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2018-05-15 16:39:46.867 INFO 20188 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-05-15 16:39:46.867 INFO 20188 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31
2018-05-15 16:39:47.074 INFO 20188 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-05-15 16:39:47.075 INFO 20188 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3878 ms
2018-05-15 16:39:47.465 INFO 20188 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-05-15 16:39:47.471 INFO 20188 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-05-15 16:39:47.472 INFO 20188 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-05-15 16:39:47.472 INFO 20188 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-05-15 16:39:47.472 INFO 20188 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-05-15 16:39:48.038 INFO 20188 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@530612ba: startup date [Tue May 15 16:39:43 CST 2018]; root of context hierarchy
2018-05-15 16:39:48.220 INFO 20188 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-05-15 16:39:48.220 INFO 20188 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-05-15 16:39:48.263 INFO 20188 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-05-15 16:39:48.263 INFO 20188 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-05-15 16:39:48.332 INFO 20188 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-05-15 16:39:48.540 INFO 20188 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-05-15 16:39:48.612 INFO 20188 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2018-05-15 16:39:48.617 INFO 20188 --- [ main] c.e.demo.SpringBootTestApplication : Started SpringBootTestApplication in 6.759 seconds (JVM running for 8.833)
这篇关于idea使用代理模式联网的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!