Nexus:Maven: Difference between revisions
Jump to navigation
Jump to search
Line 67: | Line 67: | ||
==Security== | ==Security== | ||
<code>'''vim $HOME/.m2/settings.xm'''l</code> | <code>'''vim $HOME/.m2/settings.xm'''l</code> | ||
<source lang=" | <source lang="xml"> | ||
NEXUS_M2_AUTH="Basic `echo -n 'username:password'|openssl base64`";\ | NEXUS_M2_AUTH="Basic `echo -n 'username:password'|openssl base64`";\ | ||
cat <<EOF >> $HOME/.m2/settings-academia.xml | cat <<EOF >> $HOME/.m2/settings-academia.xml | ||
Line 138: | Line 138: | ||
---- | ---- | ||
<code>'''vim ./pom.xml'''</code> | <code>'''vim ./pom.xml'''</code> | ||
<source lang="xml> | <source lang="xml"> | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
Line 169: | Line 169: | ||
</source> | </source> | ||
---- | ---- | ||
<source lang="bash> | <source lang="bash"> | ||
mvn clean install | mvn clean install | ||
mvn clean deploy -Djava.net.preferIPv4Stack=true | mvn clean deploy -Djava.net.preferIPv4Stack=true |
Revision as of 11:17, 15 August 2020
Recipe Types: ────────────────────────────────────────── nexus/repository/recipe/types ─┬──────────────────────────────────────── │ ├─ group ├─ proxy └─ host |
Repositories: ────────────────────────────────────────── https://cdn.chorke.org/nexus/repository/ ─┬──────────────────────────────────────── ├─ m2-snapshots/ [host ] ├─ m2-releases/ [host ] ├─ m2-central/ [proxy] └─ m2/ [group] |
Blob Store
Admin : https://cdn.chorke.org/nexus/#admin/repository/blobstores Path : /nexus-data/blobs/m2-snapshots Name : m2-snapshots
Admin : https://cdn.chorke.org/nexus/#admin/repository/blobstores Path : /nexus-data/blobs/m2-releases Name : m2-releases
Admin : https://cdn.chorke.org/nexus/#admin/repository/blobstores Path : /nexus-data/blobs/m2-public Name : m2-central
Admin : https://cdn.chorke.org/nexus/#admin/repository/blobstores Path : /nexus-data/blobs/m2-group Name : m2-group
Repository
Admin : https://cdn.chorke.org/nexus/#admin/repository/repositories Version : Snapshot Layout : Strict Deploy : Allow redeploy Storage : m2-snapshots Name : m2-snapshots
Admin : https://cdn.chorke.org/nexus/#admin/repository/repositories Version : Release Layout : Strict Deploy : Disable redeploy Storage : m2-releases Name : m2-releases
Admin : https://cdn.chorke.org/nexus/#admin/repository/repositories Version : Release Layout : Permissive proxy : https://repo1.maven.org/maven2/ Storage : m2-central Name : m2-central
Admin : https://cdn.chorke.org/nexus/#admin/repository/repositories Members : m2-snapshots, m2-releases, m2-central Storage : m2-group Name : m2
Security
vim $HOME/.m2/settings.xml
NEXUS_M2_AUTH="Basic `echo -n 'username:password'|openssl base64`";\
cat <<EOF >> $HOME/.m2/settings-academia.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- <localRepository>\${user.home}/.m2/repository</localRepository> -->
<servers>
<server>
<id>academia</id>
<configuration>
<httpHeaders>
<property>
<name>Authorization</name>
<value>$NEXUS_M2_AUTH</value>
</property>
</httpHeaders>
</configuration>
</server>
<server>
<id>academia.snapshots</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>academia.releases</id>
<username>username</username>
<password>password</password>
</server>
</servers>
<mirrors>
<mirror>
<id>academia</id>
<name>academia</name>
<url>https://cdn.chorke.org/nexus/repository/m2/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>academia</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>academia</activeProfile>
</activeProfiles>
</settings>
EOF
vim ./pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- skipped -->
<distributionManagement>
<snapshotRepository>
<id>academia.snapshots</id>
<url>https://cdn.chorke.org/nexus/repository/m2-snapshots/</url>
</snapshotRepository>
<repository>
<id>academia.releases</id>
<url>https://cdn.chorke.org/nexus/repository/m2-releases/</url>
</repository>
</distributionManagement>
<!-- skipped -->
<repositories>
<repository>
<id>academia</id>
<url>https://cdn.chorke.org/nexus/repository/m2/</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
<!-- skipped -->
</project>
mvn clean install
mvn clean deploy -Djava.net.preferIPv4Stack=true