導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)的解決方案_第1頁(yè)
導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)的解決方案_第2頁(yè)
導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)的解決方案_第3頁(yè)
導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)的解決方案_第4頁(yè)
導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)的解決方案_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

第導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)的解決方案目錄導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)所遇問(wèn)題解決方案新導(dǎo)入maven項(xiàng)目注解爆紅,所有依賴(lài)包無(wú)法導(dǎo)入經(jīng)過(guò)反復(fù)測(cè)試終于發(fā)現(xiàn)原因所在?。?!解決步驟如下

導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)

所遇問(wèn)題

導(dǎo)入maven項(xiàng)目各個(gè)注解均報(bào)錯(cuò)了

思考1:

這個(gè)項(xiàng)目使用了springboot;spring是個(gè)”大容器”,所有對(duì)象的創(chuàng)建和管理都交給了它,(SpringBoot是一個(gè)框架,一種全新的編程規(guī)范,他的產(chǎn)生簡(jiǎn)化了框架的使用,所謂簡(jiǎn)化是指簡(jiǎn)化了Spring眾多框架中所需的大量且繁瑣的配置文件,所以SpringBoot是一個(gè)服務(wù)于框架的框架,服務(wù)范圍是簡(jiǎn)化配置文件。

最明顯的特點(diǎn)是,讓文件配置變的相當(dāng)簡(jiǎn)單、讓?xiě)?yīng)用部署變的簡(jiǎn)單(SpringBoot內(nèi)置服務(wù)器,并裝備啟動(dòng)類(lèi)代碼),可以快速開(kāi)啟一個(gè)Web容器進(jìn)行開(kāi)發(fā)。);先去查看springboot是否掃描到這些文件;

結(jié)果:查看配置文件XML以及各層的依賴(lài),應(yīng)該沒(méi)出錯(cuò)。

思考2:

該導(dǎo)入的包是否成功導(dǎo)入?查看maven依賴(lài)樹(shù)(mvndependency),并檢查依賴(lài)版本等是否有用;結(jié)果:應(yīng)該沒(méi)錯(cuò),依賴(lài)樹(shù)上顯示了加入的jar包。

思考3:

有事問(wèn)度娘;百度上的方法各異;我并沒(méi)有成功,也許是我操作或者對(duì)它們的理解出了問(wèn)題吧;決定問(wèn)大佬,我問(wèn)了大佬,大佬從事安卓開(kāi)發(fā)多年,所以幫我叫來(lái)另一個(gè)大佬;在另一個(gè)大佬的指點(diǎn)下,

解決方案

我先是去了本地倉(cāng)庫(kù)setting.xml下的鏡像改為aliyun的鏡像;(下圖是查找你當(dāng)前maven項(xiàng)目的本地倉(cāng)庫(kù)已經(jīng)配置文件setting.xml的方法)

我這個(gè)是默認(rèn)生成的,如果沒(méi)有配置文件setting.xml;就自己新建一個(gè);新建方法很多這里就不介紹了;附上我的setting.xml

xmlversion="1.0"encoding="UTF-8"

LicensedtotheApacheSoftwareFoundation(ASF)underone

ormorecontributorlicenseagreements.SeetheNOTICEfile

distributedwiththisworkforadditionalinformation

regardingcopyrightownership.TheASFlicensesthisfile

toyouundertheApacheLicense,Version2.0(the

"License");youmaynotusethisfileexceptincompliance

withtheLicense.YoumayobtainacopyoftheLicenseat

/licenses/LICENSE-2.0

Unlessrequiredbyapplicablelaworagreedtoinwriting,

softwaredistributedundertheLicenseisdistributedonan

"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANY

KIND,eitherexpressorimplied.SeetheLicenseforthe

specificlanguagegoverningpermissionsandlimitations

undertheLicense.

|ThisistheconfigurationfileforMaven.Itcanbespecifiedattwolevels:

|1.UserLevel.Thissettings.xmlfileprovidesconfigurationforasingle

|user,andisnormallyprovidedin

|${user.home}/.m2/settings.xml.

|NOTE:ThislocationcanbeoverriddenwiththeCLIoption:

|-s/path/to/user/settings.xml

|2.GlobalLevel.Thissettings.xmlfileprovidesconfigurationforall

|Mavenusersonamachine(assumingthey'reallusingthe

|sameMaveninstallation).It'snormallyprovidedin

|${maven.home}/conf/settings.xml.

|NOTE:ThislocationcanbeoverriddenwiththeCLIoption:

|-gs/path/to/global/settings.xml

|Thesectionsinthissamplefileareintendedtogiveyouarunningstart

|atgettingthemostoutofyourMaveninstallation.Whereappropriate,the

|defaultvalues(valuesusedwhenthesettingisnotspecified)areprovided.

|--

settingsxmlns="/SETTINGS/1.0.0"

xmlns:xsi="/2001/XMLSchema-instance"

xsi:schemaLocation="/SETTINGS/1.0.0/xsd/settings-1.0.0.xsd"

!--localRepository

|Thepathtothelocalrepositorymavenwillusetostoreartifacts.

|Default:~/.m2/repository

localRepository/path/to/local/repo/localRepository

!--localRepositoryC:/Users/Administrator/.m2/repository/localRepository--

localRepositoryF:/eclipse_workspace20170314/repository/localRepository

!--interactiveMode

|Thiswilldeterminewhethermavenpromptsyouwhenitneedsinput.Ifset

|tofalse,mavenwilluseasensibledefaultvalue,perhapsbasedonsome

|othersetting,fortheparameterinquestion.

|Default:true

interactiveModetrue/interactiveMode

!--offline

|Determineswhethermavenshouldattempttoconnecttothenetworkwhen

|executingabuild.Thiswillhaveaneffectonartifactdownloads,

|artifactdeployment,andothers.

|Default:false

offlinefalse/offline

!--pluginGroups

|Thisisalistofadditionalgroupidentifiersthatwillbesearchedwhen

|resolvingpluginsbytheirprefix,i.e.wheninvokingacommandlinelike

|"mvnprefix:goal".Mavenwillautomaticallyaddthegroupidentifiers

|"org.apache.maven.plugins"and"org.codehaus.mojo"ifthesearenot

|alreadycontainedinthelist.

|--

pluginGroups

!--pluginGroup

|Specifiesafurthergroupidentifiertouseforpluginlookup.

pluginGroupcom.your.plugins/pluginGroup

/pluginGroups

!--proxies

|Thisisalistofproxieswhichcanbeusedonthismachinetoconnectto

|thenetwork.Unlessotherwisespecified(bysystempropertyorcommand-

|lineswitch),thefirstproxyspecificationinthislistmarkedasactive

|willbeused.

|--

proxies

!--proxy

|Specificationforoneproxy,tobeusedinconnectingtothenetwork.

proxy

idoptional/id

activetrue/active

protocolhttp/protocol

usernameproxyuser/username

passwordproxypass/password

host/host

port80/port

nonProxyHosts|/nonProxyHosts

/proxy

/proxies

!--servers

|Thisisalistofauthenticationprofiles,keyedbytheserver-idused

|withinthesystem.Authenticationprofilescanbeusedwhenevermavenmust

|makeaconnectiontoaremoteserver.

|--

servers

!--server

|Specifiestheauthenticationinformationtousewhenconnectingtoa

|particularserver,identifiedbyauniquenamewithinthesystem

|(referredtobythe'id'attributebelow).

|NOTE:Youshouldeitherspecifyusername/passwordOR

|privateKey/passphrase,sincethesepairingsareusedtogether.

server

iddeploymentRepo/id

usernamerepouser/username

passwordrepopwd/password

/server

!--Anothersample,usingkeystoauthenticate.

server

idsiteServer/id

privateKey/path/to/private/key/privateKey

passphraseoptional;leaveemptyifnotused./passphrase

/server

/servers

!--mirrors

|Thisisalistofmirrorstobeusedindownloadingartifactsfromremote

|repositories.

|Itworkslikethis:aPOMmaydeclarearepositorytouseinresolving

|certainartifacts.However,thisrepositorymayhaveproblemswithheavy

|trafficattimes,sopeoplehavemirroredittoseveralplaces.

|Thatrepositorydefinitionwillhaveauniqueid,sowecancreatea

|mirrorreferenceforthatrepository,tobeusedasanalternatedownload

|site.Themirrorsitewillbethepreferredserverforthatrepository.

|--

mirrors

!--mirror

|Specifiesarepositorymirrorsitetouseinsteadofagivenrepository.

|TherepositorythatthismirrorserveshasanIDthatmatchesthe

|mirrorOfelementofthismirror.IDsareusedforinheritanceanddirect

|lookuppurposes,andmustbeuniqueacrossthesetofmirrors.

mirror

idmirrorId/id

mirrorOfrepositoryId/mirrorOf

nameHumanReadableNameforthisMirror./name

url/repo/path/url

/mirror

mirror

idnexus-aliyun/id

mirrorOf*/mirrorOf

nameNexusaliyun/name

url/nexus/content/groups/public/url

/mirror

!--profiles

|Thisisalistofprofileswhichcanbeactivatedinavarietyofways,

|andwhichcanmodifythebuildprocess.Profilesprovidedinthe

|settings.xmlareintendedtoprovidelocalmachine-specificpathsand

|repositorylocationswhichallowthebuildtoworkinthelocal

|environment.

|Forexample,ifyouhaveanintegrationtestingplugin-likecactus-

|thatneedstoknowwhereyourTomcatinstanceisinstalled,youcan

|provideavariableheresuchthatthevariableisdereferencedduringthe

|buildprocesstoconfigurethecactusplugin.

|Asnotedabove,profilescanbeactivatedinavarietyofways.One

|way-theactiveProfilessectionofthisdocument(settings.xml)-willbe

|discussedlater.Anotherwayessentiallyreliesonthedetectionofa

|systemproperty,eithermatchingaparticularvaluefortheproperty,or

|merelytestingitsexistence.ProfilescanalsobeactivatedbyJDK

|versionprefix,whereavalueof'1.4'mightactivateaprofilewhenthe

|buildisexecutedonaJDKversionof'1.4.2_07'.Finally,thelistof

|activeprofilescanbespecifieddirectlyfromthecommandline.

|NOTE:Forprofilesdefinedinthesettings.xml,youarerestrictedto

|specifyingonlyartifactrepositories,pluginrepositories,and

|free-formpropertiestobeusedasconfigurationvariablesfor

|pluginsinthePOM.

|--

profiles

!--profile

|Specifiesasetofintroductionstothebuildprocess,tobeactivated

|usingoneormoreofthemechanismsdescribedabove.Forinheritance

|purposes,andtoactivateprofilesviaactivatedProfiles/orthe

|commandline,profileshavetohaveanIDthatisunique.

|Anencouragedbestpracticeforprofileidentificationistousea

|consistentnamingconventionforprofiles,suchas'env-dev',

|'env-test','env-production','user-jdcasey','user-brett',etc.This

|willmakeitmoreintuitivetounderstandwhatthesetofintroduced

|profilesisattemptingtoaccomplish,particularlywhenyouonlyhavea

|listofprofileid'sfordebug.

|ThisprofileexampleusestheJDKversiontotriggeractivation,and

|providesaJDK-specificrepo.

profile

idjdk-1.4/id

activation

jdk1.4/jdk

/activation

repositories

repository

idjdk14/id

nameRepositoryforJDK1.4builds/name

url/maven/jdk14/url

layoutdefault/layout

snapshotPolicyalways/snapshotPolicy

/repository

/repositories

/profile

|Hereisanotherprofile,activatedbythesystemproperty'target-env'

|withavalueof'dev',whichprovidesaspecificpathtotheTomcat

|instance.Tousethis,yourpluginconfigurationmighthypothetically

|looklike:

|...

|plugin

|groupIdorg.myco.myplugins/groupId

|artifactIdmyplugin/artifactId

|configuration

|tomcatLocation${tomcatPath}/tomcatLocation

|/configuration

|/plugin

|...

|NOTE:Ifyoujustwantedtoinjectthisconfigurationwheneversomeone

|set'target-env'toanything,youcouldjustleaveoffthe

|value/insidetheactivation-property.

profile

idenv-dev/id

activation

property

nametarget-env/

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論