├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .travis.yml ├── LICENSE.txt ├── README.adoc ├── appveyor.yml ├── checkstyle.xml ├── doc ├── images │ ├── srcdeps-for-maven.svg │ └── srcdeps-logo-with-text.svg └── srcdeps-maven-configuration.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml ├── srcdeps-maven-base ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── srcdeps │ └── mvn │ ├── Constants.java │ └── config │ └── ConfigurationProducer.java ├── srcdeps-maven-enforcer ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── enforcer │ │ └── SrcdepsEnforcer.java │ └── test │ └── java │ └── org │ └── srcdeps │ └── mvn │ └── enforcer │ └── SrcdepsEnforcerTest.java ├── srcdeps-maven-local-repository ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── srcdeps │ └── mvn │ └── localrepo │ ├── SrcdepsLocalRepositoryManager.java │ └── SrcdepsRepositoryManagerFactory.java ├── srcdeps-maven-plugin ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── plugin │ │ ├── ExtensionsXmlUtils.java │ │ ├── Ga.java │ │ ├── SrcdepsInitMojo.java │ │ └── SrcdepsUpgradeMojo.java │ └── test │ ├── java │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── plugin │ │ ├── ExtensionsXmlUtilsTest.java │ │ ├── ScmUrlChainTest.java │ │ └── SrcdepsInitMojoTest.java │ └── projects │ └── parent-with-jar │ ├── jar │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── plugin │ │ └── it │ │ └── Main.java │ └── pom.xml └── srcdeps-maven-quickstarts ├── pom.xml ├── src └── test │ ├── java │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── itest │ │ ├── AbstractMavenDepsIntegrationTest.java │ │ ├── LocalMavenRepoVerifier.java │ │ ├── MavenDepsGradleIntegrationTest.java │ │ ├── MavenDepsMavenIntegrationTest.java │ │ ├── MavenFailWithIntegrationTest.java │ │ ├── MavenMasterConfigIntegrationTest.java │ │ ├── SrcdepsTestResources.java │ │ ├── TestUtils.java │ │ └── WrappedMavenExecutionResult.java │ └── resources │ └── settings-mrm.xml ├── srcdeps-mvn-git-bom-quickstart ├── .mvn │ └── extensions.xml ├── pom.xml ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── mvn │ │ │ └── quickstarts │ │ │ └── git │ │ │ └── parent │ │ │ └── AppClient.java │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── quickstarts │ │ └── git │ │ └── parent │ │ └── AppClientTest.java └── srcdeps.yaml ├── srcdeps-mvn-git-branch-quickstart ├── .mvn │ └── extensions.xml ├── api │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── branch │ │ └── AppClient.java ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── branch │ │ │ └── AppClientImpl.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── branch │ │ └── AppClientTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-gradle-source-dependency-quickstart ├── .mvn │ └── extensions.xml ├── README.adoc ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── revision │ │ │ └── gradle │ │ │ └── GreetingApp.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── revision │ │ └── gradle │ │ └── GreetingAppTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-include-required-quickstart ├── .mvn │ └── extensions.xml ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── interdep │ │ │ └── Interdep.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── interdep │ │ └── InterdepTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-interdep-modules-quickstart ├── .mvn │ └── extensions.xml ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── interdep │ │ │ └── Interdep.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── interdep │ │ └── InterdepTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-master-config ├── .mvn │ └── extensions.xml ├── pom.xml ├── src │ └── test │ │ ├── dependency-projects │ │ ├── srcdeps-mvn-git-master-config-hello-decorator │ │ │ ├── .gitignore │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── srcdeps │ │ │ │ └── mvn │ │ │ │ └── quickstarts │ │ │ │ └── master │ │ │ │ └── config │ │ │ │ └── hello │ │ │ │ └── NameDecorator.java │ │ └── srcdeps-mvn-git-master-config-hello │ │ │ ├── .gitignore │ │ │ ├── pom.xml │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── mvn │ │ │ └── quickstarts │ │ │ └── master │ │ │ └── config │ │ │ └── hello │ │ │ └── decorator │ │ │ ├── Greeter.java │ │ │ └── Hello.java │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── quickstarts │ │ └── master │ │ └── config │ │ └── HelloDecoratorTest.java └── srcdeps.yaml ├── srcdeps-mvn-git-parent-quickstart ├── .mvn │ └── extensions.xml ├── pom.xml ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── mvn │ │ │ └── quickstarts │ │ │ └── git │ │ │ └── parent │ │ │ └── AppClient.java │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── quickstarts │ │ └── git │ │ └── parent │ │ └── AppClientTest.java └── srcdeps.yaml ├── srcdeps-mvn-git-profile-and-properties-quickstart ├── .mvn │ └── extensions.xml ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── prop │ │ │ └── profile │ │ │ └── GreetingConsumer.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── prop │ │ └── profile │ │ └── GreetingConsumerTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-profile-quickstart ├── .mvn │ └── extensions.xml ├── pom.xml ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── mvn │ │ │ └── quickstarts │ │ │ └── git │ │ │ └── parent │ │ │ └── AppClient.java │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── quickstarts │ │ └── git │ │ └── parent │ │ └── AppClientTest.java └── srcdeps.yaml ├── srcdeps-mvn-git-revision-non-master-quickstart ├── .mvn │ └── extensions.xml ├── jar │ └── pom.xml ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-revision-quickstart ├── .mvn │ └── extensions.xml ├── README.adoc ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── revision │ │ │ └── AppClient.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── revision │ │ └── AppClientTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-snapshot-quickstart ├── .mvn │ └── extensions.xml ├── README.adoc ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── revision │ │ │ └── AppClient.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── revision │ │ └── AppClientTest.java ├── pom.xml └── srcdeps.yaml ├── srcdeps-mvn-git-tag-quickstart ├── .mvn │ └── extensions.xml ├── jar │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── srcdeps │ │ │ └── quickstarts │ │ │ └── mvn │ │ │ └── git │ │ │ └── revision │ │ │ └── AppClient.java │ │ └── test │ │ └── java │ │ └── org │ │ └── srcdeps │ │ └── quickstarts │ │ └── mvn │ │ └── git │ │ └── revision │ │ └── AppClientTest.java ├── pom.xml └── srcdeps.yaml └── srcdeps-mvnw-git-quickstart ├── .mvn └── extensions.xml ├── pom.xml ├── src ├── main │ └── java │ │ └── org │ │ └── srcdeps │ │ └── mvn │ │ └── quickstarts │ │ └── git │ │ └── parent │ │ └── AppClient.java └── test │ └── java │ └── org │ └── srcdeps │ └── mvn │ └── quickstarts │ └── git │ └── parent │ └── AppClientTest.java └── srcdeps.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | pom.xml.next 7 | release.properties 8 | 9 | # Eclipse 10 | .project 11 | .classpath 12 | .settings/ 13 | bin/ 14 | 15 | # IDEA 16 | .idea 17 | *.ipr 18 | *.iml 19 | *.iws 20 | 21 | # NetBeans 22 | nb-configuration.xml 23 | 24 | # KDE 25 | .directory 26 | 27 | # OSX 28 | .DS_Store -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srcdeps/srcdeps-maven/f41195d06147f32670059f5788b5677fc37161b8/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2018 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | # Enable container-based infrastructure 3 | # see http://docs.travis-ci.com/user/workers/container-based-infrastructure/ 4 | sudo: false 5 | jdk: 6 | - openjdk8 7 | cache: 8 | directories: 9 | - $HOME/.m2/repository 10 | - $HOME/.m2/wrapper 11 | install: 12 | - ./mvnw -version 13 | # license plugin requires full git history 14 | - git fetch --unshallow 15 | script: 16 | - ./mvnw -Prun-its clean install -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2018 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | environment: 19 | JAVA_HOME: C:\Program Files\Java\jdk1.8.0 20 | install: 21 | - cmd: SET PATH=C:\Users\appveyor\.m2\wrapper\dists\apache-maven-3.5.3-bin\2c22a6s60afpuloj4v181qvild\apache-maven-3.5.3\bin;%JAVA_HOME%\bin;%PATH% 22 | build_script: 23 | - .\mvnw.cmd clean install -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn 24 | on_failure: 25 | - echo "failed" 26 | # - type C:\projects\srcdeps-maven\srcdeps-maven-quickstarts\target\test-projects\MavenDepsMavenIntegrationTest_mvnGitSnapshotRevision[3.5.3]_srcdeps-mvn-git-snapshot-quickstart\log.txt 27 | cache: 28 | - C:\Users\appveyor\.m2\wrapper 29 | -------------------------------------------------------------------------------- /checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /doc/srcdeps-maven-configuration.adoc: -------------------------------------------------------------------------------- 1 | image::doc/images/srcdeps-for-maven.svg[ec4j,height=60,alt=srcdeps for Maven] 2 | 3 | = `srcdeps` for Maven Configuration Guide 4 | 5 | The behavior of `srcdeps` is controlled through two configuration files: 6 | 7 | <> - make Maven aware of `srcdeps` + 8 | <> - the main srcdeps configuration file 9 | 10 | Note that both files can be initialized by running our `srcdeps-maven-plugin`'s `init` mojo the in the root 11 | directory of your project tree: 12 | 13 | [source,shell] 14 | ---- 15 | mvn org.srcdeps.mvn:srcdeps-maven-plugin:init 16 | ---- 17 | 18 | [[extensions-xml]] 19 | == 1. `.mvn/extensions.xml` 20 | 21 | `srcdeps-maven-local-repository` needs to be declared as a Maven Core Extension in `.mvn/extensions.xml` 22 | of the maven project. 23 | 24 | [source,xml] 25 | ---- 26 | 27 | 28 | 29 | org.l2x6.maven.srcdeps 30 | srcdeps-maven-local-repository 31 | 4.0.0 32 | 33 | 34 | org.srcdeps.mvn 35 | srcdeps-maven-enforcer 36 | 4.0.0 37 | 38 | 39 | ---- 40 | 41 | [[srcdeps-yaml]] 42 | == 2. `srcdeps.yaml` 43 | 44 | A few settings have to be configured in `srcdeps.yaml` file. Especially, the mapping from groupId's of 45 | dependencies to SCM repositories where their sources reside. This is a minimal `srcdeps.yaml` file. Please 46 | refer to link:https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml[srcdeps.yaml reference] for more 47 | details. 48 | 49 | The `srcdeps.yaml` file has to be located in the root directory of a Maven source tree. Before version 3.1.0 of 50 | `srcdeps-maven` the location was `.mvn/srcdeps.yaml` and it is still supported as a fall back location in case 51 | there is no `srcdeps.yaml` in the root directory. 52 | 53 | [source,yaml] 54 | ---- 55 | configModelVersion: 2.4 56 | repositories: 57 | org.my-group: 58 | includes: 59 | - org.my-group:*:* # if one of the includes matches the groupId of a -SRC- dependency, 60 | # then the following urls will be used to build that dependency 61 | urls: 62 | - https://github.com/my-org/my-project.git # If you list multiple SCM repos here then only 63 | # the first successful checkout will count 64 | 65 | ---- 66 | 67 | == 3. Setting dependency versions 68 | 69 | There are two alternative ways how you can define which source repository reference should be used to build your 70 | dependency: in `pom.xml` or in `srcdeps.yaml`. 71 | 72 | [[srcdeps-in-pom-xml]] 73 | === 3.1 In `pom.xml` 74 | 75 | Defining source repository refs in `pom.xml` is older and perhaps more straightforward: 76 | 77 | [source,yaml] 78 | ---- 79 | 80 | org.my-group 81 | my-artifact 82 | 0.0.1-SRC-revision-66ea95d890531f4eaaa5aa04a9b1c69b409dcd0b 83 | 84 | ---- 85 | 86 | The `-SRC-` infix in the version makes `srcdeps-maven-local-repository` detect the dependency as source 87 | dependency. The part after the `-SRC-` infix is supposed to be a dash separated pair of `refType` and `refName`. 88 | `refType` is one of `revision`, `branch` or `tag` and the `refName` is the actual commitId, branch name or 89 | tag name. 90 | 91 | Examples: 92 | 93 | * `0.0.1-SRC-revision-66ea95d890531f4eaaa5aa04a9b1c69b409dcd0b` 94 | * `1.2.3-SRC-branch-1.2.x` 95 | * `2.0.1-SRC-tag-2.0.1` 96 | 97 | The part before `-SRC-` has no significance for `srcdeps`. It also has no significance for Maven. It may be 98 | important for Gradle when resolving version conflicts; Gradle prefers higher versions by default. A practical reason 99 | to keep it there is to have a mnemonic that helps a human reader to set her expectations about the compatibility of 100 | the dependency. 101 | 102 | [[srcdeps-in-srcdeps-yaml]] 103 | === 3.2 in `srcdeps.yaml` (since `srcdeps-maven` 3.3.0) 104 | 105 | If you do not want or cannot change the `pom.xml`, you can achieve a similar result by using 106 | `buildVersionPattern` and `buildRef` of `srcdeps.yaml`. 107 | 108 | [source,yaml] 109 | ---- 110 | configModelVersion: 2.4 111 | repositories: 112 | org.my-group: 113 | includes: 114 | - org.my-group:*:* # if one of the includes matches the groupId of a -SRC- dependency, 115 | # then the following urls will be used to build that dependency 116 | urls: 117 | - https://github.com/my-org/my-project.git # If you list multiple SCM repos here then only 118 | # the first successful checkout will count 119 | buildVersionPattern: .*-SNAPSHOT # versions matching .*-SNAPSHOT pattern will be built 120 | buildRef: branch-1.2.x # using branch 1.2.x from https://github.com/my-org/my-project.git 121 | ---- 122 | 123 | If you combine the above `srcdeps.yaml` with a `pom.xml` like the following 124 | 125 | ---- 126 | 127 | org.my-group 128 | my-artifact 129 | 0.0.1-SNAPSHOT 130 | 131 | ---- 132 | 133 | `srcdeps` will build the snapshot 134 | of `org.my-group:my-artifact` from the remote branch 1.2.x every time you build the dependent project. -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 39 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 40 | 41 | @REM set %HOME% to equivalent of $HOME 42 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 43 | 44 | @REM Execute a user defined script before this one 45 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 46 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 47 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 48 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 49 | :skipRcPre 50 | 51 | @setlocal 52 | 53 | set ERROR_CODE=0 54 | 55 | @REM To isolate internal variables from possible post scripts, we use another setlocal 56 | @setlocal 57 | 58 | @REM ==== START VALIDATION ==== 59 | if not "%JAVA_HOME%" == "" goto OkJHome 60 | 61 | echo. 62 | echo Error: JAVA_HOME not found in your environment. >&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %* 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | 121 | set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"" 122 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 123 | 124 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS% 125 | if ERRORLEVEL 1 goto error 126 | goto end 127 | 128 | :error 129 | set ERROR_CODE=1 130 | 131 | :end 132 | @endlocal & set ERROR_CODE=%ERROR_CODE% 133 | 134 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 135 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 136 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 137 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 138 | :skipRcPost 139 | 140 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 141 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 142 | 143 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 144 | 145 | exit /B %ERROR_CODE% 146 | -------------------------------------------------------------------------------- /srcdeps-maven-base/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | org.srcdeps.mvn 25 | srcdeps-maven-parent 26 | 4.0.1-SNAPSHOT 27 | 28 | 29 | srcdeps-maven-base 30 | takari-maven-component 31 | 32 | Srcdeps Maven Base 33 | Some base classes used by other srcdeps Maven components 34 | 35 | 36 | 37 | 38 | javax.inject 39 | javax.inject 40 | provided 41 | 42 | 43 | 44 | 45 | org.eclipse.sisu 46 | org.eclipse.sisu.inject 47 | provided 48 | 49 | 50 | 51 | org.srcdeps.core 52 | srcdeps-core 53 | 54 | 55 | 56 | org.srcdeps.core 57 | srcdeps-core-config-yaml 58 | 59 | 60 | 61 | org.slf4j 62 | slf4j-api 63 | provided 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /srcdeps-maven-base/src/main/java/org/srcdeps/mvn/Constants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2019 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn; 18 | 19 | public interface Constants { 20 | 21 | /** See the bin/mvn or bin/mvn.cmd script of your maven distro, where maven.multiModuleProjectDirectory is set */ 22 | String MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY = "maven.multiModuleProjectDirectory"; 23 | 24 | String SRCDEPS_MAVEN_VERSION = "4.0.1-SNAPSHOT"; // @srcdeps.version@ 25 | 26 | } 27 | -------------------------------------------------------------------------------- /srcdeps-maven-base/src/main/java/org/srcdeps/mvn/config/ConfigurationProducer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.config; 18 | 19 | import java.nio.file.Path; 20 | import java.nio.file.Paths; 21 | 22 | import javax.inject.Named; 23 | 24 | import org.srcdeps.config.yaml.YamlConfigurationReader; 25 | import org.srcdeps.core.config.Configuration; 26 | import org.srcdeps.core.config.ConfigurationException; 27 | import org.srcdeps.core.config.ConfigurationLocator; 28 | import org.srcdeps.core.config.Maven; 29 | import org.srcdeps.core.config.tree.walk.DefaultsAndInheritanceVisitor; 30 | import org.srcdeps.core.config.tree.walk.OverrideVisitor; 31 | import org.srcdeps.mvn.Constants; 32 | 33 | @Named 34 | public class ConfigurationProducer { 35 | 36 | private final Configuration configuration; 37 | private final Path multimoduleProjectRootDirectory; 38 | 39 | public ConfigurationProducer() throws ConfigurationException { 40 | super(); 41 | 42 | String basePathString = System.getProperty(Constants.MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY); 43 | if (basePathString == null || basePathString.isEmpty()) { 44 | throw new RuntimeException(String.format("The system property %s must not be null or empty", 45 | Constants.MAVEN_MULTI_MODULE_PROJECT_DIRECTORY_PROPERTY)); 46 | } 47 | multimoduleProjectRootDirectory = Paths.get(basePathString).toAbsolutePath(); 48 | 49 | this.configuration = new ConfigurationLocator(System.getProperties(), true) // 50 | .locate(multimoduleProjectRootDirectory, new YamlConfigurationReader()) // 51 | .accept(new OverrideVisitor(System.getProperties())) // 52 | .accept(new DefaultsAndInheritanceVisitor()) // 53 | .forwardPropertyValue(Maven.getSrcdepsMavenVersionProperty(), Constants.SRCDEPS_MAVEN_VERSION) 54 | .build(); 55 | 56 | } 57 | 58 | public Configuration getConfiguration() { 59 | return configuration; 60 | } 61 | 62 | /** 63 | * @return the root directory of the Maven multimodule project. 64 | */ 65 | public Path getMultimoduleProjectRootDirectory() { 66 | return multimoduleProjectRootDirectory; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /srcdeps-maven-enforcer/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | org.srcdeps.mvn 25 | srcdeps-maven-parent 26 | 4.0.1-SNAPSHOT 27 | 28 | 29 | srcdeps-maven-enforcer 30 | takari-maven-component 31 | 32 | Srcdeps Maven Enforcer 33 | A safeguard to prevent usage of srcdeps as defined in srcdeps.yaml 34 | 35 | 36 | 37 | 38 | javax.inject 39 | javax.inject 40 | provided 41 | 42 | 43 | 44 | junit 45 | junit 46 | test 47 | 48 | 49 | 50 | org.apache.maven 51 | maven-artifact 52 | provided 53 | 54 | 55 | 56 | org.apache.maven 57 | maven-core 58 | provided 59 | 60 | 61 | 62 | org.apache.maven 63 | maven-model 64 | provided 65 | 66 | 67 | 68 | org.apache.maven 69 | maven-plugin-api 70 | provided 71 | 72 | 73 | 74 | org.eclipse.aether 75 | aether-api 76 | provided 77 | 78 | 79 | org.eclipse.aether 80 | aether-spi 81 | provided 82 | 83 | 84 | org.eclipse.aether 85 | aether-impl 86 | provided 87 | 88 | 89 | 90 | org.eclipse.sisu 91 | org.eclipse.sisu.inject 92 | provided 93 | 94 | 95 | 96 | org.srcdeps.core 97 | srcdeps-core 98 | 99 | 100 | 101 | org.srcdeps.core 102 | srcdeps-core-config-yaml 103 | 104 | 105 | 106 | org.srcdeps.mvn 107 | srcdeps-maven-base 108 | 109 | 110 | 111 | org.slf4j 112 | slf4j-api 113 | provided 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /srcdeps-maven-local-repository/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | org.srcdeps.mvn 25 | srcdeps-maven-parent 26 | 4.0.1-SNAPSHOT 27 | 28 | 29 | srcdeps-maven-local-repository 30 | takari-maven-component 31 | 32 | Srcdeps Maven Local Repository 33 | A srcdeps implementation of org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory 34 | 35 | 36 | 37 | 38 | io.takari.aether 39 | takari-local-repository 40 | 41 | 42 | 43 | javax.inject 44 | javax.inject 45 | provided 46 | 47 | 48 | 49 | org.apache.maven 50 | maven-core 51 | provided 52 | 53 | 54 | 55 | org.eclipse.aether 56 | aether-api 57 | provided 58 | 59 | 60 | org.eclipse.aether 61 | aether-spi 62 | provided 63 | 64 | 65 | org.eclipse.aether 66 | aether-impl 67 | provided 68 | 69 | 70 | 71 | org.eclipse.sisu 72 | org.eclipse.sisu.inject 73 | provided 74 | 75 | 76 | 77 | org.srcdeps.core 78 | srcdeps-core 79 | 80 | 81 | 82 | org.srcdeps.core 83 | srcdeps-core-config-yaml 84 | 85 | 86 | 87 | org.srcdeps.mvn 88 | srcdeps-maven-base 89 | 90 | 91 | 92 | org.slf4j 93 | slf4j-api 94 | provided 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | org.srcdeps.mvn 25 | srcdeps-maven-parent 26 | 4.0.1-SNAPSHOT 27 | 28 | 29 | srcdeps-maven-plugin 30 | takari-maven-plugin 31 | 32 | Srcdeps Maven Plugin 33 | 34 | 35 | 36 | 37 | io.takari.maven.plugins 38 | takari-plugin-testing 39 | test 40 | 41 | 42 | 43 | io.takari.maven.plugins 44 | takari-plugin-integration-testing 45 | pom 46 | test 47 | 48 | 49 | 50 | javax.inject 51 | javax.inject 52 | 53 | 54 | 55 | org.apache.maven 56 | maven-artifact 57 | provided 58 | 59 | 60 | 61 | org.apache.maven 62 | maven-core 63 | provided 64 | 65 | 66 | 67 | org.apache.maven 68 | maven-model 69 | provided 70 | 71 | 72 | 73 | org.apache.maven 74 | maven-model-builder 75 | provided 76 | 77 | 78 | 79 | org.apache.maven 80 | maven-plugin-api 81 | provided 82 | 83 | 84 | 85 | org.apache.maven.plugin-tools 86 | maven-plugin-annotations 87 | provided 88 | 89 | 90 | 91 | org.eclipse.aether 92 | aether-api 93 | provided 94 | 95 | 96 | 97 | org.srcdeps.core 98 | srcdeps-core 99 | 100 | 101 | 102 | org.srcdeps.core 103 | srcdeps-core-config-yaml 104 | 105 | 106 | 107 | org.srcdeps.mvn 108 | srcdeps-maven-base 109 | 110 | 111 | 112 | org.slf4j 113 | slf4j-api 114 | provided 115 | 116 | 117 | 118 | junit 119 | junit 120 | test 121 | 122 | 123 | 124 | xerces 125 | xercesImpl 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | org.apache.maven.plugins 135 | maven-surefire-plugin 136 | 137 | 138 | ${project.build.directory} 139 | ${project.version} 140 | ${project.build.sourceEncoding} 141 | ${project.build.directory}/settings-mrm.xml 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/src/main/java/org/srcdeps/mvn/plugin/Ga.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2017 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.plugin; 18 | 19 | /** 20 | * An immutable {@link #groupId}, {@link #artifactId} pair with a fast {@link #hashCode()} and {@link #equals(Object)}. 21 | * 22 | * @author Peter Palaga 23 | */ 24 | public class Ga implements Comparable { 25 | private final String artifactId; 26 | private final String groupId; 27 | private final int hashCode; 28 | 29 | public Ga(String groupId, String artifactId) { 30 | super(); 31 | this.groupId = groupId; 32 | this.artifactId = artifactId; 33 | this.hashCode = 31 * (31 + artifactId.hashCode()) + groupId.hashCode(); 34 | } 35 | 36 | @Override 37 | public int compareTo(Ga other) { 38 | int g = this.groupId.compareTo(other.groupId); 39 | if (g != 0) { 40 | return g; 41 | } else { 42 | return this.artifactId.compareTo(other.artifactId); 43 | } 44 | } 45 | 46 | @Override 47 | public boolean equals(Object obj) { 48 | if (this == obj) 49 | return true; 50 | if (obj == null) 51 | return false; 52 | if (getClass() != obj.getClass()) 53 | return false; 54 | Ga other = (Ga) obj; 55 | return this.artifactId.equals(other.artifactId) && this.groupId.equals(other.groupId); 56 | } 57 | 58 | public String getArtifactId() { 59 | return artifactId; 60 | } 61 | 62 | public String getGroupId() { 63 | return groupId; 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | return hashCode; 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | return groupId + ":" + artifactId; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/src/test/java/org/srcdeps/mvn/plugin/ScmUrlChainTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2017 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.plugin; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.mvn.plugin.SrcdepsInitMojo.ScmRepositoryIndex.ScmUrlAncestry; 22 | 23 | public class ScmUrlChainTest { 24 | 25 | @Test 26 | public void chain() { 27 | ScmUrlAncestry chain = ScmUrlAncestry.builder() // 28 | .element( 29 | "scm:git:git://git@github.com:arquillian/arquillian-extension-rest.git/arquillian-rest-warp-parent/arquillian-rest-warp-api", 30 | new Ga("org.jboss.arquillian.extension", "arquillian-rest-warp-api")) 31 | .element( 32 | "scm:git:git://git@github.com:arquillian/arquillian-extension-rest.git/arquillian-rest-warp-parent", 33 | new Ga("org.jboss.arquillian.extension", "arquillian-rest-warp-parent")) 34 | .build(); 35 | 36 | Assert.assertTrue(chain.hasUrl()); 37 | Assert.assertEquals(2, chain.getLength()); 38 | Assert.assertEquals("git:git://git@github.com:arquillian/arquillian-extension-rest.git", chain.getUrl()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/src/test/java/org/srcdeps/mvn/plugin/SrcdepsInitMojoTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2019 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.plugin; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.file.Files; 22 | import java.nio.file.Path; 23 | import java.nio.file.Paths; 24 | 25 | import org.junit.Assert; 26 | import org.junit.BeforeClass; 27 | import org.junit.Rule; 28 | import org.junit.Test; 29 | import org.junit.runner.RunWith; 30 | import org.slf4j.Logger; 31 | import org.slf4j.LoggerFactory; 32 | import org.srcdeps.core.config.Maven; 33 | import org.srcdeps.core.util.SrcdepsCoreUtils; 34 | import org.srcdeps.mvn.Constants; 35 | 36 | import io.takari.maven.testing.TestResources; 37 | import io.takari.maven.testing.executor.MavenExecution; 38 | import io.takari.maven.testing.executor.MavenRuntime; 39 | import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder; 40 | import io.takari.maven.testing.executor.MavenVersions; 41 | import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner; 42 | 43 | @RunWith(MavenJUnitTestRunner.class) 44 | @MavenVersions({ "3.3.1" }) 45 | public class SrcdepsInitMojoTest { 46 | private static final Path basedir = Paths.get(System.getProperty("basedir", new File("").getAbsolutePath())); 47 | 48 | private static final String encoding = System.getProperty("project.build.sourceEncoding"); 49 | 50 | private static final String EXTENSIONS_XML_TEMPLATE = "\n" + // 51 | "\n" + // 52 | " \n" + // 53 | " org.srcdeps.mvn\n" + // 54 | " srcdeps-maven-local-repository\n" + // 55 | " %s\n" + // 56 | " \n" + // 57 | " \n" + // 58 | " org.srcdeps.mvn\n" + // 59 | " srcdeps-maven-enforcer\n" + // 60 | " %s\n" + // 61 | " \n" + // 62 | "\n"; 63 | 64 | private static final Logger log = LoggerFactory.getLogger(SrcdepsInitMojoTest.class); 65 | 66 | private static final String mrmSettingsXmlPath = System.getProperty("mrm.settings.xml"); 67 | 68 | private static final Path mvnLocalRepo; 69 | private static final String projectVersion = System.getProperty("project.version"); 70 | private static final String SRCDEPS_YAML_EXPECTED = "#\n" + // 71 | "# srcdeps.yaml - the srcdeps configuration file\n" + // 72 | "#\n" + // 73 | "# The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml\n" 74 | + // 75 | "#\n" + // 76 | "# This file was generated by the following command:\n" + // 77 | "#\n" + // 78 | "# mvn org.srcdeps.mvn:srcdeps-maven-plugin:init\n" + // 79 | "#\n" + // 80 | "configModelVersion: 3.0\n" + // 81 | "repositories:\n" + // 82 | " org.srcdeps.core:\n" + // 83 | " includes:\n" + // 84 | " - org.srcdeps.core\n" + // 85 | " urls:\n" + // 86 | " - git:git@github.com:srcdeps/srcdeps-core.git\n"; 87 | static { 88 | mvnLocalRepo = basedir.resolve("target/mvn-local-repo"); 89 | } 90 | 91 | @BeforeClass 92 | public static void beforeClass() throws IOException { 93 | 94 | SrcdepsCoreUtils.ensureDirectoryExistsAndEmpty(mvnLocalRepo); 95 | 96 | System.setProperty(Maven.getSrcdepsMavenSettingsProperty(), mrmSettingsXmlPath); 97 | 98 | // Assert.assertTrue("[" + mrmSettingsXmlPath + "] should exist", Files.exists(Paths.get(mrmSettingsXmlPath))); 99 | Assert.assertNotNull("project.build.sourceEncoding property must be set", encoding); 100 | Assert.assertNotNull("project.version property must be set", projectVersion); 101 | } 102 | 103 | @Rule 104 | public final TestResources resources = new TestResources(); 105 | 106 | public final MavenRuntime verifier; 107 | 108 | public SrcdepsInitMojoTest(MavenRuntimeBuilder runtimeBuilder) throws Exception { 109 | this.verifier = runtimeBuilder.withExtension(new File("target/classes").getCanonicalFile()).build(); 110 | } 111 | 112 | @Test 113 | public void initNoArgs() throws Exception { 114 | 115 | File projDir = resources.getBasedir("parent-with-jar"); 116 | 117 | MavenExecution mavenExec = verifier.forProject(projDir) // 118 | .withCliOption("-e"); 119 | 120 | final String srcdepsVersion = Constants.SRCDEPS_MAVEN_VERSION; 121 | 122 | Assert.assertEquals(projectVersion, srcdepsVersion); 123 | 124 | final File srcdepsYamlPath = new File(projDir, "srcdeps.yaml"); 125 | Assert.assertFalse( 126 | String.format("The file [%s] must not exist before the test", srcdepsYamlPath.getAbsolutePath()), 127 | srcdepsYamlPath.exists()); 128 | 129 | final File extensionsXmlPath = new File(projDir, ".mvn/extensions.xml"); 130 | Assert.assertFalse( 131 | String.format("The file [%s] must not exist before the test", extensionsXmlPath.getAbsolutePath()), 132 | extensionsXmlPath.exists()); 133 | 134 | mavenExec // 135 | .execute("org.srcdeps.mvn:srcdeps-maven-plugin:" + projectVersion + ":init") // 136 | .assertErrorFreeLog(); 137 | 138 | String srcdepsYamlContent = new String(Files.readAllBytes(srcdepsYamlPath.toPath()), "utf-8"); 139 | Assert.assertEquals(SRCDEPS_YAML_EXPECTED, srcdepsYamlContent); 140 | 141 | String extensionsXmlContent = new String(Files.readAllBytes(extensionsXmlPath.toPath()), "utf-8"); 142 | Assert.assertEquals(String.format(EXTENSIONS_XML_TEMPLATE, srcdepsVersion, srcdepsVersion), 143 | extensionsXmlContent); 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/src/test/projects/parent-with-jar/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | 24 | org.srcdeps.mvn.plugin.it 25 | test-project-parent 26 | 0.0.1-SNAPSHOT 27 | 28 | 29 | test-project-jar 30 | jar 31 | 32 | 33 | 34 | org.srcdeps.core 35 | srcdeps-core 36 | 2.0.0 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/src/test/projects/parent-with-jar/jar/src/main/java/org/srcdeps/mvn/plugin/it/Main.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2017 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.plugin.it; 18 | 19 | public class Main { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /srcdeps-maven-plugin/src/test/projects/parent-with-jar/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.plugin.it 24 | test-project-parent 25 | 0.0.1-SNAPSHOT 26 | pom 27 | 28 | 29 | jar 30 | 31 | 32 | 33 | 34 | scm:git:git@github.com:srcdeps/scm-in-parent-parent.git 35 | scm:git:git@github.com:srcdeps/scm-in-parent-parent.git 36 | https://github.com/srcdeps/scm-in-parent-parent 37 | head 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/java/org/srcdeps/mvn/itest/LocalMavenRepoVerifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.itest; 18 | 19 | import java.io.IOException; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | import org.srcdeps.core.Gavtc; 24 | import org.srcdeps.core.util.SrcdepsCoreUtils; 25 | 26 | public class LocalMavenRepoVerifier { 27 | private final List expectedNotToExist; 28 | private final List expectedToExist; 29 | private final String project; 30 | 31 | protected LocalMavenRepoVerifier(String project, String[] gavtcPatternsExpectedToExist) { 32 | this(project, gavtcPatternsExpectedToExist, new String[0]); 33 | } 34 | protected LocalMavenRepoVerifier(String project, String[] gavtcPatternsExpectedToExist, 35 | String[] gavtcPatternsExpectedNotToExist) { 36 | this.project = project; 37 | /* delete all expected and unexpected groups */ 38 | this.expectedToExist = new ArrayList<>(); 39 | for (String gavtcPattern : gavtcPatternsExpectedToExist) { 40 | for (Gavtc gavtc : Gavtc.ofPattern(gavtcPattern)) { 41 | expectedToExist.add(gavtc); 42 | } 43 | } 44 | this.expectedNotToExist = new ArrayList<>(); 45 | for (String gavtcPattern : gavtcPatternsExpectedNotToExist) { 46 | for (Gavtc gavtc : Gavtc.ofPattern(gavtcPattern)) { 47 | expectedNotToExist.add(gavtc); 48 | } 49 | } 50 | } 51 | public void clean() throws IOException { 52 | for (Gavtc gavtc : expectedToExist) { 53 | SrcdepsCoreUtils.deleteDirectory(TestUtils.getMvnLocalRepo().resolveGroup(gavtc.getGroupId())); 54 | } 55 | for (Gavtc gavtc : expectedNotToExist) { 56 | SrcdepsCoreUtils.deleteDirectory(TestUtils.getMvnLocalRepo().resolveGroup(gavtc.getGroupId())); 57 | } 58 | } 59 | 60 | public void verify() { 61 | for (Gavtc gavtc : expectedToExist) { 62 | TestUtils.assertExists(TestUtils.getMvnLocalRepo().resolve(gavtc)); 63 | } 64 | for (Gavtc gavtc : expectedNotToExist) { 65 | TestUtils.assertNotExists(TestUtils.getMvnLocalRepo().resolve(gavtc)); 66 | } 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/java/org/srcdeps/mvn/itest/MavenDepsGradleIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2017 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.itest; 18 | 19 | import java.io.IOException; 20 | 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder; 25 | import io.takari.maven.testing.executor.MavenVersions; 26 | import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner; 27 | 28 | @RunWith(MavenJUnitTestRunner.class) 29 | @MavenVersions({ "3.3.1" }) 30 | public class MavenDepsGradleIntegrationTest extends AbstractMavenDepsIntegrationTest { 31 | 32 | private static final String ORG_SRCDEPS_ITEST_GRADLE_GROUPID = "org.srcdeps.test.gradle"; 33 | 34 | public MavenDepsGradleIntegrationTest(MavenRuntimeBuilder runtimeBuilder) throws IOException, Exception { 35 | super(runtimeBuilder); 36 | } 37 | 38 | @Test 39 | public void mvnGitGradleSourceDependency() throws Exception { 40 | final String project = "srcdeps-mvn-git-gradle-source-dependency-quickstart"; 41 | final String srcVersion = "1.0-SRC-revision-e63539236a94e8f6c2d720f8bda0323d1ce4db0f"; 42 | 43 | String[] expectedGavtcs = new String[] { // 44 | pom(groupId(project), project, QUICKSTART_VERSION), // 45 | pomJar(groupId(project), project + "-jar", QUICKSTART_VERSION), // 46 | pomJar(ORG_SRCDEPS_ITEST_GRADLE_GROUPID, "srcdeps-test-artifact-gradle-api", srcVersion), // 47 | pomJar(ORG_SRCDEPS_ITEST_GRADLE_GROUPID, "srcdeps-test-artifact-gradle-impl", srcVersion) // 48 | }; 49 | assertBuild(project, expectedGavtcs, new String[] {}, "clean", "install"); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/java/org/srcdeps/mvn/itest/MavenMasterConfigIntegrationTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.itest; 18 | 19 | import java.io.IOException; 20 | import java.nio.charset.StandardCharsets; 21 | import java.nio.file.Files; 22 | import java.nio.file.Path; 23 | import java.util.AbstractMap; 24 | import java.util.Map; 25 | import java.util.Map.Entry; 26 | 27 | import org.eclipse.jgit.api.Git; 28 | import org.eclipse.jgit.api.errors.GitAPIException; 29 | import org.eclipse.jgit.lib.Constants; 30 | import org.eclipse.jgit.lib.ObjectId; 31 | import org.eclipse.jgit.revwalk.RevCommit; 32 | import org.junit.Test; 33 | import org.junit.runner.RunWith; 34 | import org.slf4j.Logger; 35 | import org.slf4j.LoggerFactory; 36 | import org.srcdeps.core.util.SrcdepsCoreUtils; 37 | 38 | import io.takari.aether.localrepo.TakariLocalRepositoryManagerFactory; 39 | import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder; 40 | import io.takari.maven.testing.executor.MavenVersions; 41 | import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner; 42 | 43 | /** 44 | * @author Peter Palaga 45 | */ 46 | @RunWith(MavenJUnitTestRunner.class) 47 | @MavenVersions({ "3.3.1" }) 48 | public class MavenMasterConfigIntegrationTest extends AbstractMavenDepsIntegrationTest { 49 | static final Logger log = LoggerFactory.getLogger(MavenDepsMavenIntegrationTest.class); 50 | 51 | public MavenMasterConfigIntegrationTest(MavenRuntimeBuilder runtimeBuilder) throws IOException, Exception { 52 | super(runtimeBuilder); 53 | } 54 | 55 | private static Map.Entry prepareGitRepo(String artifactId, Path masterProjectDir, 56 | Path dependencySourceTrees) throws IOException, IllegalStateException, GitAPIException { 57 | final Path path = dependencySourceTrees.resolve(artifactId); 58 | Files.move(masterProjectDir.resolve("src/test/dependency-projects/" + artifactId), path); 59 | 60 | Map.Entry result; 61 | try (Git git = Git.init().setDirectory(path.toFile()).call()) { 62 | git.add().addFilepattern(".").call(); 63 | git.add().setUpdate(true).addFilepattern(".").call(); 64 | final RevCommit commit = git.commit().setMessage("Test commit to " + artifactId + " repo").call(); 65 | final String gitUri = path.resolve(".git").toUri().toString(); 66 | result = new AbstractMap.SimpleImmutableEntry<>(gitUri, commit.getId().name()); 67 | } 68 | 69 | try (Git git = Git.open(path.toFile())) { 70 | ObjectId id = git.getRepository().resolve(Constants.HEAD); 71 | } 72 | 73 | return result; 74 | } 75 | 76 | @Test 77 | public void masterConfig() throws Exception { 78 | 79 | SrcdepsCoreUtils.deleteDirectory(TestUtils.getMvnLocalRepo() 80 | .resolveGroup("org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello")); 81 | SrcdepsCoreUtils.deleteDirectory(TestUtils.getMvnLocalRepo() 82 | .resolveGroup("org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello-decorator")); 83 | 84 | final String project = "srcdeps-mvn-git-master-config"; 85 | final Path masterProjectDir = resources.getBasedirPath(project); 86 | 87 | final Path dependencySourceTrees = TestUtils.createSourceTreesTestRunPath(); 88 | final Entry helloSourceTree = prepareGitRepo("srcdeps-mvn-git-master-config-hello", 89 | masterProjectDir, dependencySourceTrees); 90 | final Entry helloDecoratorSourceTree = prepareGitRepo( 91 | "srcdeps-mvn-git-master-config-hello-decorator", masterProjectDir, dependencySourceTrees); 92 | 93 | final Path srcdepsYamlPath = masterProjectDir.resolve("srcdeps.yaml"); 94 | String srcdepsYaml = new String(Files.readAllBytes(srcdepsYamlPath), StandardCharsets.UTF_8); 95 | srcdepsYaml = srcdepsYaml.replace("${hello.git.url}", 96 | "git:" + helloSourceTree.getKey()); 97 | srcdepsYaml = srcdepsYaml.replace("${hello.git.revision}", helloSourceTree.getValue()); 98 | srcdepsYaml = srcdepsYaml.replace("${hello-decorator.git.url}", 99 | "git:" + helloDecoratorSourceTree.getKey()); 100 | srcdepsYaml = srcdepsYaml.replace("${hello-decorator.git.revision}", helloDecoratorSourceTree.getValue()); 101 | Files.write(srcdepsYamlPath, srcdepsYaml.getBytes(StandardCharsets.UTF_8)); 102 | 103 | WrappedMavenExecutionResult result = build(project, "clean", "test"); 104 | result.assertLogText("SrcdepsLocalRepositoryManager will decorate [" 105 | + TakariLocalRepositoryManagerFactory.class.getName() + "]") // 106 | .assertLogText("BUILD SUCCESS"); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/java/org/srcdeps/mvn/itest/SrcdepsTestResources.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.itest; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.file.Files; 22 | import java.nio.file.Path; 23 | import java.util.regex.Pattern; 24 | 25 | import org.junit.Assert; 26 | import org.junit.runner.Description; 27 | 28 | import io.takari.maven.testing.TestResources; 29 | 30 | /** 31 | * @author Peter Palaga 32 | */ 33 | public class SrcdepsTestResources extends TestResources { 34 | private static final Pattern replacementPattern = Pattern 35 | .compile(Pattern.quote("") + "[^<]+" + Pattern.quote("")); 36 | 37 | private Path basedir; 38 | private String project; 39 | 40 | public SrcdepsTestResources() throws IOException { 41 | super(TestUtils.getSrcdepsQuickstartsPath().toString(), "target/test-projects"); 42 | } 43 | 44 | @Override 45 | public File getBasedir(String project) throws IOException { 46 | if (this.project != null && !this.project.equals(project)) { 47 | throw new IllegalStateException( 48 | "org.srcdeps.mvn.itest.SrcdepsTestResources.getBasedir(String) can be called once only"); 49 | } 50 | this.project = project; 51 | final File result = super.getBasedir(project); 52 | 53 | final Path extensionsXmlPath = result.toPath().resolve(".mvn/extensions.xml"); 54 | 55 | final String extensionsXmlContent = new String(Files.readAllBytes(extensionsXmlPath), TestUtils.getEncoding()); 56 | 57 | final String newContent = replacementPattern.matcher(extensionsXmlContent) 58 | .replaceAll("" + TestUtils.getProjectversion() + ""); 59 | 60 | Assert.assertNotEquals(newContent, extensionsXmlContent); 61 | 62 | Files.write(extensionsXmlPath, newContent.getBytes(TestUtils.getEncoding())); 63 | 64 | this.basedir = result.toPath(); 65 | return result; 66 | } 67 | 68 | public Path getBasedirPath() { 69 | return basedir; 70 | } 71 | 72 | public Path getBasedirPath(String project) throws IOException { 73 | if (this.project == null) { 74 | return getBasedir(project).toPath(); 75 | } else { 76 | return basedir; 77 | } 78 | } 79 | 80 | public void reset() { 81 | this.project = null; 82 | this.basedir = null; 83 | } 84 | 85 | @Override 86 | protected void starting(Description d) { 87 | super.starting(d); 88 | reset(); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/java/org/srcdeps/mvn/itest/TestUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2019 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.itest; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.file.Files; 22 | import java.nio.file.Path; 23 | import java.nio.file.Paths; 24 | import java.time.LocalDateTime; 25 | import java.time.format.DateTimeFormatter; 26 | import java.util.jar.JarInputStream; 27 | import java.util.jar.Manifest; 28 | import java.util.regex.Matcher; 29 | import java.util.regex.Pattern; 30 | 31 | import org.junit.Assert; 32 | import org.srcdeps.core.Gavtc; 33 | import org.srcdeps.core.MavenLocalRepository; 34 | import org.srcdeps.core.fs.CannotAcquireLockException; 35 | import org.srcdeps.core.fs.PathLocker; 36 | import org.srcdeps.core.util.SrcdepsCoreUtils; 37 | 38 | /** 39 | * @author Peter Palaga 40 | */ 41 | public class TestUtils { 42 | private static final Path basedir = Paths.get(System.getProperty("basedir", new File("").getAbsolutePath())); 43 | private static final Path dependencySourceTreesPath; 44 | private static final String encoding = System.getProperty("project.build.sourceEncoding"); 45 | private static final boolean isWindows = System.getProperty("os.name").toLowerCase().contains("win"); 46 | private static final MavenLocalRepository mvnLocalRepo; 47 | private static final Path mvnLocalRepoBasePath; 48 | private static final Path mvnLocalRepoPath; 49 | private static final String projectVersion = System.getProperty("project.version"); 50 | private static final Path srcdepsBuildMetadataPath; 51 | private static final Path srcdepsQuickstartsPath; 52 | static { 53 | srcdepsQuickstartsPath = basedir.resolve("../srcdeps-maven-quickstarts").normalize(); 54 | mvnLocalRepoBasePath = basedir.resolve("target/mvn-local-repo-base"); 55 | mvnLocalRepoPath = basedir.resolve("target/mvn-local-repo"); 56 | dependencySourceTreesPath = basedir.resolve("target/dependency-source-trees"); 57 | srcdepsBuildMetadataPath = basedir.resolve("target/srcdeps/build-metadata"); 58 | mvnLocalRepo = new MavenLocalRepository(mvnLocalRepoPath); 59 | } 60 | 61 | public static void assertExists(Path path) { 62 | Assert.assertTrue(String.format("File or directory does not exist [%s]", path.toString()), Files.exists(path)); 63 | } 64 | 65 | public static void assertNotExists(Path path) { 66 | Assert.assertTrue(String.format("File or directory exists [%s], but should not", path.toString()), 67 | !Files.exists(path)); 68 | } 69 | 70 | public static Path createSourceTreesTestRunPath() throws IOException { 71 | final String subdir = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME).replace(':', '-') + "-" 72 | + ((int) (Math.random() * 1000)); 73 | final Path result = dependencySourceTreesPath.resolve(subdir); 74 | Files.createDirectories(result); 75 | return result; 76 | } 77 | 78 | /** 79 | * Deletes {@code target/srcdeps}. This tends to fail in some cases on Windows for which we do a dirty workaround of 80 | * FS locking the git repo that cannot be deleted, so that it is not re-used by the subsequent test. 81 | * 82 | * @throws IOException 83 | * @throws CannotAcquireLockException 84 | */ 85 | public static void deleteSrcdepsDirectory() throws IOException, CannotAcquireLockException { 86 | final Path srcdepsPath = basedir.resolve("target/srcdeps"); 87 | MavenDepsMavenIntegrationTest.log.warn("Deleting [{}]", srcdepsPath); 88 | try { 89 | SrcdepsCoreUtils.deleteDirectory(srcdepsPath); 90 | } catch (IOException e) { 91 | if (isWindows()) { 92 | final String msg = e.getMessage(); 93 | String slash = File.separator; 94 | if ("\\".equals(slash)) { 95 | slash = "\\\\"; 96 | } 97 | final Matcher m = Pattern.compile("[^\\[]+\\[(.*" + slash + "\\d+)" + slash + "\\.git.*$").matcher(msg); 98 | if (m.matches()) { 99 | final String path = m.group(1); 100 | MavenDepsMavenIntegrationTest.log 101 | .warn("Locking [" + path + "] as a workaround of not being able to remove it", e); 102 | new PathLocker().lockDirectory("lock", Paths.get(path), new Object()); 103 | } else { 104 | throw e; 105 | } 106 | } else { 107 | throw e; 108 | } 109 | } 110 | } 111 | 112 | public static Path getBasedir() { 113 | return basedir; 114 | } 115 | 116 | public static Path getDependencySourceTreesPath() { 117 | return dependencySourceTreesPath; 118 | } 119 | 120 | public static String getEncoding() { 121 | return encoding; 122 | } 123 | 124 | public static MavenLocalRepository getMvnLocalRepo() { 125 | return mvnLocalRepo; 126 | } 127 | 128 | public static Path getMvnLocalRepoBasePath() { 129 | return mvnLocalRepoBasePath; 130 | } 131 | 132 | public static Path getMvnLocalRepoPath() { 133 | return mvnLocalRepoPath; 134 | } 135 | 136 | public static String getProjectversion() { 137 | return projectVersion; 138 | } 139 | 140 | public static Path getSrcdepsBuildMetadataPath() { 141 | return srcdepsBuildMetadataPath; 142 | } 143 | 144 | public static Path getSrcdepsQuickstartsPath() { 145 | return srcdepsQuickstartsPath; 146 | } 147 | 148 | public static boolean isWindows() { 149 | return isWindows; 150 | } 151 | 152 | public static Manifest loadManifest(Gavtc gavtc) throws IOException { 153 | final Path path = getMvnLocalRepo().resolve(gavtc); 154 | try (JarInputStream jarStream = new JarInputStream(Files.newInputStream(path))) { 155 | return jarStream.getManifest(); 156 | } 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/java/org/srcdeps/mvn/itest/WrappedMavenExecutionResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.itest; 18 | 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.charset.StandardCharsets; 22 | import java.nio.file.Files; 23 | import java.nio.file.Path; 24 | 25 | import org.srcdeps.core.util.SrcdepsCoreUtils; 26 | 27 | import io.takari.maven.testing.executor.MavenExecutionResult; 28 | 29 | public class WrappedMavenExecutionResult { 30 | private final MavenExecutionResult delegate; 31 | 32 | public WrappedMavenExecutionResult(MavenExecutionResult delegate) { 33 | super(); 34 | this.delegate = delegate; 35 | } 36 | 37 | public WrappedMavenExecutionResult assertErrorFreeLog() throws Exception { 38 | try { 39 | delegate.assertErrorFreeLog(); 40 | } catch (AssertionError e) { 41 | dumpLog(); 42 | e.printStackTrace(); 43 | throw e; 44 | } 45 | return this; 46 | } 47 | 48 | public WrappedMavenExecutionResult assertLogText(String text) { 49 | try { 50 | delegate.assertLogText(text); 51 | } catch (AssertionError e) { 52 | dumpLog(); 53 | e.printStackTrace(); 54 | throw e; 55 | } 56 | return this; 57 | } 58 | 59 | public WrappedMavenExecutionResult assertLogTextPath(String text) { 60 | try { 61 | if (SrcdepsCoreUtils.isWindows()) { 62 | delegate.assertLogText(text.replace('/', File.separatorChar)); 63 | } else { 64 | delegate.assertLogText(text); 65 | } 66 | } catch (AssertionError e) { 67 | dumpLog(); 68 | e.printStackTrace(); 69 | throw e; 70 | } 71 | return this; 72 | } 73 | 74 | public WrappedMavenExecutionResult assertNoLogText(String text) { 75 | try { 76 | delegate.assertNoLogText(text); 77 | } catch (AssertionError e) { 78 | dumpLog(); 79 | e.printStackTrace(); 80 | throw e; 81 | } 82 | return this; 83 | } 84 | 85 | private void dumpLog() { 86 | Path logPath = delegate.getBasedir().toPath().resolve("log.txt"); 87 | 88 | System.out.println(""); 89 | System.out.println(""); 90 | System.out.println(" Maven test execution log start " + logPath); 91 | System.out.println(""); 92 | System.out.println(""); 93 | 94 | try { 95 | for (String line : Files.readAllLines(logPath, StandardCharsets.UTF_8)) { 96 | System.out.println(line); 97 | } 98 | } catch (IOException e) { 99 | throw new RuntimeException(e); 100 | } 101 | System.out.println(""); 102 | System.out.println(""); 103 | System.out.println(" End " + logPath); 104 | System.out.println(""); 105 | System.out.println(""); 106 | } 107 | 108 | @Override 109 | public boolean equals(Object obj) { 110 | return delegate.equals(obj); 111 | } 112 | 113 | public File getBasedir() { 114 | return delegate.getBasedir(); 115 | } 116 | 117 | @Override 118 | public int hashCode() { 119 | return delegate.hashCode(); 120 | } 121 | 122 | @Override 123 | public String toString() { 124 | return delegate.toString(); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/src/test/resources/settings-mrm.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | mrm-maven-plugin 25 | Mock Repository Manager 26 | ${mrm.repository.url} 27 | * 28 | 29 | 30 | 31 | 32 | it-repo 33 | 34 | true 35 | 36 | 37 | 38 | snapshots 39 | ${mrm.repository.url} 40 | 41 | true 42 | ignore 43 | never 44 | 45 | 46 | true 47 | ignore 48 | always 49 | 50 | 51 | 52 | 53 | 54 | snapshots 55 | ${mrm.repository.url} 56 | 57 | true 58 | ignore 59 | never 60 | 61 | 62 | true 63 | ignore 64 | always 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-bom-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-bom-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-bom-quickstart 25 | srcdeps-mvn-git-bom-quickstart 26 | 1.0-SNAPSHOT 27 | jar 28 | A project that imports a source revision of another project in its dependencyManagement 29 | 30 | 31 | 32 | 33 | org.l2x6.maven.srcdeps.itest 34 | srcdeps-test-artifact 35 | 0.0.2-SRC-revision-3d00c2a91af593c01c9439cb16cb5f52d2ddbcf8 36 | pom 37 | import 38 | 39 | 40 | 41 | 42 | 43 | 44 | org.l2x6.maven.srcdeps.itest 45 | srcdeps-test-artifact-api 46 | 47 | 48 | 49 | 50 | junit 51 | junit 52 | 4.12 53 | test 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-bom-quickstart/src/main/java/org/srcdeps/mvn/quickstarts/git/parent/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.l2x6.maven.srcdeps.itest.api.App; 20 | public class AppClient { 21 | private final App app = new App(); 22 | public App getApp() { 23 | return app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-bom-quickstart/src/test/java/org/srcdeps/mvn/quickstarts/git/parent/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.l2x6.maven.srcdeps.itest.api.App; 22 | 23 | public class AppClientTest { 24 | 25 | /** 26 | * If this works than the dependencyManagement in parent maven project is effective 27 | */ 28 | @Test 29 | public void appMessage() { 30 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-bom-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file 19 | 20 | # Note that this is a minimal srcdeps.yaml file that constains only options relevant for this quickstart. 21 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 22 | 23 | 24 | configModelVersion: 3.0 25 | 26 | maven: 27 | failWith: 28 | properties: 29 | - srcdeps-fail-property 30 | 31 | # `repositories` - a map of SCM repositories. 32 | # 33 | # Required, no default 34 | repositories: 35 | 36 | # the `id` of the source repository, typically the `groupId` of its artifacts, 37 | # or any other string unique at this level of the yaml file. 38 | org.l2x6.maven.srcdeps.itest: 39 | 40 | # `includes` - a way how to map dependency artifacts to source repositories. 41 | # At the moment, the association is given by the exact string match between the `groupId` of the dependency 42 | # artifact and one of the includes listed here. 43 | # 44 | # At least one selector is required 45 | includes: 46 | - org.l2x6.maven.srcdeps.itest # This SCM repository entry will be used for building artifacts 47 | # with groupId org.l2x6.maven.srcdeps.itest 48 | 49 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 50 | # repos here then only the first successful checkout will count. 51 | # 52 | # At least one URL is required 53 | urls: 54 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 55 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | org.srcdeps.mvn 23 | srcdeps-maven-local-repository 24 | 4.0.0 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-enforcer 29 | 4.0.0 30 | 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/api/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-branch-quickstart 24 | srcdeps-mvn-git-branch-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-branch-quickstart-api 28 | 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/api/src/main/java/org/srcdeps/quickstarts/mvn/git/branch/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.branch; 18 | 19 | import org.l2x6.maven.srcdeps.itest.App; 20 | 21 | public interface AppClient { 22 | App getApp(); 23 | } 24 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-branch-quickstart 24 | srcdeps-mvn-git-branch-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-branch-quickstart-jar 28 | 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact 34 | 35 | 36 | 37 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-branch-quickstart 38 | srcdeps-mvn-git-branch-quickstart-api 39 | 1.0-SNAPSHOT 40 | 41 | 42 | 43 | junit 44 | junit 45 | test 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/branch/AppClientImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.branch; 18 | 19 | import org.l2x6.maven.srcdeps.itest.App; 20 | 21 | public class AppClientImpl { 22 | private final App app = new App(); 23 | 24 | public App getApp() { 25 | return app; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/branch/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.branch; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.branch.AppClientImpl; 22 | 23 | public class AppClientTest { 24 | 25 | @Test 26 | public void test() { 27 | Assert.assertEquals("Superior Morning World!", new AppClientImpl().getApp().getMessage()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-branch-quickstart 25 | srcdeps-mvn-git-branch-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A simple IT verifying the basic use case. 29 | 30 | 31 | UTF-8 32 | 0.0.1-SRC-branch-morning-branch 33 | 4.12 34 | 35 | 36 | 37 | api 38 | jar 39 | 40 | 41 | 42 | 43 | 44 | org.l2x6.maven.srcdeps.itest 45 | srcdeps-test-artifact 46 | ${version.org.l2x6.maven.srcdeps.itest} 47 | 48 | 49 | 50 | junit 51 | junit 52 | ${version.junit} 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-branch-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | repositories: 20 | org.l2x6.maven.srcdeps.itest: 21 | includes: 22 | - org.l2x6.maven.srcdeps.itest 23 | urls: 24 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 25 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/README.adoc: -------------------------------------------------------------------------------- 1 | = srcdeps-mvn-git-gradle-source-dependency-quickstart 2 | 3 | A Maven project containing a dependency on a source revision of a Gradle project 4 | 5 | == System requirements 6 | 7 | * Maven 3.3.1 or newer 8 | * Java 7 or newer 9 | 10 | == Recommended study order 11 | 12 | * link:.mvn/extensions.xml[`.mvn/extensions.xml`] 13 | * link:srcdeps.yaml[`srcdeps.yaml`] and its documentation under link:../../../doc/srcdeps-maven-configuration.adoc and 14 | https://github.com/srcdeps/srcdeps-core/blob/master/doc/srcdeps.yaml . 15 | * The version string in link:pom.xml#L46[`pom.xml`] 16 | * Issue `mvn clean install` on command line in the directory where this README file resides. 17 | * Check in the output of the above `mvn` command if the 18 | link:jar/src/test/java/org/srcdeps/quickstarts/mvn/git/revision/gradle/GreetingAppTest.java#L27[GreetingAppTest] 19 | passed 20 | * Check if the version `1.0-SRC-revision-e63539236a94e8f6c2d720f8bda0323d1ce4db0f` of 21 | `org.srcdeps.test.gradle:srcdeps-test-artifact-gradle-impl` was installed in your local Maven 22 | repository. 23 | * Check the directory where the `srcdeps-test-artifact` was built: 24 | `${maven.repo.local}/../srcdeps/org/srcdeps/test/gradle` - i.e. typically 25 | `~/.m2/srcdeps/org/srcdeps/test/gradle` 26 | 27 | == Feedback 28 | 29 | via link:https://github.com/srcdeps/srcdeps-maven/issues[scrdeps-maven Github Issues] -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-gradle-source-dependency-quickstart 24 | srcdeps-mvn-git-gradle-source-dependency-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-gradle-source-dependency-quickstart-jar 28 | 29 | 30 | 31 | 32 | org.srcdeps.test.gradle 33 | srcdeps-test-artifact-gradle-impl 34 | 35 | 36 | 37 | 38 | junit 39 | junit 40 | test 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/revision/gradle/GreetingApp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2017 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision.gradle; 18 | 19 | public class GreetingApp { 20 | private final org.srcdeps.test.gradle.api.Greeter greeter = new org.srcdeps.test.gradle.impl.HelloGreeter(); 21 | 22 | public org.srcdeps.test.gradle.api.Greeter getGreeter() { 23 | return greeter; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/revision/gradle/GreetingAppTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2017 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision.gradle; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.revision.gradle.GreetingApp; 22 | 23 | public class GreetingAppTest { 24 | 25 | @Test 26 | public void test() { 27 | Assert.assertEquals("Hello World!", new GreetingApp().getGreeter().greet("World")); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-gradle-source-dependency-quickstart 25 | srcdeps-mvn-git-gradle-source-dependency-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A Maven project containing a dependency on a source revision of a Gradle project 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | jar 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.srcdeps.test.gradle 44 | srcdeps-test-artifact-gradle-impl 45 | 46 | 1.0-SRC-revision-e63539236a94e8f6c2d720f8bda0323d1ce4db0f 47 | 48 | 49 | 50 | junit 51 | junit 52 | 4.12 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-gradle-source-dependency-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file. 19 | # 20 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 21 | # 22 | # Note that the options set here can be overriden on the command line, 23 | # see https://github.com/srcdeps/srcdeps-maven/blob/master/README.adoc#override-mvnsrcdepsyaml-options-on-the-command-line 24 | # 25 | # This file has to be located in the root directory of a Maven or 26 | # Gradle source tree. Before version 3.1.0 of `srcdeps-maven` the location for Maven was `.mvn/srcdeps.yaml` and it is 27 | # still supported. 28 | 29 | 30 | # `configModelVersion` exists to track the changes in the schema of of the srcdeps.yaml file. 31 | # 32 | # = configModelVersion compatibility matrix 33 | # 34 | # srcdeps-core | srcdeps-maven | Compatible configModelVersions 35 | # --------------+---------------+-------------------------------- 36 | # 2.0.0 | 2.0.0 | 1.0 37 | # 2.1.0 | 2.1.0 | 1.1, 1.0 38 | # 3.0.x | 3.0.x | 2.0 39 | # 3.1.x | 3.1.x | 2.1, 2.0 40 | # 3.2.x | 3.2.x | 2.2, 2.1, 2.0 41 | # 42 | # Required, no default 43 | # Since 1.0 44 | configModelVersion: 3.0 45 | 46 | # `repositories` - a map of source repositories to checkout and build from 47 | # 48 | # Required, no default 49 | # Since 1.0 50 | repositories: 51 | 52 | # the `id` of the source repository, typically the `groupId` of its artifacts, 53 | # or any other string unique at this level of the yaml file. 54 | org.srcdeps.test.gradle: 55 | 56 | # `includes` - select which dependency artifacts should be built from this source repository. 57 | # 58 | # An include is a pattern to match dependency GAVs (triples of groupId, artifactId and version) against. An include 59 | # has three colon delimited subpatterns, one for each of groupId, artifactId and version. The subpatterns for 60 | # artifactId and version can be omitted. The subpatterns may contain the wildcard * that stands for a number 61 | # of characters or an empty string. 62 | # 63 | # = examples of includes: 64 | # 65 | # `org.my-group` an equivalent of `org.my-group:*:*`. It will match any version of any artifact 66 | # having groupId `org.my-group`. 67 | # 68 | # `org.my-group*` an equivalent of `org.my-group*:*:*`. It will match any version of any artifact 69 | # whose groupId starts with `org.my-group` - i.e. it will match all of `org.my-group`, 70 | # `org.my-group.api`, `org.my-group.impl`, etc. 71 | # 72 | # `org.my-group:my-artifact` an equivalent of `org.my-group:my-artifact:*`. It will match any version of all such 73 | # artifacts that have groupId `org.my-group` and artifactId `my-artifact` 74 | # 75 | # `org.my-group:my-artifact:1.2.3` will match just the version 1.2.3 of artifacts `org.my-group:my-artifact`. 76 | # 77 | # At least one include is required 78 | # Since 2.2 79 | # 80 | # Note that `includes` has the same meaning as `includes` that existed since 1.0. `includes` is still kept as an 81 | # alias for `includes`. 82 | # 83 | # Note that in configModelVersion: 1.0, includes consisted only of groupId literals to perform exact string match 84 | # with the `groupId` of the dependency. Because the subpatterns for artifactId and version can be omitted since 1.1 85 | # the 1.1 includes are backward compatible with 1.0 includes. 86 | # 87 | includes: 88 | - org.srcdeps.test.gradle # This SCM repository entry will be used for building artifacts 89 | # with groupId org.srcdeps.test.gradle (unless the given artifact is excluded 90 | # by `excludes`) 91 | 92 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 93 | # repositories here then only the first successful checkout will count. 94 | # 95 | # At least one URL is required 96 | # Since 1.0 97 | urls: 98 | - git:https://github.com/srcdeps/srcdeps-test-artifact-gradle.git 99 | 100 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-include-required-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | org.srcdeps.mvn 23 | srcdeps-maven-local-repository 24 | 4.0.0 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-enforcer 29 | 4.0.0 30 | 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-include-required-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-include-required-quickstart 24 | srcdeps-mvn-git-include-required-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-include-required-quickstart-jar 28 | 29 | 30 | 31 | 32 | 33 | org.l2x6.maven.srcdeps.itest 34 | srcdeps-test-artifact-api 35 | 36 | 37 | 38 | junit 39 | junit 40 | 4.8.2 41 | test 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-include-required-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/interdep/Interdep.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2019 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.interdep; 18 | 19 | import org.l2x6.maven.srcdeps.itest.api.App; 20 | 21 | public class Interdep { 22 | final App app = new App(); 23 | 24 | public String getMessage() { 25 | return app.getMessage(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-include-required-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/interdep/InterdepTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2019 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.interdep; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.interdep.Interdep; 22 | 23 | public class InterdepTest { 24 | @Test 25 | public void testInterdep() { 26 | Assert.assertEquals("Hello World!", new Interdep().getMessage()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-include-required-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-include-required-quickstart 25 | srcdeps-mvn-git-include-required-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A simple IT verifying the basic use case. 29 | 30 | 31 | UTF-8 32 | 0.0.1-SRC-tag-0.0.1-5657 33 | 34 | 35 | 36 | jar 37 | 38 | 39 | 40 | 41 | 42 | org.l2x6.maven.srcdeps.itest 43 | srcdeps-test-artifact-api 44 | ${version.org.l2x6.maven.srcdeps.itest} 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-include-required-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | repositories: 20 | org.l2x6.maven.srcdeps.itest: 21 | includes: 22 | - org.l2x6.maven.srcdeps.itest 23 | urls: 24 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 25 | maven: 26 | includeRequired: true 27 | excludeNonRequired: true 28 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-interdep-modules-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | org.srcdeps.mvn 23 | srcdeps-maven-local-repository 24 | 4.0.0 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-enforcer 29 | 4.0.0 30 | 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-interdep-modules-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-interdep-modules-quickstart 24 | srcdeps-mvn-git-interdep-modules-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-interdep-modules-quickstart-jar 28 | 29 | 30 | 31 | 32 | 33 | org.l2x6.maven.srcdeps.itest 34 | srcdeps-test-artifact-service 35 | 36 | 37 | 38 | junit 39 | junit 40 | 4.8.2 41 | test 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-interdep-modules-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/interdep/Interdep.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.interdep; 18 | 19 | import org.l2x6.maven.srcdeps.itest.service.AppService; 20 | 21 | public class Interdep { 22 | private final AppService service = new AppService(); 23 | 24 | public AppService getService() { 25 | return service; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-interdep-modules-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/interdep/InterdepTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.interdep; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.interdep.Interdep; 22 | 23 | public class InterdepTest { 24 | @Test 25 | public void testInterdep() { 26 | Assert.assertEquals("Hello World!", new Interdep().getService().getApp().getMessage()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-interdep-modules-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-interdep-modules-quickstart 25 | srcdeps-mvn-git-interdep-modules-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A simple IT verifying the basic use case. 29 | 30 | 31 | UTF-8 32 | 0.0.1-SRC-revision-56576301d21c53439bcb5c48502c723282633cc7 33 | 34 | 35 | 36 | jar 37 | 38 | 39 | 40 | 41 | 42 | org.l2x6.maven.srcdeps.itest 43 | srcdeps-test-artifact-api 44 | ${version.org.l2x6.maven.srcdeps.itest} 45 | 46 | 47 | org.l2x6.maven.srcdeps.itest 48 | srcdeps-test-artifact-service 49 | ${version.org.l2x6.maven.srcdeps.itest} 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-interdep-modules-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | repositories: 20 | org.l2x6.maven.srcdeps.itest: 21 | includes: 22 | - org.l2x6.maven.srcdeps.itest 23 | urls: 24 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 25 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config 25 | srcdeps-mvn-git-master-config 26 | 1.0-SNAPSHOT 27 | A simple IT verifying the basic use case. 28 | 29 | 30 | UTF-8 31 | 4.12 32 | 33 | 34 | 35 | 36 | 37 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello-decorator 38 | srcdeps-mvn-git-master-config-hello-decorator 39 | 0.0.1-srcdeps 40 | test 41 | 42 | 43 | 44 | junit 45 | junit 46 | ${version.junit} 47 | test 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello-decorator/.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | pom.xml.next 7 | release.properties 8 | 9 | # Eclipse 10 | .project 11 | .classpath 12 | .settings/ 13 | bin/ 14 | 15 | # IDEA 16 | .idea 17 | *.ipr 18 | *.iml 19 | *.iws 20 | 21 | # NetBeans 22 | nb-configuration.xml 23 | 24 | # KDE 25 | .directory 26 | 27 | # OSX 28 | .DS_Store -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello-decorator/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello-decorator 25 | srcdeps-mvn-git-master-config-hello-decorator 26 | 1.0-SNAPSHOT 27 | 28 | 29 | UTF-8 30 | 31 | 32 | 33 | 34 | 35 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello 36 | srcdeps-mvn-git-master-config-hello 37 | 0.0.2-srcdeps 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello-decorator/src/main/java/org/srcdeps/mvn/quickstarts/master/config/hello/NameDecorator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.master.config.hello; 18 | 19 | import org.srcdeps.mvn.quickstarts.master.config.hello.decorator.Greeter; 20 | 21 | public class NameDecorator implements Greeter { 22 | 23 | private final Greeter delegate; 24 | private final String name; 25 | 26 | public NameDecorator(Greeter delegate, String name) { 27 | super(); 28 | this.delegate = delegate; 29 | this.name = name; 30 | } 31 | 32 | public String greet() { 33 | return delegate.greet() + " " + name; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello/.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | target/ 3 | pom.xml.tag 4 | pom.xml.releaseBackup 5 | pom.xml.versionsBackup 6 | pom.xml.next 7 | release.properties 8 | 9 | # Eclipse 10 | .project 11 | .classpath 12 | .settings/ 13 | bin/ 14 | 15 | # IDEA 16 | .idea 17 | *.ipr 18 | *.iml 19 | *.iws 20 | 21 | # NetBeans 22 | nb-configuration.xml 23 | 24 | # KDE 25 | .directory 26 | 27 | # OSX 28 | .DS_Store -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello 25 | srcdeps-mvn-git-master-config-hello 26 | 1.0-SNAPSHOT 27 | 28 | 29 | UTF-8 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello/src/main/java/org/srcdeps/mvn/quickstarts/master/config/hello/decorator/Greeter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.master.config.hello.decorator; 18 | 19 | public interface Greeter { 20 | String greet(); 21 | } 22 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/dependency-projects/srcdeps-mvn-git-master-config-hello/src/main/java/org/srcdeps/mvn/quickstarts/master/config/hello/decorator/Hello.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.master.config.hello.decorator; 18 | 19 | public class Hello implements Greeter { 20 | 21 | public String greet() { 22 | return "Hello"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/src/test/java/org/srcdeps/mvn/quickstarts/master/config/HelloDecoratorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.master.config; 18 | 19 | import org.junit.Test; 20 | 21 | public class HelloDecoratorTest { 22 | 23 | @Test 24 | public void helloWorld() { 25 | 26 | org.junit.Assert.assertEquals("Hello world", new org.srcdeps.mvn.quickstarts.master.config.hello.NameDecorator( 27 | new org.srcdeps.mvn.quickstarts.master.config.hello.decorator.Hello(), "world").greet()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-master-config/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | forwardAsMasterConfig: true 20 | repositories: 21 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello: 22 | includes: 23 | - org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello 24 | urls: 25 | - ${hello.git.url} 26 | buildVersionPattern: .*-srcdeps 27 | buildRef: revision-${hello.git.revision} 28 | verbosity: info 29 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello-decorator: 30 | includes: 31 | - org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-master-config.hello-decorator 32 | urls: 33 | - ${hello-decorator.git.url} 34 | buildVersionPattern: .*-srcdeps 35 | buildRef: revision-${hello-decorator.git.revision} 36 | verbosity: info 37 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-parent-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-parent-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.l2x6.maven.srcdeps.itest 25 | srcdeps-test-artifact 26 | 0.0.2-SRC-revision-3d00c2a91af593c01c9439cb16cb5f52d2ddbcf8 27 | 28 | 29 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-parent-quickstart 30 | srcdeps-mvn-git-parent-quickstart 31 | 1.0-SNAPSHOT 32 | jar 33 | A project using a source revision of another project as its parent 34 | 35 | 36 | 37 | org.l2x6.maven.srcdeps.itest 38 | srcdeps-test-artifact-api 39 | 40 | 41 | 42 | 43 | junit 44 | junit 45 | 4.12 46 | test 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.apache.maven.plugins 55 | maven-surefire-plugin 56 | 57 | 58 | ${srcdeps.testString} 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-parent-quickstart/src/main/java/org/srcdeps/mvn/quickstarts/git/parent/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.l2x6.maven.srcdeps.itest.api.App; 20 | public class AppClient { 21 | private final App app = new App(); 22 | public App getApp() { 23 | return app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-parent-quickstart/src/test/java/org/srcdeps/mvn/quickstarts/git/parent/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.l2x6.maven.srcdeps.itest.api.App; 22 | 23 | public class AppClientTest { 24 | 25 | /** 26 | * If this works than the dependencyManagement in parent maven project is effective 27 | */ 28 | @Test 29 | public void appMessage() { 30 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 31 | } 32 | 33 | /** 34 | * Assert that the srcdeps.testString property got set in the parent maven project 35 | */ 36 | @Test 37 | public void propertySetInParent() { 38 | Assert.assertEquals("manamana", System.getProperty("srcdeps.testString")); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-parent-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file 19 | 20 | # Note that this is a minimal srcdeps.yaml file that constains only options relevant for this quickstart. 21 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 22 | 23 | 24 | configModelVersion: 3.0 25 | 26 | # `repositories` - a map of SCM repositories. 27 | # 28 | # Required, no default 29 | repositories: 30 | 31 | # the `id` of the source repository, typically the `groupId` of its artifacts, 32 | # or any other string unique at this level of the yaml file. 33 | org.l2x6.maven.srcdeps.itest: 34 | 35 | # `includes` - a way how to map dependency artifacts to source repositories. 36 | # At the moment, the association is given by the exact string match between the `groupId` of the dependency 37 | # artifact and one of the includes listed here. 38 | # 39 | # At least one selector is required 40 | includes: 41 | - org.l2x6.maven.srcdeps.itest # This SCM repository entry will be used for building artifacts 42 | # with groupId org.l2x6.maven.srcdeps.itest 43 | 44 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 45 | # repos here then only the first successful checkout will count. 46 | # 47 | # At least one URL is required 48 | urls: 49 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 50 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-and-properties-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | org.srcdeps.mvn 23 | srcdeps-maven-local-repository 24 | 4.0.0 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-enforcer 29 | 4.0.0 30 | 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-and-properties-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-profile-and-properties-quickstart 24 | srcdeps-mvn-git-profile-and-properties-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-profile-and-properties-quickstart-jar 28 | 29 | 30 | 31 | org.l2x6.maven.srcdeps.itest 32 | srcdeps-test-artifact-api 33 | 34 | 35 | 36 | junit 37 | junit 38 | test 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-and-properties-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/prop/profile/GreetingConsumer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.prop.profile; 18 | 19 | public class GreetingConsumer { 20 | 21 | public String retrieveGreeting() { 22 | return new org.l2x6.maven.srcdeps.itest.api.generated.GeneratedGreeter().getGreeting(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-and-properties-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/prop/profile/GreetingConsumerTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.prop.profile; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.prop.profile.GreetingConsumer; 22 | 23 | public class GreetingConsumerTest { 24 | 25 | @Test 26 | public void testGreeting() { 27 | Assert.assertEquals("random name KMYTJDb9", new GreetingConsumer().retrieveGreeting()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-and-properties-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-profile-and-properties-quickstart 25 | srcdeps-mvn-git-profile-and-properties-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A simple IT verifying the basic use case. 29 | 30 | 31 | UTF-8 32 | 0.0.1-SRC-revision-834947e286f1f59bd6c5c3ca3823f4656bc9345b 33 | 34 | 35 | 36 | jar 37 | 38 | 39 | 40 | 41 | 42 | org.l2x6.maven.srcdeps.itest 43 | srcdeps-test-artifact-api 44 | ${version.org.l2x6.maven.srcdeps.itest} 45 | 46 | 47 | 48 | junit 49 | junit 50 | 4.12 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-and-properties-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | verbosity: info 20 | repositories: 21 | org.l2x6.maven.srcdeps.itest: 22 | includes: 23 | - org.l2x6.maven.srcdeps.itest 24 | urls: 25 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 26 | buildArguments: 27 | - -Psrcdeps-test-artifact-api-hello-profile 28 | - -Dhello.addressee=random name KMYTJDb9 29 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-profile-quickstart 25 | srcdeps-mvn-git-profile-quickstart 26 | 1.0-SNAPSHOT 27 | jar 28 | A project that has a srcdep in a profile 29 | 30 | 31 | 0.0.2-SRC-revision-3d00c2a91af593c01c9439cb16cb5f52d2ddbcf8 32 | 33 | 34 | 35 | 36 | 37 | 38 | junit 39 | junit 40 | 4.12 41 | test 42 | 43 | 44 | 45 | 46 | 47 | 48 | srcdeps-profile 49 | 50 | 51 | org.l2x6.maven.srcdeps.itest 52 | srcdeps-test-artifact-api 53 | ${version.srcdeps} 54 | 55 | 56 | 57 | 58 | srcdeps-property-profile 59 | 60 | true 61 | 62 | 63 | 64 | org.l2x6.maven.srcdeps.itest 65 | srcdeps-test-artifact-api 66 | ${version.srcdeps} 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-quickstart/src/main/java/org/srcdeps/mvn/quickstarts/git/parent/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.l2x6.maven.srcdeps.itest.api.App; 20 | public class AppClient { 21 | private final App app = new App(); 22 | public App getApp() { 23 | return app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-quickstart/src/test/java/org/srcdeps/mvn/quickstarts/git/parent/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.l2x6.maven.srcdeps.itest.api.App; 22 | 23 | public class AppClientTest { 24 | 25 | /** 26 | * If this works than the dependencyManagement in parent maven project is effective 27 | */ 28 | @Test 29 | public void appMessage() { 30 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-profile-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file 19 | 20 | # Note that this is a minimal srcdeps.yaml file that constains only options relevant for this quickstart. 21 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 22 | 23 | 24 | configModelVersion: 3.0 25 | 26 | maven: 27 | failWith: 28 | addDefaults: false 29 | profiles: 30 | - srcdeps-profile 31 | properties: 32 | - srcdeps-fail-property 33 | 34 | # `repositories` - a map of SCM repositories. 35 | # 36 | # Required, no default 37 | repositories: 38 | 39 | # the `id` of the source repository, typically the `groupId` of its artifacts, 40 | # or any other string unique at this level of the yaml file. 41 | org.l2x6.maven.srcdeps.itest: 42 | 43 | # `includes` - a way how to map dependency artifacts to source repositories. 44 | # At the moment, the association is given by the exact string match between the `groupId` of the dependency 45 | # artifact and one of the includes listed here. 46 | # 47 | # At least one selector is required 48 | includes: 49 | - org.l2x6.maven.srcdeps.itest # This SCM repository entry will be used for building artifacts 50 | # with groupId org.l2x6.maven.srcdeps.itest 51 | 52 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 53 | # repos here then only the first successful checkout will count. 54 | # 55 | # At least one URL is required 56 | urls: 57 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 58 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-non-master-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | org.srcdeps.mvn 23 | srcdeps-maven-local-repository 24 | 4.0.0 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-enforcer 29 | 4.0.0 30 | 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-non-master-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-revision-non-master-quickstart 24 | srcdeps-mvn-git-revision-non-master-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-revision-non-master-quickstart-jar 28 | 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-non-master-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-revision-non-master-quickstart 25 | srcdeps-mvn-git-revision-non-master-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A simple IT verifying the basic use case. 29 | 30 | 31 | UTF-8 32 | 0.0.1-SRC-revision-dbad2cdc30b5bb3ff62fc89f57987689a5f3c220 33 | 34 | 35 | 36 | jar 37 | 38 | 39 | 40 | 41 | 42 | org.l2x6.maven.srcdeps.itest 43 | srcdeps-test-artifact 44 | ${version.org.l2x6.maven.srcdeps.itest} 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-non-master-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | repositories: 20 | org.l2x6.maven.srcdeps.itest: 21 | includes: 22 | - org.l2x6.maven.srcdeps.itest 23 | urls: 24 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 25 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/README.adoc: -------------------------------------------------------------------------------- 1 | = srcdeps-mvn-git-revision-quickstart 2 | 3 | A project containing a dependency on a source revision of another project 4 | 5 | == System requirements 6 | 7 | * Maven 3.3.1 or newer 8 | * Java 7 or newer 9 | 10 | == Recommended study order 11 | 12 | * link:.mvn/extensions.xml[`.mvn/extensions.xml`] 13 | * link:srcdeps.yaml[`srcdeps.yaml`] and its documentation under link:../../../doc/srcdeps-maven-configuration.adoc and 14 | https://github.com/srcdeps/srcdeps-core/blob/master/doc/srcdeps.yaml . 15 | * The version string in link:pom.xml#L46[`pom.xml`] 16 | * Issue `mvn clean install` on command line in the directory where this README file resides. 17 | * Check in the output of the above `mvn` command if the 18 | link:jar/src/test/java/org/l2x6/srcdeps/quickstarts/mvn/git/revision/AppClientTest.java#L26[test] passed 19 | * Check if the version `0.0.1-SRC-revision-66ea95d890531f4eaaa5aa04a9b1c69b409dcd0b` of 20 | `org.l2x6.maven.srcdeps.itest:srcdeps-test-artifact` was installed in your local Maven repository. 21 | * Check the directory where the `srcdeps-test-artifact` was built: 22 | `${maven.repo.local}/../srcdeps/org.l2x6.maven.srcdeps.itest` - i.e. typically 23 | `~/.m2/srcdeps/org.l2x6.maven.srcdeps.itest` 24 | 25 | == Feedback 26 | 27 | via link:https://github.com/srcdeps/srcdeps-maven/issues[scrdeps-maven Github Issues] -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-revision-quickstart 24 | srcdeps-mvn-git-revision-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-revision-quickstart-jar 28 | 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact 34 | 35 | 36 | 37 | 38 | junit 39 | junit 40 | test 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/revision/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision; 18 | 19 | import org.l2x6.maven.srcdeps.itest.App; 20 | 21 | public class AppClient { 22 | private final App app = new App(); 23 | 24 | public App getApp() { 25 | return app; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/revision/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.revision.AppClient; 22 | 23 | public class AppClientTest { 24 | 25 | @Test 26 | public void test() { 27 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-revision-quickstart 25 | srcdeps-mvn-git-revision-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A Maven project containing a dependency on a source revision of another Maven project 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | jar 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.l2x6.maven.srcdeps.itest 44 | srcdeps-test-artifact 45 | 46 | 0.0.1-SRC-revision-66ea95d890531f4eaaa5aa04a9b1c69b409dcd0b 47 | 48 | 49 | 50 | junit 51 | junit 52 | 4.12 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-revision-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file 19 | 20 | # Note that this is a minimal srcdeps.yaml file that constains only options relevant for this quickstart. 21 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 22 | 23 | 24 | configModelVersion: 3.0 25 | 26 | # `repositories` - a map of SCM repositories. 27 | # 28 | # Required, no default 29 | repositories: 30 | 31 | # the `id` of the source repository, typically the `groupId` of its artifacts, 32 | # or any other string unique at this level of the yaml file. 33 | org.l2x6.maven.srcdeps.itest: 34 | 35 | # `includes` - a way how to map dependency artifacts to source repositories. 36 | # At the moment, the association is given by the exact string match between the `groupId` of the dependency 37 | # artifact and one of the includes listed here. 38 | # 39 | # At least one selector is required 40 | includes: 41 | - org.l2x6.maven.srcdeps.itest # This SCM repository entry will be used for building artifacts 42 | # with groupId org.l2x6.maven.srcdeps.itest 43 | 44 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 45 | # repos here then only the first successful checkout will count. 46 | # 47 | # At least one URL is required 48 | urls: 49 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 50 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/README.adoc: -------------------------------------------------------------------------------- 1 | = srcdeps-mvn-git-snapshot-quickstart 2 | 3 | A project containing a SNAPSHOT dependency that has a matching `buildVersionPattern` set in `srcdeps.yaml`. 4 | The SNAPSHOT dependency is thus rebuilt each time the dependent project is built. 5 | 6 | == System requirements 7 | 8 | * Maven 3.3.1 or newer 9 | * Java 7 or newer 10 | 11 | == Recommended study order 12 | 13 | * link:.mvn/extensions.xml[`.mvn/extensions.xml`] 14 | * link:srcdeps.yaml[`srcdeps.yaml`] and its documentation under link:../../../doc/srcdeps-maven-configuration.adoc and 15 | https://github.com/srcdeps/srcdeps-core/blob/master/doc/srcdeps.yaml . 16 | * Nothing special in link:pom.xml#L46[`pom.xml`] 17 | * Issue `mvn clean install` on command line in the directory where this README file resides. 18 | * Check in the output of the above `mvn` command if the 19 | link:jar/src/test/java/org/l2x6/srcdeps/quickstarts/mvn/git/revision/AppClientTest.java#L26[test] passed 20 | * Check if the version `0.0.2-SNAPSHOT` of 21 | `org.l2x6.maven.srcdeps.itest:srcdeps-test-artifact-service` was installed in your local Maven 22 | repository. Open `META-INF/MANIFEST.MF` the jar and ensure it has 23 | `Built-From-Git-SHA1: 67e9a1480f6de434e513c3ced2b4e952dce5ddc0` 24 | * Check the directory where the `srcdeps-test-artifact` was built: 25 | `${maven.repo.local}/../srcdeps/org.l2x6.maven.srcdeps.itest` - i.e. typically 26 | `~/.m2/srcdeps/org.l2x6.maven.srcdeps.itest` 27 | 28 | == Feedback 29 | 30 | via link:https://github.com/srcdeps/srcdeps-maven/issues[scrdeps-maven Github Issues] -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-snapshot-quickstart 24 | srcdeps-mvn-git-snapshot-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-snapshot-quickstart-jar 28 | 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact-service 34 | 35 | 36 | 37 | 38 | junit 39 | junit 40 | test 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/revision/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision; 18 | 19 | import org.l2x6.maven.srcdeps.itest.api.App; 20 | import org.l2x6.maven.srcdeps.itest.service.AppService; 21 | 22 | public class AppClient { 23 | private final App app = new AppService().getApp(); 24 | 25 | public App getApp() { 26 | return app; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/revision/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2018 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | 22 | public class AppClientTest { 23 | 24 | @Test 25 | public void test() { 26 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-snapshot-quickstart 25 | srcdeps-mvn-git-snapshot-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A Maven project containing a dependency on a source revision of another Maven project 29 | 30 | 31 | UTF-8 32 | 33 | 34 | 35 | jar 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.l2x6.maven.srcdeps.itest 44 | srcdeps-test-artifact-service 45 | 0.0.2-SNAPSHOT 46 | 47 | 48 | 49 | junit 50 | junit 51 | 4.12 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-snapshot-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file 19 | 20 | # Note that this is a minimal srcdeps.yaml file that constains only options relevant for this quickstart. 21 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 22 | 23 | 24 | configModelVersion: 3.0 25 | 26 | # `repositories` - a map of SCM repositories. 27 | # 28 | # Required, no default 29 | repositories: 30 | 31 | # the `id` of the source repository, typically the `groupId` of its artifacts, 32 | # or any other string unique at this level of the yaml file. 33 | org.l2x6.maven.srcdeps.itest: 34 | 35 | # `includes` - a way how to map dependency artifacts to source repositories. 36 | # At the moment, the association is given by the exact string match between the `groupId` of the dependency 37 | # artifact and one of the includes listed here. 38 | # 39 | # At least one selector is required 40 | includes: 41 | - org.l2x6.maven.srcdeps.itest # This SCM repository entry will be used for building artifacts 42 | # with groupId org.l2x6.maven.srcdeps.itest 43 | 44 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 45 | # repos here then only the first successful checkout will count. 46 | # 47 | # At least one URL is required 48 | urls: 49 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 50 | 51 | # Build any SNAPSHOT version 52 | buildVersionPattern: .*-SNAPSHOT 53 | 54 | # Build the versions matching `buildVersionPattern` using the named revision 55 | buildRef: revision-67e9a1480f6de434e513c3ced2b4e952dce5ddc0 56 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-tag-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | org.srcdeps.mvn 23 | srcdeps-maven-local-repository 24 | 4.0.0 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-enforcer 29 | 4.0.0 30 | 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-tag-quickstart/jar/pom.xml: -------------------------------------------------------------------------------- 1 | 19 | 21 | 4.0.0 22 | 23 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-tag-quickstart 24 | srcdeps-mvn-git-tag-quickstart 25 | 1.0-SNAPSHOT 26 | 27 | srcdeps-mvn-git-tag-quickstart-jar 28 | 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact 34 | 35 | 36 | 37 | 38 | junit 39 | junit 40 | test 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-tag-quickstart/jar/src/main/java/org/srcdeps/quickstarts/mvn/git/revision/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision; 18 | 19 | import org.l2x6.maven.srcdeps.itest.App; 20 | 21 | public class AppClient { 22 | private final App app = new App(); 23 | 24 | public App getApp() { 25 | return app; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-tag-quickstart/jar/src/test/java/org/srcdeps/quickstarts/mvn/git/revision/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.quickstarts.mvn.git.revision; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.srcdeps.quickstarts.mvn.git.revision.AppClient; 22 | 23 | public class AppClientTest { 24 | 25 | @Test 26 | public void test() { 27 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-tag-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvn-git-tag-quickstart 25 | srcdeps-mvn-git-tag-quickstart 26 | 1.0-SNAPSHOT 27 | pom 28 | A simple IT verifying the basic use case. 29 | 30 | 31 | UTF-8 32 | 0.0.1-SRC-tag-0.0.1 33 | 4.12 34 | 35 | 36 | 37 | jar 38 | 39 | 40 | 41 | 42 | 43 | 44 | org.l2x6.maven.srcdeps.itest 45 | srcdeps-test-artifact 46 | ${version.org.l2x6.maven.srcdeps.itest} 47 | 48 | 49 | 50 | junit 51 | junit 52 | ${version.junit} 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvn-git-tag-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | configModelVersion: 3.0 19 | repositories: 20 | org.l2x6.maven.srcdeps.itest: 21 | includes: 22 | - org.l2x6.maven.srcdeps.itest 23 | urls: 24 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 25 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvnw-git-quickstart/.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 25 | 26 | 27 | org.srcdeps.mvn 28 | srcdeps-maven-local-repository 29 | 4.0.0 30 | 31 | 32 | org.srcdeps.mvn 33 | srcdeps-maven-enforcer 34 | 4.0.0 35 | 36 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvnw-git-quickstart/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 22 | 4.0.0 23 | 24 | org.srcdeps.mvn.quickstarts.srcdeps-mvnw-git-quickstart 25 | srcdeps-mvnw-git-quickstart 26 | 1.0-SNAPSHOT 27 | jar 28 | A project that depends on a source revision of another project that needs to be built by mvnw 29 | 30 | 31 | 32 | org.l2x6.maven.srcdeps.itest 33 | srcdeps-test-artifact-api 34 | 0.0.2-SRC-revision-dc21a1375bd5388b5489621e71dbe6e0e70db200 35 | 36 | 37 | 38 | junit 39 | junit 40 | 4.12 41 | test 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvnw-git-quickstart/src/main/java/org/srcdeps/mvn/quickstarts/git/parent/AppClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.l2x6.maven.srcdeps.itest.api.App; 20 | public class AppClient { 21 | private final App app = new App(); 22 | public App getApp() { 23 | return app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvnw-git-quickstart/src/test/java/org/srcdeps/mvn/quickstarts/git/parent/AppClientTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015-2016 Maven Source Dependencies 3 | * Plugin contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.srcdeps.mvn.quickstarts.git.parent; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | import org.l2x6.maven.srcdeps.itest.api.App; 22 | 23 | public class AppClientTest { 24 | 25 | /** 26 | * If this works than the dependencyManagement in parent maven project is effective 27 | */ 28 | @Test 29 | public void appMessage() { 30 | Assert.assertEquals("Hello World!", new AppClient().getApp().getMessage()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /srcdeps-maven-quickstarts/srcdeps-mvnw-git-quickstart/srcdeps.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015-2019 Maven Source Dependencies 3 | # Plugin contributors as indicated by the @author tags. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # `srcdeps.yaml` - the srcdeps configuration file 19 | 20 | # Note that this is a minimal srcdeps.yaml file that constains only options relevant for this quickstart. 21 | # The full srcdeps.yaml reference can be found under https://github.com/srcdeps/srcdeps-core/tree/master/doc/srcdeps.yaml 22 | 23 | 24 | configModelVersion: 3.0 25 | 26 | # `repositories` - a map of SCM repositories. 27 | # 28 | # Required, no default 29 | repositories: 30 | 31 | # the `id` of the source repository, typically the `groupId` of its artifacts, 32 | # or any other string unique at this level of the yaml file. 33 | org.l2x6.maven.srcdeps.itest: 34 | 35 | # `includes` - a way how to map dependency artifacts to source repositories. 36 | # At the moment, the association is given by the exact string match between the `groupId` of the dependency 37 | # artifact and one of the includes listed here. 38 | # 39 | # At least one selector is required 40 | includes: 41 | - org.l2x6.maven.srcdeps.itest # This SCM repository entry will be used for building artifacts 42 | # with groupId org.l2x6.maven.srcdeps.itest 43 | 44 | # `urls` - a list of URLs to checkout the sources of the given dependency. If you list multiple SCM 45 | # repos here then only the first successful checkout will count. 46 | # 47 | # At least one URL is required 48 | urls: 49 | - git:https://github.com/srcdeps/srcdeps-test-artifact.git 50 | --------------------------------------------------------------------------------