Maven: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 28: | Line 28: | ||
==Security== | ==Security== | ||
<source lang="bash"> | <source lang="bash"> | ||
M2_MASTER_PASS=' | M2_MASTER_PASS='<master.password>';\ | ||
M2_SECURITY_XML="${HOME}/.m2/settings-security.xml";\ | M2_SECURITY_XML="${HOME}/.m2/settings-security.xml";\ | ||
printf -v M2_MASTER_HASH '%s' $(mvn --encrypt-master-password ${M2_MASTER_PASS});\ | printf -v M2_MASTER_HASH '%s' $(mvn --encrypt-master-password ${M2_MASTER_PASS});\ | ||
Line 69: | Line 69: | ||
<id>finology</id> | <id>finology</id> | ||
<mirrorOf>*</mirrorOf> | <mirrorOf>*</mirrorOf> | ||
<url>https:// | <url>https://cdn.chorke.org/nexus/repository/m2/</url> | ||
</mirror> | </mirror> | ||
</mirrors> | </mirrors> |
Revision as of 00:35, 16 October 2023
<profile>
<id>ext</id>
<activation>
<file>
<missing>${basedir}/ext</missing>
</file>
</activation>
</profile>
Distribution
<settings>
[...]
<profiles>
<profile>
<id>nex</id>
<properties>
<altSnapshotDeploymentRepository>snapshots::default::https://nex.chorke.org/repository/maven/snapshots</altSnapshotDeploymentRepository>
<altReleaseDeploymentRepository>releases::default::https://nex.chorke.org/repository/maven/releases</altReleaseDeploymentRepository>
</properties>
</profile>
</profiles>
</settings>
Security
M2_MASTER_PASS='<master.password>';\
M2_SECURITY_XML="${HOME}/.m2/settings-security.xml";\
printf -v M2_MASTER_HASH '%s' $(mvn --encrypt-master-password ${M2_MASTER_PASS});\
if [ ! -f ${M2_SECURITY_XML} ]||[ ! -s ${M2_SECURITY_XML} ];then\
cat << EOF | tee ${M2_SECURITY_XML} >/dev/null
<?xml version="1.0" encoding="UTF-8"?>
<settingsSecurity>
<master>${M2_MASTER_HASH}</master>
</settingsSecurity>
EOF
fi
M2_NEXUS_USER='<nexus.username>';\
M2_NEXUS_PASS='<nexus.password>';\
M2_SETTINGS_XML="${HOME}/.m2/settings.xml";\
printf -v M2_NEXUS_HASH '%s' $(mvn --encrypt-password ${M2_NEXUS_PASS});\
if [ ! -f ${M2_SETTINGS_XML} ]||[ ! -s ${M2_SETTINGS_XML} ];then\
cat << EOF | tee ${M2_SETTINGS_XML} >/dev/null
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<servers>
<server>
<id>finology-releases</id>
<username>${M2_NEXUS_USER}</username>
<password>${M2_NEXUS_HASH}</password>
</server>
<server>
<id>finology-snapshots</id>
<username>${M2_NEXUS_USER}</username>
<password>${M2_NEXUS_HASH}</password>
</server>
</servers>
<mirrors>
<mirror>
<id>finology</id>
<mirrorOf>*</mirrorOf>
<url>https://cdn.chorke.org/nexus/repository/m2/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>finology</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
EOF
fi