diff --git a/pom.xml b/pom.xml index cab698e..d8831a9 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 3.3.9 - 2.39.6 + 2.39.8 UTF-8 1.8 1.8 diff --git a/src/main/java/org/jfrog/buildinfo/deployment/BuildInfoRecorder.java b/src/main/java/org/jfrog/buildinfo/deployment/BuildInfoRecorder.java index 26d51a5..6e553e6 100644 --- a/src/main/java/org/jfrog/buildinfo/deployment/BuildInfoRecorder.java +++ b/src/main/java/org/jfrog/buildinfo/deployment/BuildInfoRecorder.java @@ -39,6 +39,7 @@ import static org.jfrog.build.extractor.BuildInfoExtractorUtils.getModuleIdString; import static org.jfrog.build.extractor.BuildInfoExtractorUtils.getTypeString; +import static org.jfrog.build.extractor.packageManager.PackageManagerUtils.filterBuildInfoProperties; import static org.jfrog.buildinfo.utils.Utils.getArtifactName; import static org.jfrog.buildinfo.utils.Utils.getDeploymentPath; import static org.jfrog.buildinfo.utils.Utils.getFileExtension; @@ -164,7 +165,7 @@ public BuildInfo extract(ExecutionEvent event) { long time = new Date().getTime() - session.getRequest().getStartTime().getTime(); BuildInfo buildInfo = buildInfoBuilder.durationMillis(time).build(); - PackageManagerUtils.collectAndFilterEnvIfNeeded(conf, buildInfo); + PackageManagerUtils.collectEnvAndFilterProperties(conf, buildInfo); return buildInfo; } diff --git a/src/test/java/org/jfrog/buildinfo/integration/ArtifactoryPluginITest.java b/src/test/java/org/jfrog/buildinfo/integration/ArtifactoryPluginITest.java index 1f03b5e..63d8caf 100644 --- a/src/test/java/org/jfrog/buildinfo/integration/ArtifactoryPluginITest.java +++ b/src/test/java/org/jfrog/buildinfo/integration/ArtifactoryPluginITest.java @@ -28,7 +28,6 @@ import java.util.Comparator; import java.util.List; import java.util.Objects; -import java.util.Properties; import static org.mockserver.model.HttpRequest.request; @@ -137,6 +136,23 @@ private void testMultiModule(String projectName) throws Exception { } } + /** + * Check exclude modules properties with false + */ + public void testMultiModuleModuleEnv() throws Exception { + try (ClientAndServer mockServer = ClientAndServer.startClientAndServer(8081)) { + initializeMockServer(mockServer); + runProject("multi-module-filter-modules-properties"); + + // Extract build from request + BuildInfo build = getBuild(mockServer); + + // Check include exclude properties + build.getModules().forEach((value) -> assertFalse(value.getProperties().containsKey("password"))); + build.getModules().forEach((value) -> assertTrue(value.getProperties().containsKey("username"))); + } + } + public void testMavenArchetypeExample() throws Exception { try (ClientAndServer mockServer = ClientAndServer.startClientAndServer(8081)) { initializeMockServer(mockServer); @@ -152,7 +168,7 @@ public void testMavenArchetypeExample() throws Exception { Module module = build.getModule("org.example:maven-archetype-simple:1.0-SNAPSHOT"); assertEquals(MAVEN_ARC_ARTIFACTS.length, CollectionUtils.size(module.getArtifacts())); assertNotSame(Collections.EMPTY_LIST, module.getDependencies()); - assertEquals(4, CollectionUtils.size(module.getProperties())); + assertEquals(5, CollectionUtils.size(module.getProperties())); } } @@ -215,14 +231,7 @@ private void checkDeployedArtifacts(ClientAndServer mockServer, String[] expecte * @throws JsonProcessingException - In case of parsing error */ private BuildInfo getAndAssertBuild(ClientAndServer mockServer) throws JsonProcessingException { - RequestDefinition[] requestDefinitions = mockServer.retrieveRecordedRequests(request("/artifactory/api/build")); - assertEquals(1, ArrayUtils.getLength(requestDefinitions)); - RequestDefinition buildInfoRequest = requestDefinitions[0]; - ObjectMapper mapper = new ObjectMapper(); - JsonNode buildInfoRequestNode = mapper.readTree(buildInfoRequest.toString()); - JsonNode body = buildInfoRequestNode.get("body"); - JsonNode json = body.get("json"); - BuildInfo build = mapper.readValue(json.toString(), BuildInfo.class); + BuildInfo build = getBuild(mockServer); assertNotNull(build); // Check common fields @@ -235,15 +244,21 @@ private BuildInfo getAndAssertBuild(ClientAndServer mockServer) throws JsonProce assertTrue(build.getDurationMillis() > 0); assertFalse(build.getProperties().isEmpty()); - // Check include exclude properties - Properties propertyExpectedToBeFiltered = new Properties(); - Properties propertyIsNotExpectedToBeFiltered = new Properties(); - propertyExpectedToBeFiltered.put("password", "password-password"); - propertyIsNotExpectedToBeFiltered.put("username", "admin-admin"); // Check build properties exclude - assertFalse(build.getProperties().contains(propertyExpectedToBeFiltered)); + assertFalse(build.getProperties().containsKey("password")); // Check module properties exclude - build.getModules().forEach((value) -> assertFalse(value.getProperties().contains(propertyExpectedToBeFiltered))); + build.getModules().forEach((value) -> assertFalse(value.getProperties().containsKey("password"))); return build; } + + private BuildInfo getBuild(ClientAndServer mockServer) throws JsonProcessingException { + RequestDefinition[] requestDefinitions = mockServer.retrieveRecordedRequests(request("/artifactory/api/build")); + assertEquals(1, ArrayUtils.getLength(requestDefinitions)); + RequestDefinition buildInfoRequest = requestDefinitions[0]; + ObjectMapper mapper = new ObjectMapper(); + JsonNode buildInfoRequestNode = mapper.readTree(buildInfoRequest.toString()); + JsonNode body = buildInfoRequestNode.get("body"); + JsonNode json = body.get("json"); + return mapper.readValue(json.toString(), BuildInfo.class); + } } diff --git a/src/test/resources/integration/maven-archetype-simple/settings.xml b/src/test/resources/integration/maven-archetype-simple/settings.xml new file mode 100644 index 0000000..3886da8 --- /dev/null +++ b/src/test/resources/integration/maven-archetype-simple/settings.xml @@ -0,0 +1,15 @@ + + + + artifactory-plugin-properties + + admin-admin + password-password + + + + + + artifactory-plugin-properties + + \ No newline at end of file diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/HEAD b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/config b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/config new file mode 100644 index 0000000..2b33137 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[remote "origin"] + url = https://github.com/jfrog/project-examples.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/description b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/applypatch-msg.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/applypatch-msg.sample new file mode 100755 index 0000000..a5d7b84 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/commit-msg.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/commit-msg.sample new file mode 100755 index 0000000..b58d118 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/fsmonitor-watchman.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/fsmonitor-watchman.sample new file mode 100755 index 0000000..14ed0aa --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/fsmonitor-watchman.sample @@ -0,0 +1,173 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + } + my $query = <<" END"; + ["query", "$git_work_tree", { + "since": $last_update_token, + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/post-update.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/post-update.sample new file mode 100755 index 0000000..ec17ec1 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-applypatch.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-applypatch.sample new file mode 100755 index 0000000..4142082 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-commit.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-commit.sample new file mode 100755 index 0000000..e144712 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-merge-commit.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-merge-commit.sample new file mode 100755 index 0000000..399eab1 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-push.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-push.sample new file mode 100755 index 0000000..4ce688d --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-rebase.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-rebase.sample new file mode 100755 index 0000000..6cbef5c --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-receive.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-receive.sample new file mode 100755 index 0000000..a1fd29e --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/prepare-commit-msg.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/prepare-commit-msg.sample new file mode 100755 index 0000000..10fa14c --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/push-to-checkout.sample b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/push-to-checkout.sample new file mode 100755 index 0000000..af5a0c0 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/index b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/index new file mode 100644 index 0000000..21e0fbf Binary files /dev/null and b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/index differ diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/info/exclude b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/HEAD b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/HEAD new file mode 100644 index 0000000..dc49129 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 9d22463a8327ca12045dea7c98fe24f92e817551 yahavi 1631012433 +0300 clone: from https://github.com/jfrog/project-examples.git diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/refs/heads/master b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/refs/heads/master new file mode 100644 index 0000000..dc49129 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 9d22463a8327ca12045dea7c98fe24f92e817551 yahavi 1631012433 +0300 clone: from https://github.com/jfrog/project-examples.git diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/refs/remotes/origin/HEAD b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/refs/remotes/origin/HEAD new file mode 100644 index 0000000..dc49129 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 9d22463a8327ca12045dea7c98fe24f92e817551 yahavi 1631012433 +0300 clone: from https://github.com/jfrog/project-examples.git diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/packed-refs b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/packed-refs new file mode 100644 index 0000000..1df2f53 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/packed-refs @@ -0,0 +1,89 @@ +# pack-refs with: peeled fully-peeled sorted +9d0d303dbc82131a1f1dc20dcbd04c531089d944 refs/remotes/origin/REL-BRANCH-multi-3.7 +cbd575903b1611556af36e2b8a3588585c47adea refs/remotes/origin/dependabot/maven/artifactory-maven-plugin-example/multi1/commons-io-commons-io-2.7 +046cfdd63af6d5b3bbb1bb14d350f190b3881dea refs/remotes/origin/dependabot/maven/circleci-example/circleci-generic-artifactory/multi1/commons-io-commons-io-2.7 +8dd9c7e6a4da68a9a2d5215de67b70c071b9b5e2 refs/remotes/origin/dependabot/maven/circleci-example/circleci-mvn-artifactory/multi1/commons-io-commons-io-2.7 +d5d0076a151636312fcff4c65a8502a8a57a40ac refs/remotes/origin/dependabot/maven/droneci-examples/drone-maven/multi1/commons-io-commons-io-2.7 +193fc91c5ead5d1455e2bfdb06da7560580b645d refs/remotes/origin/dependabot/maven/gitlabci-example/gitlabci-maven-artifactory/multi1/commons-io-commons-io-2.7 +6d71e42ad0a6ae695c0af3716b5c534b614a1fb9 refs/remotes/origin/dependabot/maven/maven-example/multi1/commons-io-commons-io-2.7 +576f8bde4fcc6f42bbb5ff8b6d7ec72c66a475c5 refs/remotes/origin/dependabot/maven/maven-examples/maven-example/multi1/commons-io-commons-io-2.7 +d7a2ff6bfce85f4628f25358e09d3f6a17ebb298 refs/remotes/origin/dependabot/pip/circleci-example/circleci-python-artifactory/pyyaml-5.4 +9d22463a8327ca12045dea7c98fe24f92e817551 refs/remotes/origin/master +b1f2a0d1f0013c6240383a51150a7ebc71201b6c refs/remotes/origin/openshift-s2i-examples +2d5014624b314fdb54c2ffd4332c2da16651dcdd refs/remotes/origin/test-branch +90486003ffd320136945325d6c0c56585c25b245 refs/tags/BADATCOMPUTER-multi-3.7 +^92ed53709c963b61d90a8fe1d4c6274ed3b9bd57 +4224d87dd2d524732836f22b44554def2edd395d refs/tags/BLUEJUH-multi-3.7 +^34e213833538e1fc46238342e9b86b1736245c31 +bff424e7fd467756b6b36ad930378a1def7c35f1 refs/tags/DEVOPSPROSIVA-multi-3.7 +^9a038935f5a3898accd82e96ab92602eebe2dfcc +b4054a248971c2894909c3a7a1e4b9c496a10bec refs/tags/DOCKERAPPvmulti-3.11 +^a4aecb5dd283961ca7140dc30fb06fc90c94046b +d5ca6644856514623f657b6cd840c66145dfd610 refs/tags/LYQWATERWAY-multi-3.103 +^fb2726d6691753ca262d7f4b5dc60f608e8e64c4 +7b6658337a5bd07c02e7f2ee9578d0942440f401 refs/tags/MANSIMRAN-multi-3.7 +^0d938eb024791f1ec828641db22aba30f37c9446 +46cf85648528432a7a3edf5d10dc85f845df43b1 refs/tags/MARKGALPIN-multi-3.10 +^ccd52ff89def3ce78c9d9832de5078a9b6afa79d +fdc41bbc31e0531f000291e8ae8adf4651e93903 refs/tags/MARKGALPIN-multi-3.11 +^8c798ef8703ee05c02754fa91164bb6f212ad10d +50538ad569f84160139b30cfc1372b36f9b0819d refs/tags/MARKGALPIN-multi-3.12 +^8cdee3a867ec5fdb6810904fb9606f77ec5a0983 +4dfdce9e474c5b05bb13c4d7907ae376751335ba refs/tags/MARKGALPIN2-multi-3.12 +^02c5b009f112875b48bd0da7314393fe04c3f18e +a9b30e14ff707e4c8ae70151e1e060c605dddde6 refs/tags/MARKGALPINmulti-3.9 +^95c2a2fa82a1db8dcc6dc78fd9b1c5dee57fd49c +6349094e00dc383517bddcf32ba5c77b5b4311e6 refs/tags/MISHESKA-multi-3.7 +^49bab3b8ecd3bd18a04ce47ed846bd180b6b8747 +0872b756a010ebed5b5d8a11fe62d576eaadc97e refs/tags/NATEFAERBER-multi-3.7 +^c3ed5ec379208e8726628ebe6957c8b2532a7ff7 +ba2b3e82eb0cd5c150d863745e6a7525134be16f refs/tags/NATEFAERBER-multi-3.8 +^63ba55f4b65f854984cca137c3ecd473052bed38 +be7cd62a470400d7feae61ff242cdb5d6611efbf refs/tags/RUNDERWO-multi-3.7 +^20a910752d80a59a7f81cc24348f8e47c9dd808d +536eb2e4a7d64f18ceab9bfabf404fdb45cfa3e3 refs/tags/RUNDERWO-multi-3.8 +^3b860b53583046ef0f1544f41a5e1a58c440d775 +b12f3f19da28d5c13a19d0d8239cf643f5352b69 refs/tags/STANLEYF-multi-3.14 +^00307437ba799f948a95b107f800e162754e1883 +ddb8c53878d66645b3fa01f0b9bef6f2284e8091 refs/tags/STANLEYF-multi-3.7 +^a878716ddbcd0b7f7114f301332031e8fe247433 +dbee7d07368ce7d87dc002b8f90f3fd128e4c7a3 refs/tags/STANLEYF-multi-3.8 +^aecdaa94dfd43fc49777bb96b4657a12b2dc7391 +41c9540c8f1895f447e69297e0372667b6c006a2 refs/tags/WQWATERWAY-multi-3.103 +^1d7b518e26ede2bd62e1102c9a44981a12bf0d6b +120eda43701c1bde2e6bdcc1a3bd96c313f12d16 refs/tags/davidwoon-multi-3.7 +^b67abae877f672a1fa767357a76f38747ebb9c0e +22903bfc95ed06878f268e979be0d889de7c5be5 refs/tags/kvuong30multi-3.18 +^ea0553bd5c798a7fbbf7415847dcfa88f10763b1 +4f916ea04126f53f4da385ecfc6078cd90c2b899 refs/tags/kvuong30multi-3.20 +^7c5d53d5221048d93d73199968a086c088bff409 +e764880082056d79df77c047ffe6fdcaffa9be5b refs/tags/kvuong30multi-3.23 +^0d28ae6e3b0258b4c00fbb2f36b5b81fca4ecefa +1aae47beba16fee7f12b740acb107b5cb4942726 refs/tags/kvuong30multi-3.24 +^8e25f7e2ca6054ae0b93c6e2748cb99d281faa8d +dd052bb5d211898d5196cc8a114002ae62896db3 refs/tags/kvuong30multi-3.25 +^bb3a34226356313caa70b7701d1c653d41411989 +0b8bc237eabd7c9e507e308a22a1f01fd7db53ac refs/tags/markgalpin-3.8 +^b18cb8a4f5d891ae5ca6948fa61c84fb503b7fbf +95c306e0c8886ea51f3f61a21fcbcff351badc77 refs/tags/multi-3.10 +^6bfa69c1ab12ea106ed38c44b8236dff386b2911 +93e00bda88760da18369b8fdaa65b3fab3140520 refs/tags/multi-3.7 +^4b3e12f9edfa7408975b7bd6c94acfb1ab6ffa0a +acb1bf29d0cf5e1ef0a2e20fc309f16aecc10c1d refs/tags/multi-3.9 +^8af3a427c0124e5ff9d1afb5600cbf796cb57389 +0b50109cc70170d387590f979a05b9d8a8d5c66a refs/tags/multi-6.12 +^bf9a8a9f41f307706d6df8765ccf5985044439da +4922f68ddb0e17cc7226f842609f776abd46e20e refs/tags/multi-6.13 +^5e8ee40d5385ca61a588f0ae7a833fb9b4873c7a +ac920cd36f11da1857614002882c8cf6c85a219d refs/tags/multi-6.14 +^739136166884489c97b490312a9638c783d4c4e9 +070a014724f2be00b1b93e0462a5748201c69593 refs/tags/multi-6.15 +^3b9d9e239dd37ae9002ac097caae0df774ba64a1 +4c3b825ec8a26d16eda1cebd89c5f730a2b867dd refs/tags/multi-6.16 +^b39f266efc676dd6c90b90837bb0d6da3f1dd055 +48aab09b21ce0767b47a034c28829894a5ffb886 refs/tags/multi-6.17 +^7c3913660f1fb1c9427093776e54043d3a639d88 +2d1e13230ff3e631eb3637a9f86a50e2013412e2 refs/tags/multi-6.18 +^cab5e6bbdc60ebe9d685cd03f61f00517994c701 +4a43c91e650604faca197d737f5e68e327959736 refs/tags/swong001-multi-3.7 +^1ce6bd94460a3cf3ffe5e86371e74aae113b8082 diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/refs/heads/master b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/refs/heads/master new file mode 100644 index 0000000..8c5cad5 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/refs/heads/master @@ -0,0 +1 @@ +9d22463a8327ca12045dea7c98fe24f92e817551 diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/refs/remotes/origin/HEAD b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/refs/remotes/origin/HEAD new file mode 100644 index 0000000..6efe28f --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/dotgit/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi1/pom.xml b/src/test/resources/integration/multi-module-filter-modules-properties/multi1/pom.xml new file mode 100644 index 0000000..286c6ee --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi1/pom.xml @@ -0,0 +1,77 @@ + + + 4.0.0 + + org.jfrog.test + multi + 3.7-SNAPSHOT + + + multi1 + jar + Multi 1 + + + + apache + none + + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + + + + + org.apache.commons + commons-email + 1.1 + compile + + + org.codehaus.plexus + plexus-utils + 1.5.1 + + + javax.servlet.jsp + jsp-api + 2.1 + compile + + + commons-io + commons-io + 1.4 + + + org.springframework + spring-aop + 2.5.6 + + + + + org.testng + testng + jdk15 + 5.9 + test + + + + diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi1/src/main/java/artifactory/test/Multi1.java b/src/test/resources/integration/multi-module-filter-modules-properties/multi1/src/main/java/artifactory/test/Multi1.java new file mode 100644 index 0000000..8e766e7 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi1/src/main/java/artifactory/test/Multi1.java @@ -0,0 +1,10 @@ +package artifactory.test; + +/** + * Hello world! + */ +public class Multi1 { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi1/src/test/java/artifactory/test/AppTest.java b/src/test/resources/integration/multi-module-filter-modules-properties/multi1/src/test/java/artifactory/test/AppTest.java new file mode 100644 index 0000000..442a365 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi1/src/test/java/artifactory/test/AppTest.java @@ -0,0 +1,38 @@ +package artifactory.test; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi2/pom.xml b/src/test/resources/integration/multi-module-filter-modules-properties/multi2/pom.xml new file mode 100644 index 0000000..e29f1ed --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi2/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + org.jfrog.test + multi + 3.7-SNAPSHOT + + + + ${project.parent.version} + + + multi2 + 3.7-SNAPSHOT + jar + Multi 2 + + diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi2/src/main/java/artifactory/test/App.java b/src/test/resources/integration/multi-module-filter-modules-properties/multi2/src/main/java/artifactory/test/App.java new file mode 100644 index 0000000..56915fd --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi2/src/main/java/artifactory/test/App.java @@ -0,0 +1,13 @@ +package artifactory.test; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi2/src/test/java/artifactory/test/AppTest.java b/src/test/resources/integration/multi-module-filter-modules-properties/multi2/src/test/java/artifactory/test/AppTest.java new file mode 100644 index 0000000..442a365 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi2/src/test/java/artifactory/test/AppTest.java @@ -0,0 +1,38 @@ +package artifactory.test; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi3/pom.xml b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/pom.xml new file mode 100644 index 0000000..c2c05e2 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/pom.xml @@ -0,0 +1,79 @@ + + + 4.0.0 + + org.jfrog.test + multi + 3.7-SNAPSHOT + + + multi3 + war + Multi 3 + + true + + + + + + ${project.groupId} + multi1 + ${project.parent.version} + + + + + hsqldb + hsqldb + 1.8.0.10 + runtime + + + + + javax.servlet + servlet-api + 2.5 + provided + + + + + + assembly + + + + maven-assembly-plugin + 2.2-beta-5 + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-war-plugin + + + false + + + + + + + + + diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/main/java/artifactory/test/Multi3.java b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/main/java/artifactory/test/Multi3.java new file mode 100644 index 0000000..76af503 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/main/java/artifactory/test/Multi3.java @@ -0,0 +1,11 @@ +package artifactory.test; + +/** + * Hello world! + */ +public class Multi3 { + public static void main(String[] args) { + new Multi1(); + System.out.println("Hello World!"); + } +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/main/webapp/WEB-INF/web.xml b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..f97cbaa --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,9 @@ + + + test-webapp + + \ No newline at end of file diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/test/java/artifactory/test/AppTest.java b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/test/java/artifactory/test/AppTest.java new file mode 100644 index 0000000..442a365 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/multi3/src/test/java/artifactory/test/AppTest.java @@ -0,0 +1,38 @@ +package artifactory.test; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/pom.xml b/src/test/resources/integration/multi-module-filter-modules-properties/pom.xml new file mode 100644 index 0000000..ed59922 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/pom.xml @@ -0,0 +1,117 @@ + + + 4.0.0 + org.jfrog.test + multi + 3.7-SNAPSHOT + pom + Simple Multi Modules Build + + + multi1 + multi2 + multi3 + + + + UTF-8 + 1.8 + 1.8 + ${artifactory.plugin.version} + + + + + junit + junit + 3.8.1 + test + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + org.apache.maven.plugins + maven-war-plugin + 2.4 + + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + + + + org.jfrog.buildinfo + artifactory-maven-plugin + ${artifactory.plugin.version} + + + + build-info + + publish + + + + awesome + + + false + *password*,*secret*,*key*,*token*,*passphrase* + + 60 + + + http://localhost:8081/artifactory + ${username} + ${password} + *-tests.jar + libs-release-local + libs-snapshot-local + + + plugin-demo + ${buildnumber} + http://build-url.org + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + false + + + + + org.apache.maven.plugins + maven-war-plugin + + + false + + + + + + diff --git a/src/test/resources/integration/multi-module-filter-modules-properties/settings.xml b/src/test/resources/integration/multi-module-filter-modules-properties/settings.xml new file mode 100644 index 0000000..3886da8 --- /dev/null +++ b/src/test/resources/integration/multi-module-filter-modules-properties/settings.xml @@ -0,0 +1,15 @@ + + + + artifactory-plugin-properties + + admin-admin + password-password + + + + + + artifactory-plugin-properties + + \ No newline at end of file diff --git a/src/test/resources/integration/multi-module-install-plugin-3/settings.xml b/src/test/resources/integration/multi-module-install-plugin-3/settings.xml new file mode 100644 index 0000000..3886da8 --- /dev/null +++ b/src/test/resources/integration/multi-module-install-plugin-3/settings.xml @@ -0,0 +1,15 @@ + + + + artifactory-plugin-properties + + admin-admin + password-password + + + + + + artifactory-plugin-properties + + \ No newline at end of file