首页
关于
壁纸
直播
留言
友链
统计
Search
1
《三国志英杰传》攻略
6,129 阅读
2
Emby客户端IOS破解
5,997 阅读
3
白嫖Emby
5,981 阅读
4
《吞食天地1》金手指代码
5,275 阅读
5
破解emby-server
4,240 阅读
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
登录
Search
标签搜索
ubuntu
mysql
openwrt
zerotier
springboot
centos
openvpn
jdk
吞食天地2
synology
spring
idea
windows11
吞食天地1
transmission
google-play
Japanese
xcode
群晖
kiftd
MoonjerX
累计撰写
375
篇文章
累计收到
464
条评论
首页
栏目
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
页面
关于
壁纸
直播
留言
友链
统计
搜索到
69
篇与
develop
的结果
2023-10-27
【HbuilderX】【Android Studio】打包App步骤踩坑
一、HbuilderX打包本地离线资源包www二、安装Android Studio1.去 谷歌开发者官网 下载最新Android Studio安装包2.安装过程中会通过谷歌官方下载地址 https://dl.google.com 下载Android SDK文件,需要科学网络才能下载3.默认安装包附带的JDK版本是JDK11+以上的版本,本地安装JDK8后使用组合键 Ctrl+Shift+Alt+S 打开Project Structure->SDK Location->Gradle Settings可以切换JDK版本4.打开Dcloud官方提供的 Android-SDK@3.8.12.81924_20230817/HBuilder-Integrate-AS 工程,等待资源文件下载完毕三、Android Studio修改配置1.修改AppID和AppKey(1)HbuilderX打包好的 __UNI__XXXXXXX/www 资源包放到 Android-SDK@3.8.12.81924_20230817\HBuilder-Integrate-AS\simpleDemo\src\main\assets\apps\ 目录下,以供打包App修改 Android-SDK@3.8.12.81924_20230817\HBuilder-Integrate-AS\simpleDemo\src\main\assets\data\dcloud_control.xml 文件中的值,改为HbuilderX(2)打包好的www资源包文件名,形如 uni.UNIxxxxxxx (3)修改文件 Android-SDK@3.8.12.81924_20230817\HBuilder-Integrate-AS\simpleDemo\src\main\AndroidManifest.xml 下的 dcloud_appkey 值,为dcloud官方申请提供(4)App在手机桌面显示的应用名称需要根据本地语言自动切换国际化多语言名称在目录 Android-SDK@3.8.12.81924_20230817\HBuilder-Integrate-AS\simpleDemo\src\main\res 下复制 values 文件成多份并修改应用名称即可(5)App启动图,消息推送图标,修改目录 Android-SDK@3.8.12.81924_20230817\HBuilder-Integrate-AS\simpleDemo\src\main\res\drawable 中对应图片即可,注意尺寸大小2.gradle-6.5版本有bug,会报错主机中软件中止了一个连接,有网友提到是pc开了热点,冲突导致。关闭热点可解决。但是我台式机无热点也会如此。切换更高版本gradle解决。(6) HBuilder-Integrate-AS 工程下包含两个build.gradle文件,其中一个是 simpleDemo 工程的,这个才是需要修改配置的。 HBuilder-Integrate-AS 工程的build.gradle文件基本没改动过。3.无论切换什么版本gradle都会出现以下警告,但是不影响打包Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/014.AndroidManifest.xml文件中增加一些权限请求<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.android.simple"> <!-- 增加的内容start --> <!-- <permission android:name="android.permission.BATTERY_STATS" />--> <!-- <permission android:name="android.permission.WRITE_SETTINGS" />--> <!-- <permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />--> <!-- <permission android:name="android.permission.READ_LOGS" />--> <!-- 上架谷歌需要禁用-start --> <!-- <uses-permission android:name="android.permission.INSTALL_PACKAGES" tools:node="remove" tools:ignore="ProtectedPermissions" />--> <!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:node="remove" tools:ignore="QueryAllPackagesPermission" />--> <!-- <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove"/>--> <!-- 2023年8月11日 起谷歌要求应用必须以 Android 13(SDK API 级别 33) 或更高级别为目标平台,以下2个权限已被弃用--> <!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />--> <!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />--> <!-- 上架谷歌需要禁用-end --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.hardware.camera" /> <uses-permission android:name="android.hardware.camera.autofocus" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.FLASHLIGHT" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 申请白名单保活,用于进程杀死 google 推送--> <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> <!-- 解决某些设备不能从google play下载app的问题,声明此硬件使用并非必要--> <!-- <uses-feature android:name="android.hardware.location.gps" android:required="false"/>--> <!-- <uses-feature android:name="android.hardware.location" android:required="false"/>--> <!-- <uses-feature android:name="android.hardware.location.network" android:required="false"/>--> <!-- <uses-feature android:name="android.hardware.telephony" android:required="false"/>--> <uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <uses-feature android:name="android.hardware.telephony" android:required="false" /> <!-- <uses-feature android:name="android.hardware.wifi" android:required="false"/>--> <!-- <uses-feature android:name="android.hardware.bluetooth" android:required="false"/>--> <!-- 增加的内容end --> <application android:allowBackup="true" android:allowClearUserData="true" android:icon="@drawable/icon" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true"> <activity android:exported="true" android:name="io.dcloud.PandoraEntry" android:configChanges="orientation|keyboardHidden|keyboard|navigation" android:label="@string/app_name" android:launchMode="singleTask" android:hardwareAccelerated="true" android:theme="@style/TranslucentTheme" android:screenOrientation="user" android:windowSoftInputMode="adjustResize" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:exported="true" android:name="io.dcloud.PandoraEntryActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard|smallestScreenSize|screenLayout|screenSize|uiMode" android:hardwareAccelerated="true" android:permission="com.miui.securitycenter.permission.AppPermissionsEditor" android:screenOrientation="user" android:theme="@style/DCloudTheme" android:windowSoftInputMode="adjustResize"> <intent-filter> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <action android:name="android.intent.action.VIEW" /> <data android:scheme=" " /> </intent-filter> </activity> <meta-data android:name="dcloud_appkey" android:value="xxxxxxxxxxxxxxxxxxxxxxxxxx" /> </application> </manifest>AndroidManifest.xml中的 <activity/> 节点 android:exported 必须赋值,否则报错,dcloud官方文档赋值false节点是向dcloud申请的appKey5.官方提供的SDK包simpleDemo工程下libs中不包含录音功能需要的 audio-mp3aac-release.aar 包,缺此包打包出来的应用调用录音api会弹出h5+提示缺少录音包此包在官方提供的SDK包中目录 Android-SDK@3.8.12.81924_20230817\SDK\libs\audio-mp3aac-release.aar 6.打包出来的默认apk/aab文件名格式为 simpleDemo_release.aab ,缺乏辨识度在 build.gradle(:simpleDemo) 文件中的android节点最底部添加如下代码可以修改打包出来的apk/aab文件名apply plugin: 'com.android.application' android { compileSdkVersion 34 buildToolsVersion '30.0.3' defaultConfig { applicationId "uni.UNIxxxxxxx" minSdkVersion 21 targetSdkVersion 34 versionCode 30100 versionName "3.1.0" multiDexEnabled true ndk { // abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a' // 谷歌要求:提供了32位程序,就必须提供64位程序 abiFilters 'armeabi-v7a', 'arm64-v8a' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } signingConfigs { config { keyAlias 'XXXAlias' keyPassword 'keyPassword' storeFile file('xxx.keystore') storePassword 'keyPassword' v1SigningEnabled true v2SigningEnabled true } } buildTypes { debug { signingConfig signingConfigs.config minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } release { signingConfig signingConfigs.config minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } aaptOptions { additionalParameters '--auto-add-overlay' ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" } //重命名输出apk/aab文件名 setProperty("archivesBaseName", "AppName_v${defaultConfig.versionName}_" + new Date().format("YYYYMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))) //仅对apk有效 // android.applicationVariants.all { variant -> // variant.outputs.all { // def createTime = new Date().format("YYYYMMddHHmm", TimeZone.getTimeZone("GMT+08:00")) // def fileName = "${signingConfigs.config.keyAlias}_${buildType.name}_v${defaultConfig.versionName}_${createTime}.apk" // outputFileName = fileName // } // } } dependencies { implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: []) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' implementation 'androidx.core:core:1.1.0' implementation "androidx.fragment:fragment:1.1.0" implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'com.facebook.fresco:fresco:2.5.0' implementation "com.facebook.fresco:animated-gif:2.5.0" implementation 'com.github.bumptech.glide:glide:4.9.0' implementation 'com.alibaba:fastjson:1.2.83' implementation 'androidx.webkit:webkit:1.3.0' } 打包出来的包名示例: AppName_v3.1.0_202310270536-release.apk ,aab文件同理7.在正常build之前出现的莫名其妙问题,基本上都是gradle版本问题
2023年10月27日
157 阅读
0 评论
0 点赞
2023-07-01
Javascript中0 == ""的判断结果为true
$(function() { console.log("0 == ' ':" + (0 == '')); console.log("0 === '':" + (0 === '')); console.log("0 == null:" + (0 == null)); console.log("0 === null:" + (0 === null)); console.log("1 == true:" + (1 == true)); console.log("1 === true:" + (1 === true)); console.log("0 == false:" + (0 == false)); console.log("0 === false:" + (0 === false)); console.log("null == undefined:" + (null == undefined)); console.log("null === undefined:" + (null === undefined)); })先来说一下 === 吧1、首先是判断两值的类型是否一样,不一样就不相等。2、字符串为例,需要两个字符串的长度一致和每个字符的位置都一致才相等。3、如果两都是引用,比较引用是否一致。4、从上面的运行结果可以看出 null === undefined 是 false的,因为两个值的类型不一样。其实,js的 === 有点类似 Java 里面的 equals 方法。最后就是 js 的 == 了1、如果两值的类型一样,然后就进行 === 比较。2、如果两值的类型不一样,就先转为相同的类型再进行比较。【1】从上面的运行结果可以看到 null == undefined 为 true 的,null == undefined 比较时是不进行转换的,并且规定 null 等于 undefined。【2】如果不同类型与 true 或者 false 进行比较时,会先把true转成 1 ,false 转成 0 ,再进行比较。这就解释了为什么 0 == false 和 1== true 为 true 了。【3】如果一个是基本数据类型一个是对象,那会先把对象先转成基本数据类型,再进行比较。【4】本文的重点:0 == ' ' 为 true,因为0可以为 false,空格或空值也为 false,所以它们相等。我们 if 判断 if(null) 是false,那么为什么 0 == null 是 false呢,是因为null 和 undefined 和 NaN 是特殊值,不进行转换的。NaN == null ,NaN == undefined 都为 false,无论 NaN == 啥都为 false。
2023年07月01日
86 阅读
0 评论
0 点赞
2023-01-12
Linux+Nginx+PHP
配置php.ini首先定位配置文件php.ini 的位置。php --ini |grep Loaded编辑fix_pathinfo的设置内容。在这个文件中,找到设置cgi.fix_pathinfo的参数。 这将用分号(;)注释掉,默认设置为“1”。这是一个非常不安全的设置,因为它告诉PHP尝试执行最近的文件,如果找不到请求的PHP文件,它可以找到它。 这可以允许用户以一种允许他们执行不应允许执行的脚本的方式制作PHP请求。取消注释并将其设置为“0”,如下所示:cgi.fix_pathinfo=0配置nginx的PHP解析nginx.conf 文件通常在“/etc/nginx”目录下。通常有下面的描述。user nginx;...http{...include /etc/nginx/conf.d/*.conf;}注意,这里用户用从nginx改为www-data。user www-data www-data;#fastcgi_pass localhost:9000 #改成 fastcgi_pass unix:/run/php/php7.2-fpm.sock; #默认安装是sock方式 #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #改成 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2023年01月12日
88 阅读
0 评论
0 点赞
2023-01-07
解决maven出现“连接到http://repo.maven.apache.org被拒绝”的问题
1、原因这个问题的原因就是无法连接到http://repo.maven.apache.org/maven2镜像2、解决办法修改maven默认镜像仓库地址为国内可用的镜像地址,比如这里推荐阿里的镜像仓库地址http://maven.aliyun.com/nexus/content/groups/public/该镜像仓库地址亲测可用,而且速度极快,强烈推荐3、操作步骤1、找到你IDEA配置的maven位置
2023年01月07日
163 阅读
0 评论
0 点赞
2023-01-03
修改idea的maven3远程镜像仓库地址settings.xml
1.找到idea安装目录中maven3插件位置以我自己的安装目录为例: D:\Program Files\JetBrains\IntelliJ IDEA 2020.3\plugins\maven\lib\maven3\conf 修改 settings.xml 文件,原文件几乎没有任何配置。2.修改镜像仓库远程地址在 mirrors 标签中加入以下部分,配置私有镜像仓库地址。可以在私有镜像仓库缓存中央仓库jar包,可以加速本地下载jar包速度。<mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <blocked>true</blocked> </mirror>中央仓库<mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <name>maven-public</name> <url>https://repo1.maven.org/maven2/</url> <blocked>true</blocked> </mirror>阿里镜像仓库<mirror> <id>public</id> <mirrorOf>*</mirrorOf> <name>aliyun nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <blocked>true</blocked> </mirror>或<mirror> <id>mirror-aliyun-releases</id> <mirrorOf>*</mirrorOf> <name>aliyun maven mirror</name> <url>https://maven.aliyun.com/repository/public</url> <blocked>true</blocked> </mirror><?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -s /path/to/user/settings.xml | | 2. Global Level. This settings.xml file provides configuration for all Maven | users on a machine (assuming they're all using the same Maven | installation). It's normally provided in | ${maven.conf}/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -gs /path/to/global/settings.xml | | The sections in this sample file are intended to give you a running start at | getting the most out of your Maven installation. Where appropriate, the default | values (values used when the setting is not specified) are provided. | |--> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <!-- interactiveMode | This will determine whether maven prompts you when it needs input. If set to false, | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true <interactiveMode>true</interactiveMode> --> <!-- offline | Determines whether maven should attempt to connect to the network when executing a build. | This will have an effect on artifact downloads, artifact deployment, and others. | | Default: false <offline>false</offline> --> <!-- pluginGroups | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list. |--> <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> </pluginGroups> <!-- proxies | This is a list of proxies which can be used on this machine to connect to the network. | Unless otherwise specified (by system property or command-line switch), the first proxy | specification in this list marked as active will be used. |--> <proxies> <!-- proxy | Specification for one proxy, to be used in connecting to the network. | <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>80</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> --> </proxies> <!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection to a remote server. |--> <servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id' attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | <server> <id>deploymentRepo</id> <username>repouser</username> <password>repopwd</password> </server> --> <!-- Another sample, using keys to authenticate. <server> <id>siteServer</id> <privateKey>/path/to/private/key</privateKey> <passphrase>optional; leave empty if not used.</passphrase> </server> --> </servers> <!-- mirrors | This is a list of mirrors to be used in downloading artifacts from remote repositories. | | It works like this: a POM may declare a repository to use in resolving certain artifacts. | However, this repository may have problems with heavy traffic at times, so people have mirrored | it to several places. | | That repository definition will have a unique id, so we can create a mirror reference for that | repository, to be used as an alternate download site. The mirror site will be the preferred | server for that repository. |--> <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <mirror> <id>maven-public</id> <mirrorOf>*</mirrorOf> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <blocked>true</blocked> </mirror> </mirrors> <!-- profiles | This is a list of profiles which can be activated in a variety of ways, and which can modify | the build process. Profiles provided in the settings.xml are intended to provide local machine- | specific paths and repository locations which allow the build to work in the local environment. | | For example, if you have an integration testing plugin - like cactus - that needs to know where | your Tomcat instance is installed, you can provide a variable here such that the variable is | dereferenced during the build process to configure the cactus plugin. | | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles | section of this document (settings.xml) - will be discussed later. Another way essentially | relies on the detection of a system property, either matching a particular value for the property, | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'. | Finally, the list of active profiles can be specified directly from the command line. | | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact | repositories, plugin repositories, and free-form properties to be used as configuration | variables for plugins in the POM. | |--> <profiles> <!-- profile | Specifies a set of introductions to the build process, to be activated using one or more of the | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/> | or the command line, profiles have to have an ID that is unique. | | An encouraged best practice for profile identification is to use a consistent naming convention | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc. | This will make it more intuitive to understand what the set of introduced profiles is attempting | to accomplish, particularly when you only have a list of profile id's for debug. | | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo. <profile> <id>jdk-1.4</id> <activation> <jdk>1.4</jdk> </activation> <repositories> <repository> <id>jdk14</id> <name>Repository for JDK 1.4 builds</name> <url>http://www.myhost.com/maven/jdk14</url> <layout>default</layout> <snapshotPolicy>always</snapshotPolicy> </repository> </repositories> </profile> --> <!-- | Here is another profile, activated by the system property 'target-env' with a value of 'dev', | which provides a specific path to the Tomcat instance. To use this, your plugin configuration | might hypothetically look like: | | ... | <plugin> | <groupId>org.myco.myplugins</groupId> | <artifactId>myplugin</artifactId> | | <configuration> | <tomcatLocation>${tomcatPath}</tomcatLocation> | </configuration> | </plugin> | ... | | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to | anything, you could just leave off the <value/> inside the activation-property. | <profile> <id>env-dev</id> <activation> <property> <name>target-env</name> <value>dev</value> </property> </activation> <properties> <tomcatPath>/path/to/tomcat/instance</tomcatPath> </properties> </profile> --> </profiles> <!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile> </activeProfiles> --> </settings>3.也可以直接在pom.xml修改镜像仓库远程地址<repositories> <repository> <id>maven-public</id> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <releases> <enabled>true</enabled> </releases> </repository> <repository> <id>public</id> <name>aliyun nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>maven-public</id> <name>maven-public</name> <url>http://192.168.2.199:8080/repository/maven-public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>public</id> <name>aliyun nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories>
2023年01月03日
81 阅读
0 评论
0 点赞
1
2
3
...
14
您的IP: