Projekt-Dokumentation (Aktueller Stand von juplo.de) hinzugefĆ¼gt
[website] / dist / facebook-utils-2.5.0 / pitfalls.html
diff --git a/dist/facebook-utils-2.5.0/pitfalls.html b/dist/facebook-utils-2.5.0/pitfalls.html
new file mode 100644 (file)
index 0000000..ea7c22d
--- /dev/null
@@ -0,0 +1,290 @@
+<!DOCTYPE html>
+<!-- Generated by Apache Maven Doxia Site Renderer at Nov 10, 2015 -->
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <!-- Current: pitfalls.html -->
+<!-- Active: index.html -->
+<!-- Path: $path -->
+<!-- Skiplist: [index.html, getting-started.html] -->
+<html>
+  <head>
+    <title>juplo - </title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <link rel="canonical" href="http://www.juplo.de/facebook-utils/pitfalls.html"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+    <link rel="stylesheet" type="text/css" href="/css/base.css" />
+    <style type="text/css">
+      @import '/css/screen.css' screen;
+    </style>
+    <script src="/js/prettify.js"></script>
+    <!--[if lt IE 9]>
+      <script src="/js/html5shiv.js"></script>
+    <![endif]-->
+    <!--[if IE 8]>
+      <link rel="stylesheet" type="text/css" href="/css/ie8.css" />
+    <![endif]-->
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  </head>
+  <body class="menu" onload="prettyPrint()">
+    <div id="page" class="cf">
+      <header id="header">
+        <h1 id="logo"><a href="/" title="Home" class="l">juplo</a></h1>
+        <span id="slogan"><strong>Java</strong> bits from nerds for nerds</span>
+        <hr class="h" />
+      </header>
+      <div id="breadcrumb">
+        <strong class="b title">You are here:</strong>
+        <ol class="b">
+          <li class="b"><a class="b" href="/">Home</a></li>
+          <li class="b"><a class="b" href="/projects.html">Projects</a></li>
+                      <li class="b"><a class="b" href="./index.html">Juplo - Facebook Utils</a></li>
+                        <li class="b"><strong class="b">$shortTitle</strong></li>
+                  </ol>
+        <a class="hide" href="#navigation">Jump to navigation</a>
+        <hr class="b" />
+      </div>
+      <main class="content cf">
+        <article id="content" class="main">
+          <header><h1>$shortTitle</h1></header>
+          
+  <div class="section"><h2>Annotated classes in dependencies are not found.<a name="Annotated_classes_in_dependencies_are_not_found."></a></h2>
+  <p>
+  hibernate-maven-plugin by default scans dependencies in the scope
+  <tt>compile</tt>. You can configure it to scan dependencies in other
+  scopes as well. But it scans only direct dependencies. Transitive
+  dependencies are not scanned for annotated classes. If some of your
+  annotated classes are hidden in a transitive dependency, you can simply
+  add that dependency explicitly.
+  </p>
+  </div><div class="section"><h2>hibernate-maven-plugin always needs a database-connection<a name="hibernate-maven-plugin_always_needs_a_database-connection"></a></h2>
+  <p>
+  The default-configuration uses the EXPORT-target of the SchemaExport-Tool.
+  If you do not need to create a database with the evaluated schema, you can
+  use the NONE- or the SCRIPT-target.
+  This can be achieved with the command-line parameter
+  <tt>-Dhibernate.export.target=SCRIPT</tt> or with the following configuration:
+  </p>
+  <div class="prettyprint linenums lang-html"><pre>
+&lt;configuration&gt;
+  &lt;target&gt;SCRIPT&lt;/target&gt;
+&lt;/configuration&gt;</pre></div>
+  <p>
+  But even when no database is to be created, hibernate always needs to know
+  the dialect. Hence, the plugin will fail if this parameter is missing!
+  </p>
+  </div><div class="section"><h2>Dependency for driver-class XYZ is missing<a name="Dependency_for_driver-class_XYZ_is_missing"></a></h2>
+  <p>
+  One regular problem is the scope of the jdbc-driver-dependency.
+  It is very unlikely, that this dependency is needed at compile-time.
+  So a tidy maven-developer would usually scope it for <tt>runtime</tt>.
+  </p>
+  <p>
+  But this will break the execution of the <tt>hibernate-maven-plugin</tt>.
+  Since it will not be able to see the needed dependency, it will fail with
+  an error-message like:
+  </p>
+  <div class="prettyprint"><pre>
+[INFO] Gathered hibernate-configuration (turn on debugging for details):
+[INFO]   hibernate.connection.username = sa
+[INFO]   hibernate.connection.password = 
+[INFO]   hibernate.dialect = org.hibernate.dialect.HSQLDialect
+[INFO]   hibernate.connection.url = jdbc:hsqldb:/home/kai/mmf/target/mmf;shutdown=true
+[INFO]   hibernate.connection.driver_class = org.hsqldb.jdbcDriver
+[ERROR] Dependency for driver-class org.hsqldb.jdbcDriver is missing!
+[INFO] ------------------------------------------------------------------------
+[ERROR] BUILD ERROR
+[INFO] ------------------------------------------------------------------------
+[INFO] org.hsqldb.jdbcDriver
+[INFO] ------------------------------------------------------------------------
+[INFO] For more information, run Maven with the -e switch
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 2 seconds
+[INFO] Finished at: Thu Nov 29 11:31:14 CET 2012
+[INFO] Final Memory: 32M/342M
+[INFO] ------------------------------------------------------------------------</pre></div>
+  <p>
+  A quick workaround for this error would be, to delete the runtime-constraint
+  for the jdbc-driver-dependency.
+  </p>
+  <p>
+  A much cleaner way is, to (additionally) ad the dependency, to the
+  plugin-definition:
+  </p>
+  <div class="prettyprint linenums lang-html"><pre>
+&lt;plugin&gt;
+  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
+  &lt;artifactId&gt;hibernate-maven-plugin&lt;/artifactId&gt;
+  &lt;version&gt;${project.version}&lt;/version&gt;
+  &lt;executions&gt;
+    &lt;execution&gt;
+      &lt;goals&gt;
+        &lt;goal&gt;export&lt;/goal&gt;
+      &lt;/goals&gt;
+    &lt;/execution&gt;
+  &lt;/executions&gt;
+  &lt;dependencies&gt;
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
+    &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
+    &lt;version&gt;2.2.8&lt;/version&gt;
+  &lt;/dependency&gt;
+  &lt;/dependencies&gt;
+&lt;/plugin&gt;</pre></div>
+  <p>
+  This is also the best way, if you use a different jdbc-driver for
+  testing, than in production.
+  Because otherwise, this dependency will unnecessarily bloat the
+  runtime-dependencies of your project.
+  </p>
+  </div><div class="section"><h2 id="fails">DBUnit fails after execution of hibernate was skipped because nothing has changed</h2>
+  <p>
+  If hibernate-maven-plugin skips its excecution, this may lead to errors in
+  other plugins.
+  For example, when importing sample-data in the automatically created database
+  with the help of the <a class="externalLink" href="http://mojo.codehaus.org/dbunit-maven-plugin/">dbunit-plugin</a>,
+  the <tt>CLEAN_INSERT</tt>-operation may fail because of foreign-key-constraints,
+  if the database was not recreated, because the hibernate-maven-plugin has
+  skipped its excecution.
+  </p>
+  <p>
+  A quick fix to this problem is, to <a href="./force.html">force</a>
+  hibernate-maven-plugin to export the schema every time it is running.
+  But to recreate the database on every testrun may noticeable slow down your
+  development cycle, if you have to wait for slow IO.
+  </p>
+  <p>
+  To circumvent this problem, hibernate-maven-plugin signals a skipped
+  excecution by setting the  maven property <tt>$\{hibernate.export.skipped\}</tt> to
+  <tt>true</tt>.
+  You can configure other plugins to react on this signal.
+  For example, the dbunit-plugin can be configured to skip its excecution, if
+  hibernate-maven-plugin was skipped like this:
+  </p>
+  <div class="prettyprint linenums lang-html"><pre>
+&lt;plugin&gt;
+  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+  &lt;artifactId&gt;dbunit-maven-plugin&lt;/artifactId&gt;
+  &lt;configuration&gt;
+    &lt;skip&gt;${hibernate.export.skipped}&lt;/skip&gt;
+  &lt;/configuration&gt;
+&lt;/plugin&gt;</pre></div>
+  </div><div class="section"><h2>The database will not be recreated after a manual drop/clean<a name="The_database_will_not_be_recreated_after_a_manual_dropclean"></a></h2>
+  <p>
+  If one manually drops the database or removes the hsqldb-files, it will not
+  be recreated by the hibernate-maven-plugin, because it cannot detect, that
+  the database needs to be recreated.
+  This happens, because the plugin will not recreate the database if neither
+  the configuration nor the annotated classes have changed, because an
+  unnecessary drop-create-cycle might take a long time. The plugin will
+  report that like this:
+  </p>
+  <div class="prettyprint"><pre>
+[INFO] No modified annotated classes found and dialect unchanged.
+[INFO] Skipping schema generation!</pre></div>
+  <p>
+  If one always uses <tt>mvn clean</tt> for cleanup, this will not happen.
+  Otherwise the recreation must be <a href="./force.html">forced</a>:
+  </p>
+  <div class="prettyprint"><pre>
+mvn hibernate:export -Dhibernate.export.force=true</pre></div>
+  </div><div class="section"><h2>The hibernate:export goal is not executed, when tests are skipped<a name="The_hibernate:export_goal_is_not_executed_when_tests_are_skipped"></a></h2>
+  <p>
+  The hibernate-maven-plugin automatically skips its execution, when
+  <tt>maven.test.skip</tt> is set to <tt>true</tt>. If you need it to be always
+  executed, you can configure that explicitly like this:
+  </p>
+  <div class="prettyprint linenums lang-html"><pre>
+&lt;plugin&gt;
+  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
+  &lt;artifactId&gt;hibernate-maven-plugin&lt;/artifactId&gt;
+  ...
+  &lt;configuration&gt;
+    &lt;skip&gt;false&lt;/skip&gt;
+  &lt;/configuration&gt;
+&lt;/plugin&gt;</pre></div>
+  <p>
+  Background-information for this design-decission can be found on the extra
+  page <a href="./skip.html">To skip or not to skip: that is the question</a>...
+  </p>
+  </div><div class="section"><h2>I do not want my dependencies to be scanned for hibernate annotations<a name="I_do_not_want_my_dependencies_to_be_scanned_for_hibernate_annotations"></a></h2>
+  <p>
+    If you do not want your dependencies to be scanned for hibernate annotations,
+    you can pass <tt>-Dhibernate.export.scan_dependencies=none</tt> to maven
+    or set <tt>scanDependencies</tt> to <tt>none</tt> in the configuration
+    of the plugin like this:
+  </p>
+  <div class="prettyprint linenums lang-html"><pre>
+&lt;plugin&gt;
+  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
+  &lt;artifactId&gt;hibernate-maven-plugin&lt;/artifactId&gt;
+  ...
+  &lt;configuration&gt;
+    &lt;scanDependencies&gt;none&lt;/scanDependencies&gt;
+  &lt;/configuration&gt;
+&lt;/plugin&gt;</pre></div>
+  </div><div class="section"><h2>No annotated classes found<a name="No_annotated_classes_found"></a></h2>
+  <p>
+    If you are working under Windows and get the error-message
+    <tt>No annotated classes found in directory C:\projects\X Y Z\path-to-project\target\classes</tt>,
+    but you are really sure, that there are annotated classes in that
+    directory, you are expiriencing a bug, in the scannotation-library, that
+    was closed in version 1.1.0 of the hibernate-maven-plugin.
+  </p>
+  <p>
+    <b>
+      You should consider to upgrade to that version of the plugin.
+    </b>
+  </p>
+ </div>
+
+        </article>
+        <div class="marginal">
+          <nav id="nav">
+            <hr class="n" />
+            <a id="navigation"></a>
+            <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
+            <h2 class="nav menu">Section-Menu</h2>
+            <ul id="menu">
+              <li class="m blog"><a href="/blog/" class="m">Blog</a></li>
+              <li class="m projects"><a href="/projects.html" class="m selected">Projects</a></li>
+              <li class="m about"><a href="/about.html" class="m">About</a></li>
+            </ul>
+            <h2 class="nav submenu">
+              <span class="s">Submenu for section</span>
+              <a class="s selected" href="/projects.html">Projects</a>
+            </h2>
+            <ul id="submenu" class="s">
+                                                              <li class="s sub off"><a class="s" href="/hibernate4-maven-plugin/">Hibernate 4 Maven Plugin</a></li>
+                                          </ul>
+            <hr class="n" />
+          </nav>
+          <aside class="m">
+            <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+              <img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
+            </a>
+          </aside>
+        </div>
+      </main>
+      <footer id="footer">
+        <hr class="f" />
+        <ul id="footerlinks">
+          <li class="f" id="copyright">&#xa9; <strong>mo</strong>             2015
+      </li>
+          <li class="f"><a class="f" href="/impressum.html">Impressum</a></li>
+          <li class="f about"><a class="f" href="/about.html">About</a></li>
+        </ul>
+      </footer>
+    </div>
+        <script type="text/javascript"><!--//--><![CDATA[//><!--
+      var _gaq = _gaq || [];
+      _gaq.push(['_setAccount', 'UA-571104-3']);
+      _gaq.push(['_trackPageview']);
+      (function() {
+        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+      })();
+    //--><!]]>
+    </script>
+      </body>
+</html>