[Geoserver-devel] [jira] Created: (GEOS-2921) main depends on ows tests, preventing no-test build

main depends on ows tests, preventing no-test build
---------------------------------------------------

                 Key: GEOS-2921
                 URL: http://jira.codehaus.org/browse/GEOS-2921
             Project: GeoServer
          Issue Type: Bug
          Components: Global
            Reporter: Ben Caradoc-Davies
            Assignee: Andrea Aime

GeoServer main depends on ows tests, so with an empty local maven repo, "mvn -Dmaven.test.skip install" fails. Bad dependency, perhaps needed only for test phase?

Workaround: Do Not Do That Then (TM).

[INFO] Building Main Module
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/car605/geoserver/cite/geoserver-trunk/src/main/target
[INFO] [cobertura:clean {execution: default}]
[INFO] [resources:resources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 28 resources
[INFO] skip non existing resourceDirectory /home/car605/geoserver/cite/geoserver-trunk/src/main/src/main/resources
[INFO] [compiler:compile]
[INFO] Compiling 220 source files to /home/car605/geoserver/cite/geoserver-trunk/src/main/target/classes
[INFO] [resources:testResources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 65 resources
Downloading: http://repo.opengeo.org//org/geoserver/ows/2.0-SNAPSHOT/ows-2.0-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.geoserver:ows:jar:tests:2.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=ows -Dversion=2.0-SNAPSHOT -Dclassifier=tests -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.geoserver -DartifactId=ows -Dversion=2.0-SNAPSHOT -Dclassifier=tests -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
    1) org.geoserver:main:jar:2.0-SNAPSHOT
    2) org.geoserver:ows:jar:tests:2.0-SNAPSHOT

----------
1 required artifact is missing.

for artifact:
  org.geoserver:main:jar:2.0-SNAPSHOT

from the specified remote repositories:
  maven-restlet (http://maven.restlet.org),
  central (http://repo1.maven.org/maven2),
  opengeo (http://repo.opengeo.org/),
  geotools (http://maven.geotools.fr/repository/)

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

     [ http://jira.codehaus.org/browse/GEOS-2921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Caradoc-Davies reopened GEOS-2921:
--------------------------------------

This *is* a bug. While use of -Dmaven.test.skip is not recommended, it is not deprecated. Failure to build with -Dmaven.test.skip indicates that the project has lost control of its dependencies, because you have *production* code that depends on *test* code. That is not right. Do you really want to ship and deploy test code on your production platforms? Really really?

I encourage developers to run tests. I have a bad reputation as a bit of a test nanny, but even I recognise that there are times when -Dmaven.test.skip is acceptable. Failure to support -Dmaven.test.skip leads to nasty silent failures, because you expose developers to silent capture of stale test jars in their local repo. Sure, they pretty much get what they deserve for using -Dmaven.test.skip, but in supporting -Dmaven.test.skip you improve the quality of the project through hygienic separation of test and production code.

Please reconsider.

main depends on ows tests, preventing no-test build
---------------------------------------------------

                Key: GEOS-2921
                URL: http://jira.codehaus.org/browse/GEOS-2921
            Project: GeoServer
         Issue Type: Bug
         Components: Global
           Reporter: Ben Caradoc-Davies
           Assignee: Andrea Aime
           Priority: Minor

GeoServer main depends on ows tests, so with an empty local maven repo, "mvn -Dmaven.test.skip install" fails. Bad dependency, perhaps needed only for test phase?
Workaround: Do Not Do That Then (TM).
[INFO] Building Main Module
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/car605/geoserver/cite/geoserver-trunk/src/main/target
[INFO] [cobertura:clean {execution: default}]
[INFO] [resources:resources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 28 resources
[INFO] skip non existing resourceDirectory /home/car605/geoserver/cite/geoserver-trunk/src/main/src/main/resources
[INFO] [compiler:compile]
[INFO] Compiling 220 source files to /home/car605/geoserver/cite/geoserver-trunk/src/main/target/classes
[INFO] [resources:testResources]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 65 resources
Downloading: http://repo.opengeo.org//org/geoserver/ows/2.0-SNAPSHOT/ows-2.0-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) org.geoserver:ows:jar:tests:2.0-SNAPSHOT
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=ows -Dversion=2.0-SNAPSHOT -Dclassifier=tests -Dpackaging=jar -Dfile=/path/to/file
  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.geoserver -DartifactId=ows -Dversion=2.0-SNAPSHOT -Dclassifier=tests -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
  Path to dependency:
    1) org.geoserver:main:jar:2.0-SNAPSHOT
    2) org.geoserver:ows:jar:tests:2.0-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
  org.geoserver:main:jar:2.0-SNAPSHOT
from the specified remote repositories:
  maven-restlet (http://maven.restlet.org),
  central (http://repo1.maven.org/maven2),
  opengeo (http://repo.opengeo.org/),
  geotools (http://maven.geotools.fr/repository/)

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira